linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: dsa: loop: Print when registration is successful
@ 2020-07-08  4:45 Florian Fainelli
  2020-07-08 12:58 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Fainelli @ 2020-07-08  4:45 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Andrew Lunn, Vivien Didelot, David S. Miller,
	Jakub Kicinski, open list

We have a number of error conditions that can lead to the driver not
probing successfully, move the print when we are sure
dsa_register_switch() has suceeded. This avoids repeated prints in case
of probe deferral for instance.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/dsa_loop.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 400207c5c7de..f8bc85a6e670 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -280,13 +280,11 @@ static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
 	struct dsa_loop_pdata *pdata = mdiodev->dev.platform_data;
 	struct dsa_loop_priv *ps;
 	struct dsa_switch *ds;
+	int ret;
 
 	if (!pdata)
 		return -ENODEV;
 
-	dev_info(&mdiodev->dev, "%s: 0x%0x\n",
-		 pdata->name, pdata->enabled_ports);
-
 	ds = devm_kzalloc(&mdiodev->dev, sizeof(*ds), GFP_KERNEL);
 	if (!ds)
 		return -ENOMEM;
@@ -311,7 +309,12 @@ static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
 
 	dev_set_drvdata(&mdiodev->dev, ds);
 
-	return dsa_register_switch(ds);
+	ret = dsa_register_switch(ds);
+	if (!ret)
+		dev_info(&mdiodev->dev, "%s: 0x%0x\n",
+			 pdata->name, pdata->enabled_ports);
+
+	return ret;
 }
 
 static void dsa_loop_drv_remove(struct mdio_device *mdiodev)
-- 
2.25.1


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

* Re: [PATCH net-next] net: dsa: loop: Print when registration is successful
  2020-07-08  4:45 [PATCH net-next] net: dsa: loop: Print when registration is successful Florian Fainelli
@ 2020-07-08 12:58 ` Andrew Lunn
  2020-07-08 15:41 ` Vivien Didelot
  2020-07-08 17:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2020-07-08 12:58 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Vivien Didelot, David S. Miller, Jakub Kicinski, open list

On Tue, Jul 07, 2020 at 09:45:13PM -0700, Florian Fainelli wrote:
> We have a number of error conditions that can lead to the driver not
> probing successfully, move the print when we are sure
> dsa_register_switch() has suceeded. This avoids repeated prints in case
> of probe deferral for instance.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

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

* Re: [PATCH net-next] net: dsa: loop: Print when registration is successful
  2020-07-08  4:45 [PATCH net-next] net: dsa: loop: Print when registration is successful Florian Fainelli
  2020-07-08 12:58 ` Andrew Lunn
@ 2020-07-08 15:41 ` Vivien Didelot
  2020-07-08 17:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vivien Didelot @ 2020-07-08 15:41 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: netdev, Florian Fainelli, Andrew Lunn, David S. Miller,
	Jakub Kicinski, open list

On Tue,  7 Jul 2020 21:45:13 -0700, Florian Fainelli <f.fainelli@gmail.com> wrote:
> We have a number of error conditions that can lead to the driver not
> probing successfully, move the print when we are sure
> dsa_register_switch() has suceeded. This avoids repeated prints in case
> of probe deferral for instance.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com>

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

* Re: [PATCH net-next] net: dsa: loop: Print when registration is successful
  2020-07-08  4:45 [PATCH net-next] net: dsa: loop: Print when registration is successful Florian Fainelli
  2020-07-08 12:58 ` Andrew Lunn
  2020-07-08 15:41 ` Vivien Didelot
@ 2020-07-08 17:14 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-07-08 17:14 UTC (permalink / raw)
  To: f.fainelli; +Cc: netdev, andrew, vivien.didelot, kuba, linux-kernel

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Tue,  7 Jul 2020 21:45:13 -0700

> We have a number of error conditions that can lead to the driver not
> probing successfully, move the print when we are sure
> dsa_register_switch() has suceeded. This avoids repeated prints in case
> of probe deferral for instance.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Applied.

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

end of thread, other threads:[~2020-07-08 17:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08  4:45 [PATCH net-next] net: dsa: loop: Print when registration is successful Florian Fainelli
2020-07-08 12:58 ` Andrew Lunn
2020-07-08 15:41 ` Vivien Didelot
2020-07-08 17:14 ` David Miller

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