diff mbox

softingcs: ret is never non-zero, so remove non-zero check and -ENODEV return

Message ID 20170111150238.19845-1-colin.king@canonical.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Colin Ian King Jan. 11, 2017, 3:02 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The error return ret is never zero in the error handling path in
softingcs_probe, so the check for non-zero and returning -ENODEV
is logically dead code and hence redundant.  Remove it and just
return ret.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/can/softing/softing_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marc Kleine-Budde Jan. 18, 2017, 2:44 p.m. UTC | #1
On 01/11/2017 04:02 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The error return ret is never zero in the error handling path in
> softingcs_probe, so the check for non-zero and returning -ENODEV
> is logically dead code and hence redundant.  Remove it and just
> return ret.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Thanks, applied to can-next.

Marc
diff mbox

Patch

diff --git a/drivers/net/can/softing/softing_cs.c b/drivers/net/can/softing/softing_cs.c
index cdc0c74..4d44928 100644
--- a/drivers/net/can/softing/softing_cs.c
+++ b/drivers/net/can/softing/softing_cs.c
@@ -310,7 +310,7 @@  static int softingcs_probe(struct pcmcia_device *pcmcia)
 pcmcia_failed:
 	pcmcia_disable_device(pcmcia);
 	pcmcia->priv = NULL;
-	return ret ?: -ENODEV;
+	return ret;
 }
 
 static const struct pcmcia_device_id softingcs_ids[] = {