From: Axel Lin Date: Thu, 1 Jul 2010 02:18:01 +0000 (+0800) Subject: sony-laptop: use platform_device_unregister in sony_pf_remove X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=08db2b3141b99b476749201eb8e164b39fa7a4ca;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git sony-laptop: use platform_device_unregister in sony_pf_remove platform_device_unregister calls platform_device_del and platform_device_put, thus this change is logically equivalent to original code. I made this change because the documents in platform.c shows that: platform_device_del and platform_device_put must _only_ be externally called in error cases. All other usage is a bug. Signed-off-by: Axel Lin Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index a47fd4eef8a3..e3154ff7a39f 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -561,8 +561,7 @@ static void sony_pf_remove(void) if (!atomic_dec_and_test(&sony_pf_users)) return; - platform_device_del(sony_pf_device); - platform_device_put(sony_pf_device); + platform_device_unregister(sony_pf_device); platform_driver_unregister(&sony_pf_driver); }