netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] net: dsa: sja1105: print info about probet chip only after every thing was done.
@ 2019-11-25 10:02 Oleksij Rempel
  2019-11-25 10:02 ` [PATCH v1 2/2] net: dsa: sja1105: fix sja1105_parse_rgmii_delays() Oleksij Rempel
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Oleksij Rempel @ 2019-11-25 10:02 UTC (permalink / raw)
  To: mkl, Vladimir Oltean, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, David S. Miller
  Cc: Oleksij Rempel, kernel, netdev, linux-kernel, david

Currently we will get "Probed switch chip" notification multiple times
if first probe filed by some reason. To avoid this confusing notifications move
dev_info to the end of probe.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/sja1105/sja1105_main.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
index 7687ddcae159..1238fd68b2cd 100644
--- a/drivers/net/dsa/sja1105/sja1105_main.c
+++ b/drivers/net/dsa/sja1105/sja1105_main.c
@@ -2191,8 +2191,6 @@ static int sja1105_probe(struct spi_device *spi)
 		return rc;
 	}
 
-	dev_info(dev, "Probed switch chip: %s\n", priv->info->name);
-
 	ds = dsa_switch_alloc(dev, SJA1105_NUM_PORTS);
 	if (!ds)
 		return -ENOMEM;
@@ -2218,7 +2216,13 @@ static int sja1105_probe(struct spi_device *spi)
 
 	sja1105_tas_setup(ds);
 
-	return dsa_register_switch(priv->ds);
+	rc = dsa_register_switch(priv->ds);
+	if (rc)
+		return rc;
+
+	dev_info(dev, "Probed switch chip: %s\n", priv->info->name);
+
+	return 0;
 }
 
 static int sja1105_remove(struct spi_device *spi)
-- 
2.24.0


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

end of thread, other threads:[~2019-11-25 15:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25 10:02 [PATCH v1 1/2] net: dsa: sja1105: print info about probet chip only after every thing was done Oleksij Rempel
2019-11-25 10:02 ` [PATCH v1 2/2] net: dsa: sja1105: fix sja1105_parse_rgmii_delays() Oleksij Rempel
2019-11-25 10:10   ` Vladimir Oltean
2019-11-25 10:19 ` [PATCH v1 1/2] net: dsa: sja1105: print info about probet chip only after every thing was done Vladimir Oltean
2019-11-25 15:23   ` Andrew Lunn
2019-11-25 10:22 ` Vladimir Oltean
2019-11-25 10:31   ` Oleksij Rempel
2019-11-25 10:39     ` Vladimir Oltean
2019-11-25 11:09       ` Oleksij Rempel
2019-11-25 15:05 ` Andrew Lunn

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