lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428492040-5581-6-git-send-email-sudipm.mukherjee@gmail.com>
Date:	Wed,  8 Apr 2015 16:50:31 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jean Delvare <jdelvare@...e.de>,
	Wolfram Sang <wsa@...-dreams.de>,
	Rodolfo Giometti <giometti@...eenne.com>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	Mark Brown <broonie@...nel.org>,
	Willy Tarreau <willy@...a-x.org>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>
Cc:	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
	netdev@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-spi@...r.kernel.org, devel@...verdev.osuosl.org,
	alsa-devel@...a-project.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 05/14] spi: lm70llp: return proper error values from attach

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

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ