[3.13.y.z extended stable] Patch "i2c: mv64xxx: continue probe when clock-frequency is missing" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Sep 30 21:29:48 UTC 2014

This is a note to let you know that I have just added a patch titled

    i2c: mv64xxx: continue probe when clock-frequency is missing

to the linux-3.13.y-queue branch of the 3.13.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y.z tree, see



>From 54add4cab769ab38ac411ad1efabe9341439e094 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <wens at csie.org>
Date: Mon, 1 Sep 2014 22:28:13 +0800
Subject: i2c: mv64xxx: continue probe when clock-frequency is missing

commit 0ce4bc1dbdd911ae1763e2d4ff36bd1b214a59f7 upstream.

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

This issue was discovered after the property was removed from all
sunxi DTs.

Fixes: 4c730a06c19bb ("i2c: mv64xxx: Set bus frequency to 100kHz if clock-frequency is not provided")
Signed-off-by: Chen-Yu Tsai <wens at csie.org>
Acked-by: Andrew Lunn <andrew at lunn.ch>
Acked-by: Maxime Ripard <maxime.ripard at free-electrons.com>
Signed-off-by: Wolfram Sang <wsa at the-dreams.de>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/i2c/busses/i2c-mv64xxx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index d52d849..cf89175 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -748,8 +748,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,

More information about the kernel-team mailing list