[PATCH 06/14] spi: butterfly: return proper error values from attach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 drivers/spi/spi-butterfly.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-butterfly.c b/drivers/spi/spi-butterfly.c
index 9a95862..7df16c8 100644
--- a/drivers/spi/spi-butterfly.c
+++ b/drivers/spi/spi-butterfly.c
@@ -190,7 +190,7 @@ static struct flash_platform_data flash = {
 /* REVISIT remove this ugly global and its "only one" limitation */
 static struct butterfly *butterfly;
 
-static void butterfly_attach(struct parport *p)
+static int butterfly_attach(struct parport *p)
 {
 	struct pardevice	*pd;
 	int			status;
@@ -199,7 +199,7 @@ static void butterfly_attach(struct parport *p)
 	struct device		*dev = p->physport->dev;
 
 	if (butterfly || !dev)
-		return;
+		return -ENODEV;
 
 	/* REVISIT:  this just _assumes_ a butterfly is there ... no probe,
 	 * and no way to be selective about what it binds to.
@@ -287,7 +287,7 @@ static void butterfly_attach(struct parport *p)
 
 	pr_info("%s: AVR Butterfly\n", p->name);
 	butterfly = pp;
-	return;
+	return 0;
 
 clean2:
 	/* turn off VCC */
@@ -300,6 +300,7 @@ clean0:
 	(void) spi_master_put(pp->bitbang.master);
 done:
 	pr_debug("%s: butterfly probe, fail %d\n", p->name, status);
+	return status;
 }
 
 static void butterfly_detach(struct parport *p)
-- 
1.8.1.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux