[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428492040-5581-13-git-send-email-sudipm.mukherjee@gmail.com>
Date: Wed, 8 Apr 2015 16:50:38 +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 12/14] i2c-parport: 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/i2c/busses/i2c-parport.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-parport.c b/drivers/i2c/busses/i2c-parport.c
index a1fac5a..761a775 100644
--- a/drivers/i2c/busses/i2c-parport.c
+++ b/drivers/i2c/busses/i2c-parport.c
@@ -160,14 +160,14 @@ static void i2c_parport_irq(void *data)
"SMBus alert received but no ARA client!\n");
}
-static void i2c_parport_attach(struct parport *port)
+static int i2c_parport_attach(struct parport *port)
{
struct i2c_par *adapter;
adapter = kzalloc(sizeof(struct i2c_par), GFP_KERNEL);
if (adapter == NULL) {
printk(KERN_ERR "i2c-parport: Failed to kzalloc\n");
- return;
+ return -ENOMEM;
}
pr_debug("i2c-parport: attaching to %s\n", port->name);
@@ -230,13 +230,14 @@ static void i2c_parport_attach(struct parport *port)
mutex_lock(&adapter_list_lock);
list_add_tail(&adapter->node, &adapter_list);
mutex_unlock(&adapter_list_lock);
- return;
+ return 0;
err_unregister:
parport_release(adapter->pdev);
parport_unregister_device(adapter->pdev);
err_free:
kfree(adapter);
+ return -ENODEV;
}
static void i2c_parport_detach(struct parport *port)
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists