Thread (1 message) 1 message, 1 author, 2013-12-19
STALE4597d

[PATCH 09/38] arm: mach-imx: add missing put_device calls

From: Levente Kurusa <hidden>
Date: 2013-12-19 15:04:28
Also in: lkml
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

This is required so that we give up the last reference to the device.

Signed-off-by: Levente Kurusa <redacted>
---
 arch/arm/mach-imx/devices/devices.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/devices/devices.c b/arch/arm/mach-imx/devices/devices.c
index 1b4366a..0b17c89 100644
--- a/arch/arm/mach-imx/devices/devices.c
+++ b/arch/arm/mach-imx/devices/devices.c
@@ -37,11 +37,14 @@ int __init mxc_device_init(void)
 	int ret;
 
 	ret = device_register(&mxc_aips_bus);
-	if (ret < 0)
+	if (ret < 0) {
+		put_device(&mxc_aips_bus);
 		goto done;
+	}
 
 	ret = device_register(&mxc_ahb_bus);
-
+	if(ret < 0)
+		put_device(&mxc_ahb_bus);
 done:
 	return ret;
 }
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help