From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbdGRUDp (ORCPT ); Tue, 18 Jul 2017 16:03:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41024 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbdGRUDm (ORCPT ); Tue, 18 Jul 2017 16:03:42 -0400 Date: Tue, 18 Jul 2017 22:03:36 +0200 From: Greg Kroah-Hartman To: Dmitry Torokhov Cc: htejun@gmail.com, linux-kernel@vger.kernel.org, Guenter Roeck Subject: Re: [PATCH 2/2] sysfs: add devm_sysfs_create_group() and friends Message-ID: <20170718200336.GC3694@kroah.com> References: <20170718193058.29958-1-dmitry.torokhov@gmail.com> <20170718193058.29958-3-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170718193058.29958-3-dmitry.torokhov@gmail.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 18, 2017 at 12:30:58PM -0700, Dmitry Torokhov wrote: > --- a/include/linux/sysfs.h > +++ b/include/linux/sysfs.h > @@ -282,6 +282,16 @@ int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj, > struct kobject *target_kobj, > const char *target_name); > > +struct device; Put this in device.h instead? > +int __must_check devm_sysfs_create_group(struct device *dev, > + const struct attribute_group *grp); > +int __must_check devm_sysfs_create_groups(struct device *dev, > + const struct attribute_group **groups); > +void devm_sysfs_remove_group(struct device *dev, > + const struct attribute_group *grp); > +void devm_sysfs_remove_groups(struct device *dev, > + const struct attribute_group **groups); I have finally moved the driver core to only accept/need "groups" not a single "group", so we should only need devm_sysfs_create_groups and devm_sysfs_remove_groups, right? And do we need/want the non-devm versions: device_create_groups() device_remove_groups() ? And you can probably drop the 'sysfs' from the function name if you want. :) thanks, greg k-h