mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: "Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"Daniel Brát" <danek.brat@gmail.com>
Subject: [PATCH] i2c: bcm283x: fix use of unregistered device in debug print
Date: Thu,  1 Dec 2022 14:38:46 +0100	[thread overview]
Message-ID: <20221201133846.639078-1-a.fatoum@pengutronix.de> (raw)

bcm283x_i2c_init is called before the i2c adapter device is allocated
and thus these message are prefixed with "<NULL>:". Use the hardware
device instead to fix this.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Cc: Daniel Brát <danek.brat@gmail.com>
---
 drivers/i2c/busses/i2c-bcm283x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-bcm283x.c b/drivers/i2c/busses/i2c-bcm283x.c
index fdba3b91bd4c..d9bbc17b1368 100644
--- a/drivers/i2c/busses/i2c-bcm283x.c
+++ b/drivers/i2c/busses/i2c-bcm283x.c
@@ -74,7 +74,7 @@ static inline struct bcm283x_i2c *to_bcm283x_i2c(struct i2c_adapter *adapter)
 
 static inline int bcm283x_i2c_init(struct bcm283x_i2c *bcm_i2c)
 {
-	struct device_d *dev = &bcm_i2c->adapter.dev;
+	struct device_d *dev = bcm_i2c->adapter.dev.parent;
 	u32 mclk_rate, cdiv, redl, fedl;
 
 	/*
-- 
2.30.2




             reply	other threads:[~2022-12-01 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 13:38 Ahmad Fatoum [this message]
2022-12-02  8:54 ` Sascha Hauer

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20221201133846.639078-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=danek.brat@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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