mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
ACPI: NFIT: core: Use devm_acpi_install_notify_handler()
Now that devm_acpi_install_notify_handler() is available, use it in acpi_nfit_probe() instead of a custom devm action removing an ACPI notify handler installed via acpi_dev_install_notify_handler(). Also drop the explicit ACPI_COMPANION() check against NULL that is not necessary any more becuase devm_acpi_install_notify_handler() carries out an equivalent check internally and use ACPI_HANDLE() to retrieve the platform device's ACPI handle. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3048737.e9J7NaK4W3@rafael.j.wysocki
This commit is contained in:
parent
ca70ce555a
commit
198541ad53
|
|
@ -3298,14 +3298,6 @@ static void acpi_nfit_notify(acpi_handle handle, u32 event, void *data)
|
|||
device_unlock(dev);
|
||||
}
|
||||
|
||||
static void acpi_nfit_remove_notify_handler(void *data)
|
||||
{
|
||||
struct acpi_device *adev = data;
|
||||
|
||||
acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_nfit_notify);
|
||||
}
|
||||
|
||||
void acpi_nfit_shutdown(void *data)
|
||||
{
|
||||
struct acpi_nfit_desc *acpi_desc = data;
|
||||
|
|
@ -3342,22 +3334,12 @@ static int acpi_nfit_probe(struct platform_device *pdev)
|
|||
struct acpi_nfit_desc *acpi_desc;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct acpi_table_header *tbl;
|
||||
struct acpi_device *adev;
|
||||
acpi_status status = AE_OK;
|
||||
acpi_size sz;
|
||||
int rc = 0;
|
||||
|
||||
adev = ACPI_COMPANION(&pdev->dev);
|
||||
if (!adev)
|
||||
return -ENODEV;
|
||||
|
||||
rc = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_nfit_notify, dev);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = devm_add_action_or_reset(dev, acpi_nfit_remove_notify_handler,
|
||||
adev);
|
||||
rc = devm_acpi_install_notify_handler(dev, ACPI_DEVICE_NOTIFY,
|
||||
acpi_nfit_notify, dev);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
|
|
@ -3388,7 +3370,7 @@ static int acpi_nfit_probe(struct platform_device *pdev)
|
|||
acpi_desc->acpi_header = *tbl;
|
||||
|
||||
/* Evaluate _FIT and override with that if present */
|
||||
status = acpi_evaluate_object(adev->handle, "_FIT", NULL, &buf);
|
||||
status = acpi_evaluate_object(ACPI_HANDLE(dev), "_FIT", NULL, &buf);
|
||||
if (ACPI_SUCCESS(status) && buf.length > 0) {
|
||||
union acpi_object *obj = buf.pointer;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user