Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08db2b31 authored by Axel Lin's avatar Axel Lin Committed by Matthew Garrett
Browse files

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent 32ab72e7
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -561,8 +561,7 @@ static void sony_pf_remove(void)
	if (!atomic_dec_and_test(&sony_pf_users))
	if (!atomic_dec_and_test(&sony_pf_users))
		return;
		return;


	platform_device_del(sony_pf_device);
	platform_device_unregister(sony_pf_device);
	platform_device_put(sony_pf_device);
	platform_driver_unregister(&sony_pf_driver);
	platform_driver_unregister(&sony_pf_driver);
}
}