Re: [PATCH missing/21] classmate-laptop: Use struct dev_pm_ops forpower management

From: Thadeu Cascardo
Date: Fri Jun 29 2012 - 07:49:47 EST


----- Original message -----
> From: Rafael J. Wysocki <rjw@xxxxxxx>
>
> Make the classmate-laptop driver define its PM callbacks through
> a struct dev_pm_ops object rather than by using legacy PM hooks
> in struct acpi_device_ops.
>
> Signed-off-by: Rafael J. Wysocki <rjw@xxxxxxx>
> ---
>
> Hi all,
>
> I overlooked the classmate-laptop driver in the ACPI conversion to PM
> handling based on struct dev_pm_ops, so this one should go after [17/21]
> and the next patches should be renumbered.
>
> Thanks,
> Rafael
>
>
> ---
>Â drivers/platform/x86/classmate-laptop.c |Â Â 13 ++++++++-----
>Â 1 file changed, 8 insertions(+), 5 deletions(-)
>
> Index: linux/drivers/platform/x86/classmate-laptop.c
> ===================================================================
> --- linux.orig/drivers/platform/x86/classmate-laptop.c
> +++ linux/drivers/platform/x86/classmate-laptop.c
> @@ -362,15 +362,18 @@ static int cmpc_tablet_remove(struct acp
>Â ÂÂÂ return cmpc_remove_acpi_notify_device(acpi);
>Â }
>Â
> -static int cmpc_tablet_resume(struct acpi_device *acpi)
> +static int cmpc_tablet_resume(struct device *dev)
>Â {
> -ÂÂÂ struct input_dev *inputdev = dev_get_drvdata(&acpi->dev);
> +ÂÂÂ struct input_dev *inputdev = dev_get_drvdata(dev);
> +
>Â ÂÂÂ unsigned long long val = 0;
> -ÂÂÂ if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val)))
> +ÂÂÂ if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
>Â ÂÂÂ ÂÂÂ input_report_switch(inputdev, SW_TABLET_MODE, !val);
>Â ÂÂÂ return 0;
>Â }
>Â
> +static SIMPLE_DEV_PM_OPS(cmpc_tabled_pm, NULL, cmpc_tablet_resume);
> +
>Â static const struct acpi_device_id cmpc_tablet_device_ids[] = {
>Â ÂÂÂ {CMPC_TABLET_HID, 0},
>Â ÂÂÂ {"", 0}
> @@ -384,9 +387,9 @@ static struct acpi_driver cmpc_tablet_ac
>Â ÂÂÂ .ops = {
>Â ÂÂÂ ÂÂÂ .add = cmpc_tablet_add,
>Â ÂÂÂ ÂÂÂ .remove = cmpc_tablet_remove,
> -ÂÂÂ ÂÂÂ .resume = cmpc_tablet_resume,
>Â ÂÂÂ ÂÂÂ .notify = cmpc_tablet_handler,
> -ÂÂÂ }
> +ÂÂÂ },
> +ÂÂÂ .drv.pm = &cmpc_tabled_pm,
>Â };
>Â
>Â

Aside from the typo tabled,

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@xxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/