linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: avoid calling platform_device_put() twice in test_init()
@ 2012-10-23  5:08 Wei Yongjun
  2012-11-07  0:51 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2012-10-23  5:08 UTC (permalink / raw)
  To: a.zummo; +Cc: yongjun_wei, rtc-linux, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

In case of error, the function test_init() need to call
platform_device_del() instead of platform_device_unregister().
Otherwise, we may call platform_device_put() twice.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/rtc/rtc-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index 7e96254..209a127 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -164,7 +164,7 @@ static int __init test_init(void)
 	return 0;
 
 exit_device_unregister:
-	platform_device_unregister(test0);
+	platform_device_del(test0);
 
 exit_free_test1:
 	platform_device_put(test1);



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

end of thread, other threads:[~2012-11-08  6:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-23  5:08 [PATCH] rtc: avoid calling platform_device_put() twice in test_init() Wei Yongjun
2012-11-07  0:51 ` Andrew Morton
2012-11-08  6:13   ` Wei Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).