archive mirror
 help / color / mirror / Atom feed
From: Samuel Holland <>
To: Gregory CLEMENT <>,
	Wolfram Sang <>,
	Samuel Holland <>,
	Dan Carpenter <>
Subject: [PATCH] i2c: mv64xxx: Fix check for missing clock
Date: Mon,  8 Feb 2021 00:19:22 -0600	[thread overview]
Message-ID: <> (raw)

In commit e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support"), error
pointers to optional clocks were replaced by NULL to simplify the resume
callback implementation. However, that commit missed that the IS_ERR
check in mv64xxx_of_config should be replaced with a NULL check. As a
result, the check always passes, even for an invalid device tree.

Fixes: e5c02cf54154 ("i2c: mv64xxx: Add runtime PM support")
Reported-by: Dan Carpenter <>
Signed-off-by: Samuel Holland <>
 drivers/i2c/busses/i2c-mv64xxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index b03c344323d1..c590d36b5fd1 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -813,7 +813,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
 	 * need to know tclk in order to calculate bus clock
 	 * factors.
-	if (IS_ERR(drv_data->clk)) {
+	if (!drv_data->clk) {
 		rc = -ENODEV;
 		goto out;

             reply	other threads:[~2021-02-08  6:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08  6:19 Samuel Holland [this message]
2021-02-09 10:42 ` [PATCH] i2c: mv64xxx: Fix check for missing clock Wolfram Sang
2021-02-08  6:28 [PATCH net-next RESEND 0/5] dwmac-sun8i cleanup and shutdown hook Samuel Holland
2021-02-08  6:28 ` [PATCH] i2c: mv64xxx: Fix check for missing clock Samuel Holland
2021-02-08  6:31   ` Samuel Holland
2021-02-08 13:20     ` Andrew Lunn
2021-02-09  3:05       ` Samuel Holland
2021-02-08 21:11     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).