#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
+#include <linux/platform_device.h>
#include <acpi/hed.h>
static const struct acpi_device_id acpi_hed_ids[] = {
blocking_notifier_call_chain(&acpi_hed_notify_list, 0, NULL);
}
-static int acpi_hed_add(struct acpi_device *device)
+static int acpi_hed_probe(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
int err;
/* Only one hardware error device */
return err;
}
-static void acpi_hed_remove(struct acpi_device *device)
+static void acpi_hed_remove(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
+
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
acpi_hed_notify);
hed_handle = NULL;
}
-static struct acpi_driver acpi_hed_driver = {
- .name = "hardware_error_device",
- .class = "hardware_error",
- .ids = acpi_hed_ids,
- .ops = {
- .add = acpi_hed_add,
- .remove = acpi_hed_remove,
+static struct platform_driver acpi_hed_driver = {
+ .probe = acpi_hed_probe,
+ .remove = acpi_hed_remove,
+ .driver = {
+ .name = "acpi-hardware-error-device",
+ .acpi_match_table = acpi_hed_ids,
},
};
static int __init acpi_hed_driver_init(void)
{
- return acpi_bus_register_driver(&acpi_hed_driver);
+ return platform_driver_register(&acpi_hed_driver);
}
subsys_initcall(acpi_hed_driver_init);