All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform devices
@ 2014-05-24 15:21 Axel Lin
  2014-05-24 15:48 ` [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform dev Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-05-24 15:21 UTC (permalink / raw)
  To: lm-sensors

Call platform_device_unregister() rather than platform_device_put() to
unregister successfully registered platform devices.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/hwmon/nct6775.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 38d5a63..59d9a3f 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -4160,7 +4160,7 @@ static int __init sensors_nct6775_init(void)
 		pdev[i] = platform_device_alloc(DRVNAME, address);
 		if (!pdev[i]) {
 			err = -ENOMEM;
-			goto exit_device_put;
+			goto exit_device_unregister;
 		}
 
 		err = platform_device_add_data(pdev[i], &sio_data,
@@ -4198,9 +4198,11 @@ static int __init sensors_nct6775_init(void)
 	return 0;
 
 exit_device_put:
-	for (i = 0; i < ARRAY_SIZE(pdev); i++) {
+	platform_device_put(pdev[i]);
+exit_device_unregister:
+	while (--i >= 0) {
 		if (pdev[i])
-			platform_device_put(pdev[i]);
+			platform_device_unregister(pdev[i]);
 	}
 exit_unregister:
 	platform_driver_unregister(&nct6775_driver);
-- 
1.8.3.2




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform dev
  2014-05-24 15:21 [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform devices Axel Lin
@ 2014-05-24 15:48 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2014-05-24 15:48 UTC (permalink / raw)
  To: lm-sensors

On Sat, May 24, 2014 at 11:21:23PM +0800, Axel Lin wrote:
> Call platform_device_unregister() rather than platform_device_put() to
> unregister successfully registered platform devices.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied to -next, thanks.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-24 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 15:21 [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform devices Axel Lin
2014-05-24 15:48 ` [lm-sensors] [PATCH] hwmon: (nct6775) Fix probe unwind paths to properly unregister platform dev Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.