lkml.org 
[lkml]   [2019]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/5] driver core: class: add function to create /sys/class/<class>/foo directory
On Sun, Sep 08, 2019 at 09:41:10PM +0900, Akinobu Mita wrote:
> This adds a new function class_kobject_create_and_add() that creates a
> directory in the /sys/class/<class>.
>
> This function is required to create the /sys/class/leds/triggers directory
> that contains all available LED triggers.
>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Dan Murphy <dmurphy@ti.com>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> ---
> drivers/base/class.c | 7 +++++++
> include/linux/device.h | 3 +++
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index d8a6a58..f4c53e7 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -104,6 +104,13 @@ void class_remove_file_ns(struct class *cls, const struct class_attribute *attr,
> sysfs_remove_file_ns(&cls->p->subsys.kobj, &attr->attr, ns);
> }
>
> +struct kobject *class_kobject_create_and_add(const char *name,
> + struct class *cls)
> +{
> + return kobject_create_and_add(name, &cls->p->subsys.kobj);
> +}
> +EXPORT_SYMBOL_GPL(class_kobject_create_and_add);

Ick, why? Are you _SURE_ you really need to do this? Positive? This
feels very strange...

greg k-h

\
 
 \ /
  Last update: 2019-09-08 15:08    [W:0.137 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site