From: Ed Spiridonov <edo.rus@gmail.com>
To: mkl@pengutronix.de
Cc: linux-can@vger.kernel.org, Ed Spiridonov <edo.rus@gmail.com>
Subject: [PATCH] can: mcp251x: add some messages to mcp251x_can_probe()
Date: Sun, 29 May 2016 04:59:16 +0300 [thread overview]
Message-ID: <1464487156-20858-1-git-send-email-edo.rus@gmail.com> (raw)
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
next reply other threads:[~2016-05-29 1:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-29 1:59 Ed Spiridonov [this message]
2016-06-17 9:22 ` [PATCH] can: mcp251x: add some messages to mcp251x_can_probe() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464487156-20858-1-git-send-email-edo.rus@gmail.com \
--to=edo.rus@gmail.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).