};
/* R1 handles SINF_AC_CUR_BRIGHT as SINF_CUR_BRIGHT, doesn't know AC state */
-static int acpi_pcc_hotkey_add(struct acpi_device *device);
-static void acpi_pcc_hotkey_remove(struct acpi_device *device);
+static int acpi_pcc_hotkey_probe(struct platform_device *pdev);
+static void acpi_pcc_hotkey_remove(struct platform_device *pdev);
static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data);
static const struct acpi_device_id pcc_device_ids[] = {
#endif
static SIMPLE_DEV_PM_OPS(acpi_pcc_hotkey_pm, NULL, acpi_pcc_hotkey_resume);
-static struct acpi_driver acpi_pcc_driver = {
- .name = ACPI_PCC_DRIVER_NAME,
- .class = ACPI_PCC_CLASS,
- .ids = pcc_device_ids,
- .ops = {
- .add = acpi_pcc_hotkey_add,
- .remove = acpi_pcc_hotkey_remove,
- },
- .drv.pm = &acpi_pcc_hotkey_pm,
+static struct platform_driver acpi_pcc_driver = {
+ .probe = acpi_pcc_hotkey_probe,
+ .remove = acpi_pcc_hotkey_remove,
+ .driver = {
+ .name = ACPI_PCC_DRIVER_NAME,
+ .acpi_match_table = pcc_device_ids,
+ .pm = &acpi_pcc_hotkey_pm,
+ },
};
static const struct key_entry panasonic_keymap[] = {
#ifdef CONFIG_PM_SLEEP
static int acpi_pcc_hotkey_resume(struct device *dev)
{
- struct pcc_acpi *pcc = acpi_driver_data(to_acpi_device(dev));
+ struct pcc_acpi *pcc = acpi_driver_data(ACPI_COMPANION(dev));
if (pcc->num_sifr > SINF_MUTE)
acpi_pcc_write_sset(pcc, SINF_MUTE, pcc->mute);
}
#endif
-static int acpi_pcc_hotkey_add(struct acpi_device *device)
+static int acpi_pcc_hotkey_probe(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
struct backlight_properties props;
struct pcc_acpi *pcc;
int num_sifr, result;
out_input:
input_unregister_device(pcc->input_dev);
out_sinf:
+ device->driver_data = NULL;
kfree(pcc->sinf);
out_hotkey:
kfree(pcc);
return result;
}
-static void acpi_pcc_hotkey_remove(struct acpi_device *device)
+static void acpi_pcc_hotkey_remove(struct platform_device *pdev)
{
+ struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
struct pcc_acpi *pcc = acpi_driver_data(device);
i8042_remove_filter(panasonic_i8042_filter);
input_unregister_device(pcc->input_dev);
+ device->driver_data = NULL;
+
kfree(pcc->sinf);
kfree(pcc);
}
-module_acpi_driver(acpi_pcc_driver);
+module_platform_driver(acpi_pcc_driver);