mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-18 06:58:54 +00:00
net: macb: check clk_set_rate return value to be negative
clk_set_rate() returns the set rate in case of success and a
negative number in case of failure. Consider failure only the
negative numbers.
Fixes: 3ef64444de
("dm: net: macb: Implement link speed change callback")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
This commit is contained in:
parent
bb890f75d5
commit
96449581b3
1 changed files with 1 additions and 1 deletions
|
@ -631,7 +631,7 @@ int __weak macb_linkspd_cb(struct udevice *dev, unsigned int speed)
|
||||||
|
|
||||||
if (tx_clk.dev) {
|
if (tx_clk.dev) {
|
||||||
ret = clk_set_rate(&tx_clk, rate);
|
ret = clk_set_rate(&tx_clk, rate);
|
||||||
if (ret)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue