Skip to content

Commit

Permalink
sony-laptop: use platform_device_unregister in sony_pf_remove
Browse files Browse the repository at this point in the history
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 <axel.lin@gmail.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Axel Lin authored and Matthew Garrett committed Aug 3, 2010
1 parent 32ab72e commit 08db2b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 08db2b3

Please sign in to comment.