diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2015-04-16 22:00:45 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-04-17 07:31:35 +0200 |
commit | f993f94ae785bd38c95acdb8845de52d35c67d56 (patch) | |
tree | 9207c7fc536cc4b37ad341a32b14cf543ca2dfea /drivers/i2c | |
parent | 4f315f3670dc742153b60cda4d5703b706bb6cf8 (diff) | |
download | barebox-f993f94ae785bd38c95acdb8845de52d35c67d56.tar.gz barebox-f993f94ae785bd38c95acdb8845de52d35c67d56.tar.xz |
i2c: mv64xxx: continue probe when clock-frequency is missing
Based on this linux kernel commit:
commit 0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7
Author: Chen-Yu Tsai <wens@csie.org>
Date: Mon Sep 1 22:28:13 2014 +0800
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.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 6d8c85b9d7..4fd3a6f778 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c @@ -540,8 +540,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, } tclk = clk_get_rate(drv_data->clk); - rc = of_property_read_u32(np, "clock-frequency", &bus_freq); - if (rc) + if (of_property_read_u32(np, "clock-frequency", &bus_freq)) bus_freq = 100000; /* 100kHz by default */ if (!mv64xxx_find_baud_factors(bus_freq, tclk, |