From: Wei Yongjun Date: Fri, 9 Nov 2012 03:04:58 +0000 (+1100) Subject: drivers/rtc/rtc-test.c: avoid calling platform_device_put() twice X-Git-Tag: next-20121112~5^2~67 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eddc0862a4d26c404b8df8441cee94d95cc9d320;p=karo-tx-linux.git drivers/rtc/rtc-test.c: avoid calling platform_device_put() twice In case of error, test_init() needs 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 Cc: Alessandro Zummo Signed-off-by: Andrew Morton --- diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 7e96254bd365..209a12723038 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);