mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net/e1000: fix driver probing in the presence of two e1000 devices
@ 2018-01-11  9:03 Uwe Kleine-König
  2018-01-17  8:03 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König @ 2018-01-11  9:03 UTC (permalink / raw)
  To: barebox

The .id member of the struct device for the invm device is not
initialized and so implicitly zero. This yields:

	register_device: already registered invm0

for the second i210 during probe.

So use the parent's id to initialize the id for invm, too, as is already
done for the corresponding e1000-nor device.

Fixes: a74b97f009c6 ("e1000: Expose i210's iNVM as a cdev")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/e1000/eeprom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
index 23fb05ec72bc..748d8afe7922 100644
--- a/drivers/net/e1000/eeprom.c
+++ b/drivers/net/e1000/eeprom.c
@@ -1504,6 +1504,7 @@ int e1000_register_invm(struct e1000_hw *hw)
 		return ret;
 
 	strcpy(hw->invm.dev.name, "invm");
+	hw->invm.dev.id = hw->dev->id;
 	hw->invm.dev.parent = hw->dev;
 	ret = register_device(&hw->invm.dev);
 	if (ret < 0) {
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] net/e1000: fix driver probing in the presence of two e1000 devices
  2018-01-11  9:03 [PATCH] net/e1000: fix driver probing in the presence of two e1000 devices Uwe Kleine-König
@ 2018-01-17  8:03 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-01-17  8:03 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: barebox

On Thu, Jan 11, 2018 at 10:03:26AM +0100, Uwe Kleine-König wrote:
> The .id member of the struct device for the invm device is not
> initialized and so implicitly zero. This yields:
> 
> 	register_device: already registered invm0
> 
> for the second i210 during probe.
> 
> So use the parent's id to initialize the id for invm, too, as is already
> done for the corresponding e1000-nor device.
> 
> Fixes: a74b97f009c6 ("e1000: Expose i210's iNVM as a cdev")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied, thanks

Sascha

> ---
>  drivers/net/e1000/eeprom.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/e1000/eeprom.c b/drivers/net/e1000/eeprom.c
> index 23fb05ec72bc..748d8afe7922 100644
> --- a/drivers/net/e1000/eeprom.c
> +++ b/drivers/net/e1000/eeprom.c
> @@ -1504,6 +1504,7 @@ int e1000_register_invm(struct e1000_hw *hw)
>  		return ret;
>  
>  	strcpy(hw->invm.dev.name, "invm");
> +	hw->invm.dev.id = hw->dev->id;
>  	hw->invm.dev.parent = hw->dev;
>  	ret = register_device(&hw->invm.dev);
>  	if (ret < 0) {
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2018-01-17  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-11  9:03 [PATCH] net/e1000: fix driver probing in the presence of two e1000 devices Uwe Kleine-König
2018-01-17  8:03 ` Sascha Hauer

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