Skip to content

Commit bc30c15

Browse files
geertuvinodkoul
authored andcommitted
phy: phy-can-transceiver: Skip warning if no "max-bitrate"
According to the DT bindings, the "max-bitrate" property is optional. However, when it is not present, a warning is printed. Fix this by adding a missing check for -EINVAL. Fixes: a4a86d2 ("phy: phy-can-transceiver: Add support for generic CAN transceiver driver") Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/88e158f97dd52ebaa7126cd9631f34764b9c0795.1674037334.git.geert+renesas@glider.be Signed-off-by: Vinod Koul <[email protected]>
1 parent c63835b commit bc30c15

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/phy/phy-can-transceiver.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
9999
struct gpio_desc *standby_gpio;
100100
struct gpio_desc *enable_gpio;
101101
u32 max_bitrate = 0;
102+
int err;
102103

103104
can_transceiver_phy = devm_kzalloc(dev, sizeof(struct can_transceiver_phy), GFP_KERNEL);
104105
if (!can_transceiver_phy)
@@ -124,8 +125,8 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
124125
return PTR_ERR(phy);
125126
}
126127

127-
device_property_read_u32(dev, "max-bitrate", &max_bitrate);
128-
if (!max_bitrate)
128+
err = device_property_read_u32(dev, "max-bitrate", &max_bitrate);
129+
if ((err != -EINVAL) && !max_bitrate)
129130
dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitrate limit\n");
130131
phy->attrs.max_link_rate = max_bitrate;
131132

0 commit comments

Comments
 (0)