All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] driver core: remove devm_device_remove_groups()
@ 2022-11-09 14:07 Greg Kroah-Hartman
  2022-11-09 14:07 ` [PATCH 2/2] driver core: remove devm_device_remove_group() Greg Kroah-Hartman
  2022-11-09 14:11 ` [PATCH 1/2] driver core: remove devm_device_remove_groups() Rafael J. Wysocki
  0 siblings, 2 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-09 14:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Dmitry Torokhov, Rafael J. Wysocki

There is no in-kernel user of this function, so it is not needed anymore
and can be removed.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/core.c    | 17 -----------------
 include/linux/device.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index d02501933467..6137de5073b1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2693,23 +2693,6 @@ int devm_device_add_groups(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(devm_device_add_groups);
 
-/**
- * devm_device_remove_groups - remove a list of managed groups
- *
- * @dev:	The device for the groups to be removed from
- * @groups:	NULL terminated list of groups to be removed
- *
- * If groups is not NULL, remove the specified groups from the device.
- */
-void devm_device_remove_groups(struct device *dev,
-			       const struct attribute_group **groups)
-{
-	WARN_ON(devres_release(dev, devm_attr_groups_remove,
-			       devm_attr_group_match,
-			       /* cast away const */ (void *)groups));
-}
-EXPORT_SYMBOL_GPL(devm_device_remove_groups);
-
 static int device_add_attrs(struct device *dev)
 {
 	struct class *class = dev->class;
diff --git a/include/linux/device.h b/include/linux/device.h
index 023ea50b1916..4efc607c008c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1062,8 +1062,6 @@ static inline void device_remove_group(struct device *dev,
 
 int __must_check devm_device_add_groups(struct device *dev,
 					const struct attribute_group **groups);
-void devm_device_remove_groups(struct device *dev,
-			       const struct attribute_group **groups);
 int __must_check devm_device_add_group(struct device *dev,
 				       const struct attribute_group *grp);
 void devm_device_remove_group(struct device *dev,
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] driver core: remove devm_device_remove_group()
  2022-11-09 14:07 [PATCH 1/2] driver core: remove devm_device_remove_groups() Greg Kroah-Hartman
@ 2022-11-09 14:07 ` Greg Kroah-Hartman
  2022-11-09 14:11 ` [PATCH 1/2] driver core: remove devm_device_remove_groups() Rafael J. Wysocki
  1 sibling, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-09 14:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Dmitry Torokhov, Rafael J. Wysocki

There is no in-kernel user of this function, so it is not needed anymore
and can be removed.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/core.c    | 22 ----------------------
 include/linux/device.h |  2 --
 2 files changed, 24 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6137de5073b1..a7a18d44542c 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -2585,11 +2585,6 @@ union device_attr_group_devres {
 	const struct attribute_group **groups;
 };
 
-static int devm_attr_group_match(struct device *dev, void *res, void *data)
-{
-	return ((union device_attr_group_devres *)res)->group == data;
-}
-
 static void devm_attr_group_remove(struct device *dev, void *res)
 {
 	union device_attr_group_devres *devres = res;
@@ -2640,23 +2635,6 @@ int devm_device_add_group(struct device *dev, const struct attribute_group *grp)
 }
 EXPORT_SYMBOL_GPL(devm_device_add_group);
 
-/**
- * devm_device_remove_group: remove a managed group from a device
- * @dev:	device to remove the group from
- * @grp:	group to remove
- *
- * This function removes a group of attributes from a device. The attributes
- * previously have to have been created for this group, otherwise it will fail.
- */
-void devm_device_remove_group(struct device *dev,
-			      const struct attribute_group *grp)
-{
-	WARN_ON(devres_release(dev, devm_attr_group_remove,
-			       devm_attr_group_match,
-			       /* cast away const */ (void *)grp));
-}
-EXPORT_SYMBOL_GPL(devm_device_remove_group);
-
 /**
  * devm_device_add_groups - create a bunch of managed attribute groups
  * @dev:	The device to create the group for
diff --git a/include/linux/device.h b/include/linux/device.h
index 4efc607c008c..84ae52de6746 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -1064,8 +1064,6 @@ int __must_check devm_device_add_groups(struct device *dev,
 					const struct attribute_group **groups);
 int __must_check devm_device_add_group(struct device *dev,
 				       const struct attribute_group *grp);
-void devm_device_remove_group(struct device *dev,
-			      const struct attribute_group *grp);
 
 /*
  * Platform "fixup" functions - allow the platform to have their say
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] driver core: remove devm_device_remove_groups()
  2022-11-09 14:07 [PATCH 1/2] driver core: remove devm_device_remove_groups() Greg Kroah-Hartman
  2022-11-09 14:07 ` [PATCH 2/2] driver core: remove devm_device_remove_group() Greg Kroah-Hartman
@ 2022-11-09 14:11 ` Rafael J. Wysocki
  2022-11-09 21:10   ` Dmitry Torokhov
  1 sibling, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2022-11-09 14:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Dmitry Torokhov, Rafael J. Wysocki

On Wed, Nov 9, 2022 at 3:07 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> There is no in-kernel user of this function, so it is not needed anymore
> and can be removed.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

For both patches in the series:

Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>

> ---
>  drivers/base/core.c    | 17 -----------------
>  include/linux/device.h |  2 --
>  2 files changed, 19 deletions(-)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index d02501933467..6137de5073b1 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2693,23 +2693,6 @@ int devm_device_add_groups(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(devm_device_add_groups);
>
> -/**
> - * devm_device_remove_groups - remove a list of managed groups
> - *
> - * @dev:       The device for the groups to be removed from
> - * @groups:    NULL terminated list of groups to be removed
> - *
> - * If groups is not NULL, remove the specified groups from the device.
> - */
> -void devm_device_remove_groups(struct device *dev,
> -                              const struct attribute_group **groups)
> -{
> -       WARN_ON(devres_release(dev, devm_attr_groups_remove,
> -                              devm_attr_group_match,
> -                              /* cast away const */ (void *)groups));
> -}
> -EXPORT_SYMBOL_GPL(devm_device_remove_groups);
> -
>  static int device_add_attrs(struct device *dev)
>  {
>         struct class *class = dev->class;
> diff --git a/include/linux/device.h b/include/linux/device.h
> index 023ea50b1916..4efc607c008c 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -1062,8 +1062,6 @@ static inline void device_remove_group(struct device *dev,
>
>  int __must_check devm_device_add_groups(struct device *dev,
>                                         const struct attribute_group **groups);
> -void devm_device_remove_groups(struct device *dev,
> -                              const struct attribute_group **groups);
>  int __must_check devm_device_add_group(struct device *dev,
>                                        const struct attribute_group *grp);
>  void devm_device_remove_group(struct device *dev,
> --
> 2.38.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] driver core: remove devm_device_remove_groups()
  2022-11-09 14:11 ` [PATCH 1/2] driver core: remove devm_device_remove_groups() Rafael J. Wysocki
@ 2022-11-09 21:10   ` Dmitry Torokhov
  2022-11-10  9:34     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Torokhov @ 2022-11-09 21:10 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Greg Kroah-Hartman, linux-kernel

On Wed, Nov 09, 2022 at 03:11:47PM +0100, Rafael J. Wysocki wrote:
> On Wed, Nov 9, 2022 at 3:07 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > There is no in-kernel user of this function, so it is not needed anymore
> > and can be removed.
> >
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> For both patches in the series:
> 
> Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>

I find it really weird to have an asymmetric core API...

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] driver core: remove devm_device_remove_groups()
  2022-11-09 21:10   ` Dmitry Torokhov
@ 2022-11-10  9:34     ` Greg Kroah-Hartman
  2022-11-10 13:07       ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-10  9:34 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Rafael J. Wysocki, linux-kernel

On Wed, Nov 09, 2022 at 01:10:59PM -0800, Dmitry Torokhov wrote:
> On Wed, Nov 09, 2022 at 03:11:47PM +0100, Rafael J. Wysocki wrote:
> > On Wed, Nov 9, 2022 at 3:07 PM Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > There is no in-kernel user of this function, so it is not needed anymore
> > > and can be removed.
> > >
> > > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > For both patches in the series:
> > 
> > Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
> 
> I find it really weird to have an asymmetric core API...

I'm working on fixing up that asymmetric-ness.  We have only one user of
devm_device_add_groups() and only a handful of devm_device_add_group()
left in the tree.

But it turns out that no one ever called these functions anyway, so they
aren't needed even if we did keep the "add" functions.  So they should
be dropped no matter what.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] driver core: remove devm_device_remove_groups()
  2022-11-10  9:34     ` Greg Kroah-Hartman
@ 2022-11-10 13:07       ` Rafael J. Wysocki
  2022-11-10 17:14         ` Dmitry Torokhov
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2022-11-10 13:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Dmitry Torokhov, Rafael J. Wysocki, linux-kernel

On Thu, Nov 10, 2022 at 10:34 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Nov 09, 2022 at 01:10:59PM -0800, Dmitry Torokhov wrote:
> > On Wed, Nov 09, 2022 at 03:11:47PM +0100, Rafael J. Wysocki wrote:
> > > On Wed, Nov 9, 2022 at 3:07 PM Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > There is no in-kernel user of this function, so it is not needed anymore
> > > > and can be removed.
> > > >
> > > > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > >
> > > For both patches in the series:
> > >
> > > Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
> >
> > I find it really weird to have an asymmetric core API...
>
> I'm working on fixing up that asymmetric-ness.  We have only one user of
> devm_device_add_groups() and only a handful of devm_device_add_group()
> left in the tree.
>
> But it turns out that no one ever called these functions anyway, so they
> aren't needed even if we did keep the "add" functions.  So they should
> be dropped no matter what.

Totally agreed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] driver core: remove devm_device_remove_groups()
  2022-11-10 13:07       ` Rafael J. Wysocki
@ 2022-11-10 17:14         ` Dmitry Torokhov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Torokhov @ 2022-11-10 17:14 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Greg Kroah-Hartman, linux-kernel

On Thu, Nov 10, 2022 at 02:07:51PM +0100, Rafael J. Wysocki wrote:
> On Thu, Nov 10, 2022 at 10:34 AM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Wed, Nov 09, 2022 at 01:10:59PM -0800, Dmitry Torokhov wrote:
> > > On Wed, Nov 09, 2022 at 03:11:47PM +0100, Rafael J. Wysocki wrote:
> > > > On Wed, Nov 9, 2022 at 3:07 PM Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > >
> > > > > There is no in-kernel user of this function, so it is not needed anymore
> > > > > and can be removed.
> > > > >
> > > > > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > > Cc: "Rafael J. Wysocki" <rafael@kernel.org>
> > > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > >
> > > > For both patches in the series:
> > > >
> > > > Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
> > >
> > > I find it really weird to have an asymmetric core API...
> >
> > I'm working on fixing up that asymmetric-ness.  We have only one user of
> > devm_device_add_groups() and only a handful of devm_device_add_group()
> > left in the tree.
> >
> > But it turns out that no one ever called these functions anyway, so they
> > aren't needed even if we did keep the "add" functions.  So they should
> > be dropped no matter what.
> 
> Totally agreed.

OK, fair enough.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-10 17:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 14:07 [PATCH 1/2] driver core: remove devm_device_remove_groups() Greg Kroah-Hartman
2022-11-09 14:07 ` [PATCH 2/2] driver core: remove devm_device_remove_group() Greg Kroah-Hartman
2022-11-09 14:11 ` [PATCH 1/2] driver core: remove devm_device_remove_groups() Rafael J. Wysocki
2022-11-09 21:10   ` Dmitry Torokhov
2022-11-10  9:34     ` Greg Kroah-Hartman
2022-11-10 13:07       ` Rafael J. Wysocki
2022-11-10 17:14         ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.