static int acpi_hed_probe(struct platform_device *pdev)
{
- struct acpi_device *device;
int err;
- device = ACPI_COMPANION(&pdev->dev);
- if (!device)
- return -ENODEV;
-
/* Only one hardware error device */
if (hed_present)
return -EINVAL;
- err = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
- acpi_hed_notify, device);
+ err = devm_acpi_install_notify_handler(&pdev->dev, ACPI_DEVICE_NOTIFY,
+ acpi_hed_notify, NULL);
if (err)
return err;
static void acpi_hed_remove(struct platform_device *pdev)
{
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
-
hed_present = false;
- acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
- acpi_hed_notify);
}
static struct platform_driver acpi_hed_driver = {