[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1387465429-3568-28-git-send-email-levex@linux.com>
Date: Thu, 19 Dec 2013 16:03:38 +0100
From: Levente Kurusa <levex@...ux.com>
To: LKML <linux-kernel@...r.kernel.org>
Cc: Levente Kurusa <levex@...ux.com>, Paul Mundt <lethal@...ux-sh.org>,
Simon Horman <horms@...ge.net.au>,
Magnus Damm <magnus.damm@...il.com>, linux-sh@...r.kernel.org
Subject: [PATCH 27/38] superhyway: add missing put_device call
This is required so that we give up the last reference to the device.
Also, this makes superhyway_device_release actually used.
Signed-off-by: Levente Kurusa <levex@...ux.com>
---
drivers/sh/superhyway/superhyway.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index 2d9e7f3..765cf7d 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -54,6 +54,7 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
struct superhyway_bus *bus)
{
struct superhyway_device *dev = sdev;
+ int rc = 0;
if (!dev) {
dev = kzalloc(sizeof(struct superhyway_device), GFP_KERNEL);
@@ -86,8 +87,11 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
dev_set_name(&dev->dev, "%02x", superhyway_devices);
superhyway_devices++;
+ rc = device_register(&dev->dev);
+ if (rc)
+ put_device(&dev->dev);
- return device_register(&dev->dev);
+ return rc;
}
int superhyway_add_devices(struct superhyway_bus *bus,
--
1.8.3.1
--
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