diff mbox

[05/14] spi: lm70llp: return proper error values from attach

Message ID 1428492040-5581-6-git-send-email-sudipm.mukherjee@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sudip Mukherjee April 8, 2015, 11:20 a.m. UTC
now that we are monitoring the return value from attach, make the
required changes to return proper value from its attach function.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index ba72347..9b0fde1 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -190,7 +190,7 @@  static u32 lm70_txrx(struct spi_device *spi, unsigned nsecs, u32 word, u8 bits)
 	return bitbang_txrx_be_cpha0(spi, nsecs, 0, 0, word, bits);
 }
 
-static void spi_lm70llp_attach(struct parport *p)
+static int spi_lm70llp_attach(struct parport *p)
 {
 	struct pardevice	*pd;
 	struct spi_lm70llp	*pp;
@@ -201,7 +201,7 @@  static void spi_lm70llp_attach(struct parport *p)
 		printk(KERN_WARNING
 			"%s: spi_lm70llp instance already loaded. Aborting.\n",
 			DRVNAME);
-		return;
+		return -EALREADY;
 	}
 
 	/* TODO:  this just _assumes_ a lm70 is there ... no probe;
@@ -281,7 +281,7 @@  static void spi_lm70llp_attach(struct parport *p)
 	pp->spidev_lm70->bits_per_word = 8;
 
 	lm70llp = pp;
-	return;
+	return 0;
 
 out_bitbang_stop:
 	spi_bitbang_stop(&pp->bitbang);
@@ -296,6 +296,7 @@  out_free_master:
 	(void) spi_master_put(master);
 out_fail:
 	pr_info("%s: spi_lm70llp probe fail, status %d\n", DRVNAME, status);
+	return status;
 }
 
 static void spi_lm70llp_detach(struct parport *p)