Skip to content

Commit

Permalink
Merge tag 'acpi-6.6-rc8' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
 "Unbreak the ACPI NFIT driver after a recent change that inadvertently
  altered its behavior (Xiang Chen)"

* tag 'acpi-6.6-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: NFIT: Install Notify() handler before getting NFIT table
  • Loading branch information
torvalds committed Oct 25, 2023
2 parents 4f82870 + 9b311b7 commit 611da07
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions drivers/acpi/nfit/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3339,6 +3339,16 @@ static int acpi_nfit_add(struct acpi_device *adev)
acpi_size sz;
int rc = 0;

rc = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
acpi_nfit_notify);
if (rc)
return rc;

rc = devm_add_action_or_reset(dev, acpi_nfit_remove_notify_handler,
adev);
if (rc)
return rc;

status = acpi_get_table(ACPI_SIG_NFIT, 0, &tbl);
if (ACPI_FAILURE(status)) {
/* The NVDIMM root device allows OS to trigger enumeration of
Expand Down Expand Up @@ -3386,17 +3396,7 @@ static int acpi_nfit_add(struct acpi_device *adev)
if (rc)
return rc;

rc = devm_add_action_or_reset(dev, acpi_nfit_shutdown, acpi_desc);
if (rc)
return rc;

rc = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
acpi_nfit_notify);
if (rc)
return rc;

return devm_add_action_or_reset(dev, acpi_nfit_remove_notify_handler,
adev);
return devm_add_action_or_reset(dev, acpi_nfit_shutdown, acpi_desc);
}

static void acpi_nfit_update_notify(struct device *dev, acpi_handle handle)
Expand Down

0 comments on commit 611da07

Please sign in to comment.