lkml.org 
[lkml]   [2018]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] mfd / platform: cros_ec: move lightbar attributes to its own driver.
Hi Enric,

On Thu, Nov 22, 2018 at 12:33:51PM +0100, Enric Balletbo i Serra wrote:
> The entire way how cros sysfs attibutes are created is broken.
> cros_ec_lightbar should be its own driver and its attributes should be
> associated with a lightbar driver not the mfd driver. In order to retain
> the path, the lightbar attributes are attached to the cros_class.
>
> The patch also adds the sysfs documentation.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
...
>
> +int cros_ec_attach_attribute_group(struct cros_ec_dev *ec,
> + struct attribute_group *attrs)
> +{
> + return sysfs_create_group(&ec->class_dev.kobj, attrs);
> +}
> +EXPORT_SYMBOL(cros_ec_attach_attribute_group);
> +
> +void cros_ec_detach_attribute_group(struct cros_ec_dev *ec,
> + struct attribute_group *attrs)
> +{
> + sysfs_remove_group(&ec->class_dev.kobj, attrs);
> +}
> +EXPORT_SYMBOL(cros_ec_detach_attribute_group);
> +

Are those two functions necessary ? Why not just call sysfs_create_group
and sysfs_remove_group directly from the calling code ?

Thanks,
Guenter

\
 
 \ /
  Last update: 2018-11-22 18:42    [W:0.119 / U:0.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site