-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: ethernet: stm32: HAL return value handling #97281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9cf71bb
a664bdc
fa10687
07f54a5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,8 @@ static int mdio_stm32_read(const struct device *dev, uint8_t prtad, | |
{ | ||
struct mdio_stm32_data *const dev_data = dev->data; | ||
ETH_HandleTypeDef *heth = &dev_data->heth; | ||
HAL_StatusTypeDef ret; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't it happen that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same answer as for the write case, see below. |
||
uint32_t read; | ||
int ret; | ||
|
||
k_sem_take(&dev_data->sem, K_FOREVER); | ||
|
||
|
@@ -59,15 +59,15 @@ static int mdio_stm32_read(const struct device *dev, uint8_t prtad, | |
|
||
*data = read & ADIN1100_REG_VALUE_MASK; | ||
|
||
return ret; | ||
return 0; | ||
} | ||
|
||
static int mdio_stm32_write(const struct device *dev, uint8_t prtad, | ||
uint8_t regad, uint16_t data) | ||
{ | ||
struct mdio_stm32_data *const dev_data = dev->data; | ||
ETH_HandleTypeDef *heth = &dev_data->heth; | ||
int ret; | ||
HAL_StatusTypeDef ret; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't it happen that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT, looking at the HAL functions, the PHY device and register addresses are loaded together and a timeout is returned when the full data transmission does not complete in the due time. Another error case is when nothing can be transmitted (PHY is not ready for a new transmission) in which case none of the device and register addresses are loaded into the PHY. |
||
|
||
k_sem_take(&dev_data->sem, K_FOREVER); | ||
|
||
|
@@ -85,7 +85,7 @@ static int mdio_stm32_write(const struct device *dev, uint8_t prtad, | |
return -EIO; | ||
} | ||
|
||
return ret; | ||
return 0; | ||
} | ||
|
||
#ifdef CONFIG_ETH_STM32_HAL_API_V1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in commit message for
drivers: ethernet: stm32: clean HAL_ETH_{Set|Get}DMAError() value test
retrun
-->return
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and I guessnvm, it returns a u32test against 0
==>against HAL_OK
too