Skip to content

Commit 0ce4bc1

Browse files
wensWolfram Sang
authored andcommitted
i2c: mv64xxx: continue probe when clock-frequency is missing
The "clock-frequency" DT property is listed as optional, However, the current code stores the return value of of_property_read_u32 in the return code of mv64xxx_of_config, but then forgets to clear it after setting the default value of "clock-frequency". It is then passed out to the main probe function, resulting in a probe failure when "clock-frequency" is missing. This patch checks and then throws away the return value of of_property_read_u32, instead of storing it and having to clear it afterwards. This issue was discovered after the property was removed from all sunxi DTs. Fixes: 4c730a0 ("i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Cc: stable@vger.kernel.org Acked-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent dd318b0 commit 0ce4bc1

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/i2c/busses/i2c-mv64xxx.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
746746
}
747747
tclk = clk_get_rate(drv_data->clk);
748748

749-
rc = of_property_read_u32(np, "clock-frequency", &bus_freq);
750-
if (rc)
749+
if (of_property_read_u32(np, "clock-frequency", &bus_freq))
751750
bus_freq = 100000; /* 100kHz by default */
752751

753752
if (!mv64xxx_find_baud_factors(bus_freq, tclk,

0 commit comments

Comments
 (0)