Re: [PATCH 1/2] power: reset: Add generic SYSCON register mapped poweroff.

From: Sebastian Reichel
Date: Tue Mar 10 2015 - 21:39:59 EST


Hi,

On Tue, Mar 10, 2015 at 04:21:09PM -0700, Moritz Fischer wrote:
> Add a generic SYSCON register mapped poweroff mechanism.

Driver looks mostly fine.

> [...]
> +#ifdef CONFIG_OF
> +static const struct of_device_id syscon_poweroff_of_match[] = {
> + { .compatible = "syscon-poweroff" },
> + {}
> +};
> +MODULE_DEVICE_TABLE(of, syscon_poweroff_of_match);
> +#endif

You can remove the #ifdef, since the driver depends on OF.

> +static struct platform_driver syscon_poweroff_driver = {
> + .probe = syscon_poweroff_probe,

You should set pm_power_off = NULL in .remove

> + .driver = {
> + .name = "syscon-poweroff",
> + .of_match_table = syscon_poweroff_of_match,

This would fail for !CONFIG_OF. If the driver has optional OF
support you should use of_match_ptr(syscon_poweroff_of_match),
which is a preprocessor macro returning NULL for !CONFIG_OF.

> + },
> +};
> +module_platform_driver(syscon_poweroff_driver);
> +
> +MODULE_LICENSE("GPL v2");
> +MODULE_AUTHOR("Moritz Fischer <moritz.fischer@xxxxxxxxx>");
> +MODULE_DESCRIPTION("Generic SYSCON poweroff driver");
> +MODULE_ALIAS("platform:syscon-poweroff");
> --
> 1.9.3
>

Attachment: signature.asc
Description: Digital signature