linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: mcp251x: add some messages to mcp251x_can_probe()
@ 2016-05-29  1:59 Ed Spiridonov
  2016-06-17  9:22 ` Marc Kleine-Budde
  0 siblings, 1 reply; 6+ messages in thread
From: Ed Spiridonov @ 2016-05-29  1:59 UTC (permalink / raw)
  To: mkl; +Cc: linux-can, Ed Spiridonov

Print error message if mcp251x_hw_probe() fails (e.g. MCP2515 isn't connected or other wiring issue).
Print information message if mcp251x_can_probe() is successful.
---
 drivers/net/can/spi/mcp251x.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index cf36d26..49453f7 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -1145,8 +1145,10 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 	/* Here is OK to not lock the MCP, no one knows about it yet */
 	ret = mcp251x_hw_probe(spi);
-	if (ret)
+	if (ret) {
+		dev_err(&spi->dev, "hw_probe failed, err=%d (wrong wiring?)\n", -ret);
 		goto error_probe;
+	}
 
 	mcp251x_hw_sleep(spi);
 
@@ -1156,6 +1158,8 @@ static int mcp251x_can_probe(struct spi_device *spi)
 
 	devm_can_led_init(net);
 
+	netdev_info(net, "successfully initialized.\n");
+
 	return 0;
 
 error_probe:
-- 
2.7.0


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

end of thread, other threads:[~2016-06-20 18:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-29  1:59 [PATCH] can: mcp251x: add some messages to mcp251x_can_probe() Ed Spiridonov
2016-06-17  9:22 ` Marc Kleine-Budde
2016-06-17 20:41   ` Ed Spiridonov
2016-06-18  8:41     ` Oliver Hartkopp
     [not found]   ` <CACm0Nn320ry07YOuorrMO=u8Q4+JsOd9i3s7eFAwQ-L8AWGm=Q@mail.gmail.com>
2016-06-20  8:47     ` Marc Kleine-Budde
2016-06-20 18:49       ` Ed Spiridonov

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