mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] i2c: bcm283x: fix use of unregistered device in debug print
@ 2022-12-01 13:38 Ahmad Fatoum
  2022-12-02  8:54 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2022-12-01 13:38 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum, Daniel Brát

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: bcm283x: fix use of unregistered device in debug print
  2022-12-01 13:38 [PATCH] i2c: bcm283x: fix use of unregistered device in debug print Ahmad Fatoum
@ 2022-12-02  8:54 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-12-02  8:54 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox, Daniel Brát

On Thu, Dec 01, 2022 at 02:38:46PM +0100, Ahmad Fatoum wrote:
> 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(-)

Applied, thanks

Sascha

> 
> 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
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-12-02  8:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 13:38 [PATCH] i2c: bcm283x: fix use of unregistered device in debug print Ahmad Fatoum
2022-12-02  8:54 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox