From patchwork Wed Nov 9 14:07:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 17570 Return-Path: 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 + 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 ); 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 ; 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 ; 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 To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dmitry Torokhov , "Rafael J. Wysocki" 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 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: 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?= There is no in-kernel user of this function, so it is not needed anymore and can be removed. Cc: Dmitry Torokhov Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman Reviewed-by: Rafael J. Wysocki --- 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, From patchwork Wed Nov 9 14:07:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 17569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp356871wru; Wed, 9 Nov 2022 06:15:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM6lPalLaDSskbb/w2zy/eCFx/+wI/xLGqKkJJVA8bBYmmsl6id+kfU7WNmVrIJQmVshfJY/ X-Received: by 2002:a05:6402:718:b0:463:275:4753 with SMTP id w24-20020a056402071800b0046302754753mr56893693edx.160.1668003321788; Wed, 09 Nov 2022 06:15:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668003321; cv=none; d=google.com; s=arc-20160816; b=D9W4fMB00lQiG0ZCwf3muYAReVyVopFd5kTHD+QiHSDfkfRNMW0Q/0vFte4YFM4SGp zga8KktHEQKFoT7HVLKrbvpja4WS6W3j2qgmot4SuGRiXtUm6WFN8sGd1NoH8gAYgGLI AsebxuyIgl7iK/h12BW+cYoouHSWh5m4cKLVWjvNVEH5TioFmoj8rgaTiFjyMAXGu9jp PoBekfRGGQzyiQfIdBg/5HZaLDW4y+NTsH43pD0/fEd5y4rvwm+Au15VkfMz/3B7WmK7 gzintWiiu/WYkJS+YSw07h9XkVdSqsJoZlsuuZ1lFF3u5m1t6thDkTDgVk8sOmZaaIBk XqVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=booRNp8U/gcFLfGDESgAy1ozHRafFeIZnHfnivLiveg=; b=beO59O16/U0uqj5lCvvqZesz8cWME033/xzHJ+xbT76pB70NQriKN+ivxiM5uHZkmX yulpCnToKa080F57Bw2iz6IdWdJNBgcoTt88AyWG3eObMWiBVDqS0H+NZtdp6TQvgKYD j9HeIgD1OHEa3Ti6SRdXZuXWo8JdTYom9hHLM2FV4fV6RAPDrLd6ZkTAliexfFZzQHDR iUEQh+qyqO8W79aJCoN0bx1RNByLezhUn+t87BVGmCwPe5QBJUeKhCRJWrLzYTV7eBi0 0+9LOtVkfK1+p2CBwmhMXIcG/C3+2QTKUiJjYbyIDP59jq1/35C/HcyAmS1L0ATXrUVR Fh6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ipoECc4l; 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 cw18-20020a170906479200b0078dd7383ed8si17557937ejc.414.2022.11.09.06.14.57; Wed, 09 Nov 2022 06:15:21 -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=ipoECc4l; 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 S230466AbiKIOJu (ORCPT + 99 others); Wed, 9 Nov 2022 09:09:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiKIOJf (ORCPT ); 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 15F72193CC for ; Wed, 9 Nov 2022 06:07:19 -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 A5DD861ACE for ; Wed, 9 Nov 2022 14:07:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26469C433C1; Wed, 9 Nov 2022 14:07:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1668002838; bh=PiRBtyWRcT7jjZfnnN3cmaPdUmNnlm0O8XruGa9dW+o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ipoECc4lNAV5X3+DuWolYU36Vd2SJ+TE5j1rpuC7BKvPKnkxh1jFkhtVGhulQoAIN ztjXpj0XofonDhjIr+cNDnhoRkW2lpAXjmjTZX9ZlsXtmhDLhK1f+wUoPqMGlj4EZ5 T6AwnQTvt18BTOxmkH+Zs2e8IN7PjQjgQW/guSJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Dmitry Torokhov , "Rafael J. Wysocki" Subject: [PATCH 2/2] driver core: remove devm_device_remove_group() Date: Wed, 9 Nov 2022 15:07:11 +0100 Message-Id: <20221109140711.105222-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221109140711.105222-1-gregkh@linuxfoundation.org> References: <20221109140711.105222-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2403; i=gregkh@linuxfoundation.org; h=from:subject; bh=PiRBtyWRcT7jjZfnnN3cmaPdUmNnlm0O8XruGa9dW+o=; b=owGbwMvMwCRo6H6F97bub03G02pJDMnZW/iFF55SWCzsvrFo5kQNdemZQS8WJKUIbT4gmXcutzlk mdnFjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjImt8MC7rKN/nlyPwUvup1oDqW5+ 9/kyKNRwwLjhxWv+OeovZPhK/Fauuq26f0Tyh0AAA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749028250995409405?= X-GMAIL-MSGID: =?utf-8?q?1749028250995409405?= There is no in-kernel user of this function, so it is not needed anymore and can be removed. Cc: Dmitry Torokhov Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman --- 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