Message ID | 20221109140711.105222-1-gregkh@linuxfoundation.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp357901wru; Wed, 9 Nov 2022 06:16:50 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Xe4vPUj+hi9GQDUKogB2KS5Eum+fT5pac77rvuWON6vaI13WNzKpgjLhlRXUEYGXdvjF1 X-Received: by 2002:a17:90a:5517:b0:213:b122:41b3 with SMTP id b23-20020a17090a551700b00213b12241b3mr59625764pji.121.1668003409992; Wed, 09 Nov 2022 06:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668003409; cv=none; d=google.com; s=arc-20160816; b=pw37VPLVuTe9jBFvJHUqI+h9D7wFAEW+nH1wfgAICj00arBNTlwfzMmx/NiEf61WXO qWf9S2NhSFzAkqL28QA9tvqywIiOIkSRsdVT9tzMxIAaRPIOd6ULGS43E09UaD+KLnjc usR8HEUltcYLVTgN3jnDNW2dyB6IaxVWO1l0ssTDPsxaNQ9yduS1H7zZoccJiejV2/SZ Vmzm4Gfiy2BRPQ1E0+PUMfjC+xb0KqrLrm+FUuhW1kI21mU9nLKcUhoxRFwMBga27fQ2 DhCjdiuEtWknslifjwixmr5cZgoyoFPwTiLoewhah+O7k8827m6PvxTpWy0hE1L6eMs3 mzQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=gwxmF8Dk7ZIxVYb4gf74Axh2TWSPhWpmIat+GXgyn7Y=; b=RoArMg2IZC38mpQ5MOaAzesoBpokRfKuE29H8NnOPOwcVZTALmSAzlmrjrwiK5VzRg pULXT6O9m80SGVCcNH/9H3fvabl8usbmR8WNwaGOnjUYphXBz0IpN0THii+UUIFtwHYv l2ENaAN5h23jY47BPnrQGzqz2CFOiax8RzoA5oreCAZ/2MkLZ6Zku0lHA0O6XbISeF3q j3l10aOZKkJmsTteRe1d3GI1dZkHvo+5Abp5W+lSHAp/nqX0EF6eb6rDoDz2M+alZou6 BEDyGfzCqoqdzcT3pVbRrXRqhNW34AQPGGEOG9+rs9a413GOgXr0XnZptlz3cc++otFz vPsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c67RbILp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a625341000000b00536fa6bbb11si15981537pfb.344.2022.11.09.06.16.35; Wed, 09 Nov 2022 06:16:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=c67RbILp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbiKIOJv (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 9 Nov 2022 09:09:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230414AbiKIOJf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Nov 2022 09:09:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 840CB1902D for <linux-kernel@vger.kernel.org>; Wed, 9 Nov 2022 06:07:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1F8896157D for <linux-kernel@vger.kernel.org>; Wed, 9 Nov 2022 14:07:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF66EC433C1; Wed, 9 Nov 2022 14:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668002841; bh=N9WGpsrrLuQDnUvF/F19PJvYOzFYkc2INPp4w7vxZzs=; h=From:To:Cc:Subject:Date:From; b=c67RbILpRGAOYjzJOe3Yc/TRQImcufiAUoPOmrKN3Nqlks6NBqZxEiZH23Aa7DIwg jP8c+dGVThtRrYjUf2XDVUe1YuA0hiIoB2ZIw8ygbO9idppCeL2F4n/a5btvjtSAzX quOLZ4Nt6lFp3S9r4Mr/0IkMwf0HdU9vR5+6s6sE= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, "Rafael J. Wysocki" <rafael@kernel.org> Subject: [PATCH 1/2] driver core: remove devm_device_remove_groups() Date: Wed, 9 Nov 2022 15:07:10 +0100 Message-Id: <20221109140711.105222-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1961; i=gregkh@linuxfoundation.org; h=from:subject; bh=N9WGpsrrLuQDnUvF/F19PJvYOzFYkc2INPp4w7vxZzs=; b=owGbwMvMwCRo6H6F97bub03G02pJDMnZW3hvHJVUCyx45y0ak7vVKZP3dH2zJCPz/sz6BJc0nZvO PIs6YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCKd2xjmx6XLbIiMXskXu7Mo/f+EY1 rtry/OZ1iw8UnPjpbNS54qzpndM+ulxQO5OGYLAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749028344022150235?= X-GMAIL-MSGID: =?utf-8?q?1749028344022150235?= |
Series |
[1/2] driver core: remove devm_device_remove_groups()
|
|
Commit Message
Greg KH
Nov. 9, 2022, 2:07 p.m. UTC
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(-)
Comments
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 >
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.
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
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.
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.
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,