]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ACPI: platform_profile: Improve platform_profile_unregister()
authorKurt Borja <kuurtb@gmail.com>
Wed, 12 Feb 2025 19:03:08 +0000 (14:03 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 18 Feb 2025 18:03:23 +0000 (19:03 +0100)
commitbb519cf6113473c09d571e555137a36d7e2c8566
tree8b70df4dfb79a83e365a09ce961fcf625a1cee48
parentdd4f730b557ce701a2cd4f604bf1e57667bd8b6e
ACPI: platform_profile: Improve platform_profile_unregister()

Drivers usually call this method on error/exit paths and do not check
for it's return value, which is always 0 anyway, so make it void.

This is safe to do as currently all drivers use
devm_platform_profile_register().

While at it, improve the style and make the function safer by checking
for IS_ERR_OR_NULL before dereferencing the device pointer.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/20250212190308.21209-1-kuurtb@gmail.com
[ rjw: Minor changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/platform_profile.c
include/linux/platform_profile.h