Re: [PATCH v3 1/2] Input: axp20x-pek: use driver_data of platform_device_id instead of extended attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 9, 2017 at 5:45 PM, Quentin Schulz
<quentin.schulz@xxxxxxxxxxxxxxxxxx> wrote:
> To prepare an upcoming patch adding support for another PMIC that has
> different startup and shutdown time, use driver_data of
> platform_device_id instead of a fixed extended device attribute.
>
> By doing so, we also remove a lot of nested structures that aren't
> useful.
>
> With this patch, a new PMIC can be easily supported by just filling
> correctly its ax20x_info structure and adding a platform_device_id.
>
> Moreover, since we get rid of extended attributes, rename
> axp20x_store_ext_attr to axp20x_store_attr and axp20x_show_ext_attr to
> axp20x_show_attr.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@xxxxxxxxxxxxxxxxxx>

Acked-by: Chen-Yu Tsai <wens@xxxxxxxx>

[...]

> +
> +DEVICE_ATTR(startup, 0644, axp20x_show_attr_startup, axp20x_store_attr_startup);
> +DEVICE_ATTR(shutdown, 0644, axp20x_show_attr_shutdown,
> +           axp20x_store_attr_shutdown);
>

You could use DEVICE_ATTR_RW(...) if you renamed the function names to
fit the macro if you wanted.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux