From patchwork Mon Oct 9 08:38:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149903 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742980vqo; Mon, 9 Oct 2023 02:23:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9RYAJ5t9jsvdp4kIYaNmuEajVYw1BLVX4lIj0Cc/nVsJqLBN0NvM0ETKhLiPoLP+6H5aG X-Received: by 2002:a17:90a:fb58:b0:26b:9e2:1298 with SMTP id iq24-20020a17090afb5800b0026b09e21298mr11412325pjb.11.1696843413452; Mon, 09 Oct 2023 02:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843413; cv=none; d=google.com; s=arc-20160816; b=QMUIWSPOOjIAlC3Tuyx2bEb9QomLmYE9E2/5UApxXSJ5eWmgHkC3m4MNz6SpB0RLXu MSHg+OcDrxQIPwqzwy7lyimmrMtIjvmrVP0MK1pGZbu4g50C6t+AS6+NDQ1f7ujH4PZi VxjG0U+k7J0hXTH6ej1IK5Ab+XeHCrfnvaMEMZRSJLOyaah/uDiBRcHRuM0mFby9qhH8 uKDVkjVpF7bj3yIfMyQ6L/QrNZj8Z2ofFUD1aVW9BUM3ue1rbuKOk63Gx2xee/AQj+SL 8rh1/pwgSSx0LklyJLpBKpmujCdb0bptYgSsx+FYiFu0NeluFNCvdtnJ/VN5NVL7qyD8 jMiQ== 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; bh=YdAvURCGyM+wAgkkRgJHPHZXD+vZMQzg6mv0aIK2Fmk=; fh=EK0TiEPDXwQYjg/dVfVc6VtgpcdVGZXZkg01DD6Ny9I=; b=DC02wXPxTdiwEq/ccoN7UYKJtYn2/k1MxNm5aORMSheXb+JGGZUtDzqyQHcISnf/lu I7mIcPEmid6WHu2AGiPpt/hWUv3iYgphKXByOPDIhwV9UJW05bLep+3dgWRWfvTkbpuJ W8T42eAaV2m1KX6XeVyBouhp8o3d+IZpsv0ajcQPzfks0qnCmIbMAR2ZeuXVDo9Dux4C SbOC3BCg1efW7OFIhNKVa3LaO2uRLE8/ELa6Gi8wqxSXtmgJW7B9/Fhv/cTaLdIgo7RO R8Lj1ACKd0rE6BV5dxT+ExRK9vFxVaO2vAcBL6ZcZNftLUu/JVO6pJ71dwlQWnh/9P+k bHPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v4-20020a17090ad58400b0027728f01512si9084095pju.167.2023.10.09.02.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8E7608042855; Mon, 9 Oct 2023 02:23:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbjJIJXA (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345796AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FD4A3 for ; Mon, 9 Oct 2023 02:22:41 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006sV-83; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTC-000NWN-5W; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTB-00C4op-Sc; Mon, 09 Oct 2023 11:22:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Maxime Coquelin , Alexandre Torgue , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/20] pinctrl: stmfx: Improve error message in .remove()'s error path Date: Mon, 9 Oct 2023 10:38:37 +0200 Message-Id: <20231009083856.222030-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1448; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=oQvuwpLV6jEvG8nPX5IRlTZZ5eR2ugHk+8EMhpV4SKQ=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wAB8YUxAlLBbwC7CIKjUbWm11DxuAGLQFuF PnKvZq8Ol2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AAAKCRCPgPtYfRL+ TjJjCAC4Tdc4fTfh4VtpKisfvbBZZ0D+fqAmRlGB0zNqfrv706XALbviXa7gthDeHwPd4lv8wKr Ite+awd5fMyaGbl9XHLZ5gAHQ3JEjV6lPNk8v0CuXjFzEW82fkKMEJSL1Z+1aUG3IFE70SUBZDf 2Od7RaLozqLEEOO+6oerRQDP9UycvcJGkfXOwZ5ZZYOExGr51w3ex6RuIsYMEbniwO7//3JHVdP ZQpEEZvabqVPS+mx/fuF07qQlbpItj0UzV6FspmOKyC1ZVkXk+KMLjbrCzGEcYD5CzrbaKN3daX Yvrtl6ebPOFQICKlYIpv7t5owBQhbumI9X3ZqpTeaTE879qF X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:26 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269278905413709 X-GMAIL-MSGID: 1779269278905413709 The driver core has no handling for errors returned by the .remove() callback. The only action on error is a dev_warn() with generic error message that the returned value is returned. Replace it by a more specific and useful message. Then returning zero is the right thing to do, the only effect is to suppress the core's warning. This prepares the driver for the conversion to .remove_new(). Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-stmfx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index 0974bbf57b54..d7ab82432a52 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -737,11 +737,17 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev) static int stmfx_pinctrl_remove(struct platform_device *pdev) { struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); + int ret; - return stmfx_function_disable(stmfx, - STMFX_FUNC_GPIO | - STMFX_FUNC_ALTGPIO_LOW | - STMFX_FUNC_ALTGPIO_HIGH); + ret = stmfx_function_disable(stmfx, + STMFX_FUNC_GPIO | + STMFX_FUNC_ALTGPIO_LOW | + STMFX_FUNC_ALTGPIO_HIGH); + if (ret) + dev_err(&pdev->dev, "Failed to disable pins (%pe)\n", + ERR_PTR(ret)); + + return 0; } #ifdef CONFIG_PM_SLEEP From patchwork Mon Oct 9 08:38:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743010vqo; Mon, 9 Oct 2023 02:23:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqkBw49xOJdDmOuIRyXUbVmEq7Rn/GoMehElryt+wunps+rVXPkvZs5FGMfyD0EFzYeg8b X-Received: by 2002:a05:6a20:8e2a:b0:154:a1e4:b676 with SMTP id y42-20020a056a208e2a00b00154a1e4b676mr19574773pzj.4.1696843417472; Mon, 09 Oct 2023 02:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843417; cv=none; d=google.com; s=arc-20160816; b=G56TYaHYvkQQ/Rk6STHABHIDgj9+JEDQGc8IPRAvzUaDyDrzXOKGhmQjSmT1cdJzUL r+tTZEYMLaJK9DHF8hVhc0g/++Ds+KIoQttajTxc885qO9EMfTOuSKS25U+K8dp4fFbE TTStC8nxooqk4Ww8tITN9+68CvbIcJO4TnPw3G5HIvh0ERfTVjM2xAKgH1CCWzY4VFzI zWtUx8LvXfA8PcjCBVd6GFZ2ww1IduZQldAfzR++fOS+e92b6xT5HSvUqqA6jHDqRoaq 5fAcJgu2Jp65m6FD2+o0c1IYzBxltVkljBEWx9Nh0E+Dc9KtqXnat8gDb0TsM3FMPy3d aulA== 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; bh=IsY1WCJJVTUmDD+0ctSUPMga0M2XJGFuDnTw1EDm4ow=; fh=uUylZnDcSU0D174UQqR16g6nvZ/zEF/ADmbyGwLrIrU=; b=CnVEBZWeOJWE6SW+ya+RfHPJO4uZTmgmR0fnYYM1J7BLGhCWDd+JTMFECma5R89en9 aef/sNFLVchrEBroybKPzFOWePDyPYmxdn5zf3fb/RPB160w3mVTKYh2dZMKAWYuCPJ0 On7nPBAmnsBspt1PnUzXKR/qV7pGJZzTdRrgU0hzx6TBkmlvwu8lyG2X3AE5Z/SJrqH2 l70k5Ql6/UvZrMtWmNwKDK7iHrYQgboKKBrr3gX5QV2KP73ZUNo+6fQa1w5/M6xmDvCt /aFEy0QOuAWwKZOEy2/e188cnkOpUWjMqm+vVsCOIXUNdVrl7eqgTLVJCH8xLVXg3fAi ds3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id fb12-20020a056a002d8c00b00691004e7db0si7328804pfb.170.2023.10.09.02.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 196B780A58C2; Mon, 9 Oct 2023 02:23:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345948AbjJIJX1 (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345860AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82A00106 for ; Mon, 9 Oct 2023 02:22:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTC-0006sX-Q7; Mon, 09 Oct 2023 11:22:34 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTC-000NWQ-Cy; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4ot-3k; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Tony Lindgren , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/20] pinctrl: single: Drop if block with always false condition Date: Mon, 9 Oct 2023 10:38:38 +0200 Message-Id: <20231009083856.222030-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=844; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YKE8P7L9V9D6eghladkosJamRCKd+b5UoH3TDoc6yRM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wBrRbKaWaukJeLRndrn6pB3LKccfQJKwli0 16nUYkI9b6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AQAKCRCPgPtYfRL+ TtW7B/44yeQT6igw9tEP+D9fYA4PIKhJQgpUdOWoUs5fL0toneQALi3dmosp2c8vp33KXbG5Qgy 32gKGzf+3CTTwDt4cl8xQcZ70/Ohz/PcYkTUd7Gme7xu1aGLLK6+pkvaM3M52rKR34eRxypSYuy Ggkb4fFk0wsixK9fBpS3NiGHaMdNNUayaaHIBZJq86t8k95H9pAAQQwMds9td8bpVGZGGQuib89 TQUfrhk0wiNBGU4To6RwoELEpyMcGS5Pfa3TTeFMKp772k/RPGsfnCAUXWrc69WdEsJo+uASphm tAHS1lcCvheZbsA4qNTYqdhYXVk9XyCBDHT/GhiyL/tEioH4 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:35 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269283315622734 X-GMAIL-MSGID: 1779269283315622734 pcs_remove() is only called after pcs_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-single.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 461a7c02d4a3..f6c02c8b934d 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1929,9 +1929,6 @@ static int pcs_remove(struct platform_device *pdev) { struct pcs_device *pcs = platform_get_drvdata(pdev); - if (!pcs) - return 0; - pcs_free_resources(pcs); return 0; From patchwork Mon Oct 9 08:38:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743482vqo; Mon, 9 Oct 2023 02:24:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJ46rE0boKisZ5kJc9ZLjtpyJc13++8WV0sszSeHUmgKXIZkkzsm4B7xdN9yzfoykvZ90z X-Received: by 2002:a25:8e07:0:b0:d86:56ac:feff with SMTP id p7-20020a258e07000000b00d8656acfeffmr14143772ybl.6.1696843495715; Mon, 09 Oct 2023 02:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843495; cv=none; d=google.com; s=arc-20160816; b=0DY8bo3r3vrpOZIeD6OE1IomoHTQweRd8caQhep4jMOY87axHJVCKcMkuTL0XEAtG3 /J7bQ692sQHF3ydI2J4IRz2RuIlJiWG82exZpZwTikeyvoUIlFRkG9AazsjBdlOLQRas Jg2lnAqvIs+YNP3NVg9lSHki/UQKZ3fBk/HZ93J3kQ1R7wB22GdV7EtGCrqiQNLSPS+1 hKLQjVWiJTx5RVf5W5sbX+28EyeBtwKuY3bF2pMaM9JpI25oIFWesog/v2Mk4hsoFST2 HX81fyc9iQaYx2/le/5zlFENd2dxoGy4zMyexoT4pedakXaZyMPk42y32hi5S75lEGLY awLw== 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; bh=Nie2H1lEKZgUw9aZHWiYmZJK/dwP7fm2v7BkQWM7YLw=; fh=YDRVl7Ox4Q4QAKz3wG9riYJ2+Uc9K6DH1jNyaPMUBsU=; b=jv36VmH6aByV16OGLOBBLU3nNy2XSSzAXMUinzHRI3bhg9i//ZP1Eatd8MqHe81QQp diR9Zo5NvpaKi3v1vVhL/jevZlSR82AIflrG+DrSKrHnf7RMTSCG1G+LbuEw0SKabcvn dU9Zvq/WH8ureRBlYkUREUG4t51ekIJcMlbXadEbZ/LGqA+ms/XGHQgz19vzN6w59igP +gjHMJsR0zf3IY1OZyliX2dXQ6+qsDIqRpT/1rBSMZB1X3lvUmHW4fETX9tILODYWRA4 kK/EieI6t6hoG1FDH7iOyjeSd0GH50sqz79izzSxXUNbRkMw4wLULsEWViQzo+t/o0Jk 0uBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a6-20020a656406000000b0056b4065299esi9364016pgv.621.2023.10.09.02.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E2F1780BC3E4; Mon, 9 Oct 2023 02:24:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345952AbjJIJYC (ORCPT + 18 others); Mon, 9 Oct 2023 05:24:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345801AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B551CC5 for ; Mon, 9 Oct 2023 02:22:42 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006sZ-By; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTC-000NWT-JS; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4ox-AX; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Yangtao Li , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/20] pinctrl: ti: ti-iodelay: Drop if block with always false condition Date: Mon, 9 Oct 2023 10:38:39 +0200 Message-Id: <20231009083856.222030-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=917; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=ADcuWWwkM5/gkoFp6FtBWjwsKB9USL1JlIZt0PCZ89o=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wC2UY8AHx4VUIV+FUuHGT44H9qCxr8Sw/dU 8c6tnLh2GmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8AgAKCRCPgPtYfRL+ TurFB/4kLIvktU36dHpqh45SEy0RA6rK+k31xiIn3waWC0qcGft0HgOWYcEVNw2TagvASbL80vz 4E0xrh2Op0jCl7twlM2P1nZvBV+9w26vr9EaVmSsjmfFEp5Grbde0adN03TW7CRCatfAmZsHDEm USTx3+8PNV537PLm8qrQ8bDHlTSdvaRsHd4Wa5caZ7+m9Y7kJLkqKddC7XASpiqY0J2zqOtdNk2 Bzk6lQLrMgZluxPjOJHU6hDq/hE/hJrRkbM1m0YZxm2PxIZoNdoBv1mnJZTGojOBhGJS+MYUVq3 0G0piGTFwOmz0p8cvRXZqjXs579tszkrgkXAg/A20Uub/e2M X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:41 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269365227604343 X-GMAIL-MSGID: 1779269365227604343 ti_iodelay_remove() is only called after ti_iodelay_probe() completed successfully. In this case platform_set_drvdata() was called with a non-NULL argument and so platform_get_drvdata() won't return NULL. Simplify by removing the if block with the always false condition. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index c1477f657839..f3a273562095 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -903,9 +903,6 @@ static int ti_iodelay_remove(struct platform_device *pdev) { struct ti_iodelay_device *iod = platform_get_drvdata(pdev); - if (!iod) - return 0; - if (iod->pctl) pinctrl_unregister(iod->pctl); From patchwork Mon Oct 9 08:38:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743433vqo; Mon, 9 Oct 2023 02:24:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXfAW39G66nhqcS7p1taR3/c1gWf8rvIw/GZQVZY9lE/9DyLaGHBkJ8hrTbLbdCGhPy0Ka X-Received: by 2002:a17:90b:895:b0:279:47d0:d92a with SMTP id bj21-20020a17090b089500b0027947d0d92amr12378095pjb.17.1696843487954; Mon, 09 Oct 2023 02:24:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843487; cv=none; d=google.com; s=arc-20160816; b=YheXwGML+MbZT69LKfx0RpPOw+P5OgdOdfESui1B8v4UoGACyQKqzwbiv9QRrZmwx7 dW1+MQ+GAsuOrGGbmmDzvtmlBbz4qjMYopUWzbnL0OdH/r0prfpULbUJa5RYpiEpeYjt 87Za3fiWVN126SCAzE+FKriK7Q6Zp5G8TsLlla4QYo5bfnkkIlY6L2Ta21/uCzwGqooy OAXKg9T+UlbjzmG3dsSWLBXmPGZZHTir4BlTdch8OZ4kfXyS8IHmTFzmI4U5E4Az0pCm qy0YlDgVuTQ0Zh6O41FF0wh7tvMWsUTNkQ2cBotIox5eLcsMqPCi4tMQC5BDDWHq4iyL t/yQ== 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; bh=E0tROeYZDANI9Ug3xo178TqQHQin3artQg4Mkj46ZCc=; fh=wqtKw7eEiMuf6qflFkZU0ZUIo6O5ZuxM9BeFzZf1xds=; b=tsMC1e6o5vzaTMwiMjeGzTXOTN/2Ngbfvi2qOqJc/WizDD82xJYGskcbmH0gqRkd8e wQQempzhYRRQQh2uWoawXi5T3J7J0FDUwUDh1dkL3B6h0HJyVGRhVaJG3jdxg21GRkR8 maCNib9dzNoxQVYio2LiVZsrT5T3YhbOZGUyGVAyPyuTGEzVF1jngbqT2JRYqs+KXGHo kzxkTodavpfsiK/s9qY8bnIP+2ENNRQ9urW71JxbFTuh39z87mzQDUOhrAoioyqZ6/ke 8PsJ3dGROAM/3plB+bT6ldNojOz54nYJA1mT/dA+AxJawH2kj5+ej22z2bmWOz+Hpx2t VqSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id il9-20020a17090b164900b002772f04f9bfsi12503683pjb.113.2023.10.09.02.24.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4875A802120E; Mon, 9 Oct 2023 02:24:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345852AbjJIJXs (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345842AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADF42F9 for ; Mon, 9 Oct 2023 02:22:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006se-M8; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTC-000NWW-QH; Mon, 09 Oct 2023 11:22:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4p1-HB; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Charles Keepax , Richard Fitzgerald , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/20] pinctrl: cirrus: madera-core: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:40 +0200 Message-Id: <20231009083856.222030-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1757; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=26z5dwfBVv8uNLLkaBoXVqJ2/KKNhn+09EFI0ePmRQg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPcyLrj76ufie/uJEWe5rEaxxUsbXZzfNSbtxO+Gg6 uwSm+M2nYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMRFKe/X+hyM/6vsxPDw62 hMcmBvn6BOm82a06IVqFne2v4o0vCR+qM6dmZ/mvC00K3xc6QWnKrvbXRVaW9dK9j17p23wsuDP HbvGzpVmrIjIXSTYeyjvs+WZv1L3q3bpVjVlrTCPdbtq8eKkXf+Rp1LQvGnM6uJPPdTNfrLT1M0 sSm6D3iPF6rrmLwMtvdRNuWihMm+NYmPzUybBvVQAb3+LMk2ItuRWHb9zwMAqSNjcQf6he43MpM FLKRaDXLH22XIGMwOIovzdSfRZWzhNnq72sMOsK333QX6vpQUKZ4ZOJKpcMJs8pufn2yjrhHHE3 J5GMfoHbX8OiZj/RutK/Xa3o5hynl3ziendCZNtCNNcCAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:45 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269357126133522 X-GMAIL-MSGID: 1779269357126133522 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Charles Keepax --- drivers/pinctrl/cirrus/pinctrl-madera-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c index bb589922d8c5..898b197c3738 100644 --- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c +++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c @@ -1084,19 +1084,17 @@ static int madera_pin_probe(struct platform_device *pdev) return 0; } -static int madera_pin_remove(struct platform_device *pdev) +static void madera_pin_remove(struct platform_device *pdev) { struct madera_pin_private *priv = platform_get_drvdata(pdev); if (priv->madera->pdata.gpio_configs) pinctrl_unregister_mappings(priv->madera->pdata.gpio_configs); - - return 0; } static struct platform_driver madera_pin_driver = { .probe = madera_pin_probe, - .remove = madera_pin_remove, + .remove_new = madera_pin_remove, .driver = { .name = "madera-pinctrl", }, From patchwork Mon Oct 9 08:38:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1744085vqo; Mon, 9 Oct 2023 02:26:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGHdrHO4G2xdmiGjdNpAuSLdjkXSq4rwRZGPNIm6WW2cUrra1cZYqhTtXWgFSYph0iHvFt4 X-Received: by 2002:a05:6358:93a3:b0:135:acfd:8786 with SMTP id h35-20020a05635893a300b00135acfd8786mr16234201rwb.3.1696843594110; Mon, 09 Oct 2023 02:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843594; cv=none; d=google.com; s=arc-20160816; b=BYH8fbsVftXr9oawC75p1DBQ7v1m7m+9T6nyV5lLA7smtJM7Z+rCx0NCtF/SMGW6q/ UEqr6WOj6J7Km0VB87W7kz0MUqfJoZS9oO9W6nAe3vD0aVj69PSMmzMAwQcFir04lkhf XSlPwDU6qhZoFwNGIQ/QV7KduIb7sCq06yhjLAkmfrtLn9Bzz2vYhbP+DOUxd4mKrWyG HfKsGn59Z6/mR4ZjqCPEUNu9QABbTNIMTUzJhOXJOl21ZfL5ExtxQjsEUnHp+4nIa3zW A8C5KsZzhSvBEyu45Poj4gzWBYBTjmHDjIoG8/Jq/FjOzIqzX0PfzKSyMKuhHD4ORtl9 srow== 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; bh=bLmZ+kffsatEQDVB7lRI1HXiipV+eN3Wfm8cWwUE278=; fh=mSN73oHr7kfDNqWHLaWDjU7cicS/WqCMc4qshTlcuJ0=; b=yYBWsd5/bVC/v8pnt2ZMd9C6Z712g/cUt5aY8w3psiWXrt3EYXm/Xo3GVNzPbQqGmk N1ihK3479N0Grh0JgQ9/VXKna9dR3wUYli4ou+pTDEF9+s3dcry4v0WIKEWmihlpTh9J RRWTa5PsGJg5oIp0MfwLOu/reQwwjNZouA4OLlCkdFC979FpFuBIen5nRN3Dl2dXKQSo SFFbhuLhg5UkvvPYckzYN0pMT74SDmzVlMGHietmM2Pkt/KT03B6eQvd75/EgPgTirRC fzs/pQ2T6/pHniKQtdXfmACmg0Gk9LcPV3S5/ryDqC3z7qwjGhLWmytjco62vIw1sE9k oSew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id a17-20020a17090abe1100b00277277fd2besi9240884pjs.190.2023.10.09.02.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 820C080A3648; Mon, 9 Oct 2023 02:25:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346007AbjJIJXv (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345833AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E26AF4 for ; Mon, 9 Oct 2023 02:22:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006sf-Fw; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTD-000NWa-1L; Mon, 09 Oct 2023 11:22:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4p5-Oh; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Mika Westerberg , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/20] pinctrl: intel: cherryview: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:41 +0200 Message-Id: <20231009083856.222030-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2108; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=S4F/Ao6mCu0ElcleKD+S+Fk5DRAS/72HcfKe390NuvY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wE53vDr7UBK47ldXgIYZev2MHpu1X7uKNaB LRlAJOCz5qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8BAAKCRCPgPtYfRL+ TrrlB/0cybM0pgGOwafLmSvV1Kuw38n2Xm2s8vDDjzm6cesAP4fVfeiXo7xwu1xOdRy45Xwr+G5 abP4ExhcNV8VZ1jdoZmBLZ5CIDHWJsRY2bJ6h3qKCEsZlp7ykzhAuxjqkyHR7INf++qDqNup8T+ h/pBWAIGXSlW+KZV1kxBC8Y0sLNrqc1omys7HzYK8a9KXu2TliWtA0oQ83JTOTVMemXygIke9B6 ZWFPGYI/CNF2Xis/9Z1xD1D4urmYWN/vvFapXov3kVisLWVrvOfbMm5qkOK4uJgaJ96Mqfiecbg zg2HkJf3RLXXXNK+DMLN5dvoHOtZ55iyU6wIy17EN5Iwy/n9 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:25:19 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269468214382202 X-GMAIL-MSGID: 1779269468214382202 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Mika Westerberg --- drivers/pinctrl/intel/pinctrl-cherryview.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 81ee949b946d..1f923a895987 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -1728,7 +1728,7 @@ static int chv_pinctrl_probe(struct platform_device *pdev) return 0; } -static int chv_pinctrl_remove(struct platform_device *pdev) +static void chv_pinctrl_remove(struct platform_device *pdev) { struct intel_pinctrl *pctrl = platform_get_drvdata(pdev); const struct intel_community *community = &pctrl->communities[0]; @@ -1736,8 +1736,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev) acpi_remove_address_space_handler(ACPI_HANDLE(&pdev->dev), community->acpi_space_id, chv_pinctrl_mmio_access_handler); - - return 0; } static int chv_pinctrl_suspend_noirq(struct device *dev) @@ -1835,7 +1833,7 @@ MODULE_DEVICE_TABLE(acpi, chv_pinctrl_acpi_match); static struct platform_driver chv_pinctrl_driver = { .probe = chv_pinctrl_probe, - .remove = chv_pinctrl_remove, + .remove_new = chv_pinctrl_remove, .driver = { .name = "cherryview-pinctrl", .pm = pm_sleep_ptr(&chv_pinctrl_pm_ops), From patchwork Mon Oct 9 08:38:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743146vqo; Mon, 9 Oct 2023 02:23:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyrMEdKin8HpdlP7NLRgk0EFNWsSvHW88t73/s5nZuearaTyD3R5k5d0QsWlb/hhh7IZSy X-Received: by 2002:a05:6808:2097:b0:3ae:55e5:43b6 with SMTP id s23-20020a056808209700b003ae55e543b6mr17818387oiw.48.1696843435720; Mon, 09 Oct 2023 02:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843435; cv=none; d=google.com; s=arc-20160816; b=wHSGZn6VPM8kEWQOh7IQf7y5Q0dX1lgSEWN60C1g/9NP9UsoRLLkZyXNaYyGPWNd96 LWkiYvlCDsRmqlzOnxEIz9wIXtPpofli0f3IN4unNEr8jiGRATshs8Vb3bLn/zGek0Io Rgb0svhC5NAUzdEqUafl+cVCQbYLMHTmurSaia0iR3pdVU/SJdjHM6kzCqKqoZwRohce YY9tGt8pTC7MpLYQAwz2yF3beG2cl6VShn6uFmztdohPPBtMR/0wgjz9bsUnHNYx6G9z gRXOsDoUBJA0VQeV4EAMH7J6jJO9/Gw1GlbHOBlDeiQqsCZdvpf0glmDdZlCEtERR5/L 6Bqg== 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; bh=sCdEJ/yDaUBI/2Hdy+qCVy0OP6+QFn8BDaFTqil13tM=; fh=mSN73oHr7kfDNqWHLaWDjU7cicS/WqCMc4qshTlcuJ0=; b=d2ajvOd+VCs6aVsvgMEyZnVyD3fBIr7HuLfupBw/a96+6MKePL+iaKJxb7JbOgWp9Q /hvFSZuxNvV445jp/DTMG6u7t2/QNN0P5r+nqsrS5KkqYUZO/kNePwwI2O3jIFqGCOZY V6UT/z3P/pUURERWmrUSMDVSS2j5X8PCX1aFZU9s0TLgbt3pwjUGIoKX+Zzv8N5l2d/a AYVATW0bZd3LDH6y6maKdjPwm2QdrpYtDumZGBW3J1wcx4/RhhVo6B2y687YuHCjTtFA Fzc6B8Js9vSbUewAZLvK1w3xUFoHNDTaEmYosby9bCMFTHxUgEZHUqhWPrEwM9O4lGXx hsgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a62-20020a639041000000b005859e22461csi9166165pge.817.2023.10.09.02.23.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B496980B3B63; Mon, 9 Oct 2023 02:23:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345969AbjJIJXE (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345773AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C940F2 for ; Mon, 9 Oct 2023 02:22:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006sq-ML; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTD-000NWd-8p; Mon, 09 Oct 2023 11:22:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTC-00C4p9-Vt; Mon, 09 Oct 2023 11:22:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Mika Westerberg , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/20] pinctrl: intel: lynxpoint: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:42 +0200 Message-Id: <20231009083856.222030-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1761; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=fsWrpmMKU/rWYOktZJIIlG/sX3wfJlY9nv6zFWW4epw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wFI8hfY+1w3twniM/3CdxJLG0rAcTAt0xJF 0qOyf/xxIyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8BQAKCRCPgPtYfRL+ TghlCACZDDI0PkhZyjCfCHJ0oqnMoOlO09LfV3fC5w9nMJGRtsyksabDJwhBx983q4n/99/S8xK ywSo9xqhRmu7U1TVeL2sySStoniBDvRChCr4b0dXEEEoqIS+oxraQSqvL7fOTm3Y1unpnZlLnkV VVWCFZTUI1Zq1wtfwctxP4o6Kbsi6hrp/2cydsHJ2VP7Z7LEhJkhHjpAuvpi3rbeI93fn8kwtKW AkPmk7TGjz9odn1RnyYK7X4DTdQUZkyF7PEwhxyUprZj9g2uCU0ZTUrUQhMxKaYVPt5znxy1HVo pUcfO8/APURWonW/z7OfVzxfbdcYq/LQGRlMiqSgxkymvVoc X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:45 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269302553704857 X-GMAIL-MSGID: 1779269302553704857 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Acked-by: Mika Westerberg --- drivers/pinctrl/intel/pinctrl-lynxpoint.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index c3732a9f0658..f0725edcab3b 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -846,10 +846,9 @@ static int lp_gpio_probe(struct platform_device *pdev) return 0; } -static int lp_gpio_remove(struct platform_device *pdev) +static void lp_gpio_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); - return 0; } static int lp_gpio_runtime_suspend(struct device *dev) @@ -890,7 +889,7 @@ MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match); static struct platform_driver lp_gpio_driver = { .probe = lp_gpio_probe, - .remove = lp_gpio_remove, + .remove_new = lp_gpio_remove, .driver = { .name = "lp_gpio", .pm = pm_ptr(&lp_gpio_pm_ops), From patchwork Mon Oct 9 08:38:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149904 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743000vqo; Mon, 9 Oct 2023 02:23:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6zV1BUH+KgtJGd4rNd9VDIPGegpMdwHVmtpTyDDj+4Wcjw095RtZyBn9AQmwaIhRRivsK X-Received: by 2002:a17:90a:1b88:b0:27b:9fa:ef0a with SMTP id w8-20020a17090a1b8800b0027b09faef0amr16335815pjc.23.1696843415965; Mon, 09 Oct 2023 02:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843415; cv=none; d=google.com; s=arc-20160816; b=F/mRJU7Hgon3kuv/I15g8m94lKbwtbc45fObAWPVYOaXunNNVeWP2bonIB1db8MHhz ZWUAgBf2SdT/1rb2A+zLlTgwSM7ed57lmVxoIymX14DDcIuYrZWTt/kDoYv43463WF0+ 5v9UWCdsIilsuRojlRuvIh93vHizIowTBiWJVeKJlb06mUkYPL1PMxUZnt2144urpfpK t0sMsFWZI3hW17Q4YnWhiqSUtck8oCGXxh3TzgRMqORNi6sk+CFNE/b+eEpkLbzatZ6Y 2htie784hjjJY/mh5c12gyBAM5Peookt1qmIIsrcEeznRVvqpertnRVaRsAeMEIhQAtz F3vA== 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; bh=zS4WtoKV3d14Z/2c2lMoQygioEKVPvNVrTnZqAMQ2FM=; fh=pAo+ELfTqLZj0+fmLuLCcqqOGn4+JhBCWkgo6Lcn92M=; b=KjvHFR/7xUU73ArCNyUOK8rhLq4TKy0s9PW0KN5BsFrkmBSn2a5T+GGkDyAmUAZrFq 9acKIJqIQxoJi0l2z6+bjghgnEtJPuazv7BgZcKDT6om4N/ewUb+YpH+e8t20VcdMnQw CqwDIPN9++s2N2wlVlEQULbzvv2G70gSV+63JknCAvHWJ3pYokLOuJ4KmXMs0ruq0sCn vWT6Xi+GetwmvcOJO1PA29mCH07xyqk/niGxPQVM7H8cWZoe9qKEkRkxfX6VuucpcccL zq8DMfifwpLGYBuLPSfROjDuRWjblpYNQ84zbu90nUw27RsoH0AyAVREqg2xvoEL43mr 0pTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z16-20020a656650000000b00564c67e66fbsi8948800pgv.842.2023.10.09.02.23.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AAFAD802121C; Mon, 9 Oct 2023 02:23:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345883AbjJIJW6 (ORCPT + 18 others); Mon, 9 Oct 2023 05:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345707AbjJIJWs (ORCPT ); Mon, 9 Oct 2023 05:22:48 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE255DF for ; Mon, 9 Oct 2023 02:22:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTD-0006sy-Sw; Mon, 09 Oct 2023 11:22:35 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTD-000NWi-Fw; Mon, 09 Oct 2023 11:22:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTD-00C4pD-71; Mon, 09 Oct 2023 11:22:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/20] pinctrl: nomadik: abx500: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:43 +0200 Message-Id: <20231009083856.222030-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1861; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=x2KWQ8ND+eDvRay0aKLtZDCZD1SPAhsCIdQmVEps4lo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wHsl1vdO0V+6YWoS08CB0bmd/UjRDek9bRC dXtf5HfDhCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8BwAKCRCPgPtYfRL+ TjeFCACbpMBmj7EOf+G1UFGYv3PxitszRTnu9lWkhurVE7IsmkEsb+WQq7EsN0hE+S5AIKjcuHX eoDGCNbRLj0Y50C6P3zDeCdwe91dtx7eugvi3xsOkeEFdmIqB8MIdgr+l9InqnIw/fWHDXY38Ac wshhoqeRZF3E3vuMDy97fhtAZKauXplJ8Z8FMVnPmUyCZiJQ4TZxqRwrc0r/ogUtzIJHxJaDaDs wBtk2i0BAlzXEiMmXBez1UkMLh15Xwxc8qlfANnoJn3TAQCqegPHFSKSfRC7dGfjghsH+7yPQn+ 4rO4837lZEUGxc0AH2HPL4f8ZfbZyXoPAWwZhB1QAdXu+SB1 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:28 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269281742891378 X-GMAIL-MSGID: 1779269281742891378 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/nomadik/pinctrl-abx500.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c index 6b90051af206..233857d54403 100644 --- a/drivers/pinctrl/nomadik/pinctrl-abx500.c +++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c @@ -1079,12 +1079,11 @@ static int abx500_gpio_probe(struct platform_device *pdev) * abx500_gpio_remove() - remove Ab8500-gpio driver * @pdev: Platform device registered */ -static int abx500_gpio_remove(struct platform_device *pdev) +static void abx500_gpio_remove(struct platform_device *pdev) { struct abx500_pinctrl *pct = platform_get_drvdata(pdev); gpiochip_remove(&pct->chip); - return 0; } static struct platform_driver abx500_gpio_driver = { @@ -1093,7 +1092,7 @@ static struct platform_driver abx500_gpio_driver = { .of_match_table = abx500_gpio_match, }, .probe = abx500_gpio_probe, - .remove = abx500_gpio_remove, + .remove_new = abx500_gpio_remove, }; static int __init abx500_gpio_init(void) From patchwork Mon Oct 9 08:38:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742897vqo; Mon, 9 Oct 2023 02:23:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqws5yBqPk7+RdKDW3SlKSfrdSeyIna3cbMtxAKn+veCJwj/sb3dNnt4M90hoN3IAhTe8J X-Received: by 2002:a05:6808:1823:b0:3ad:9540:5475 with SMTP id bh35-20020a056808182300b003ad95405475mr19596087oib.45.1696843398873; Mon, 09 Oct 2023 02:23:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843398; cv=none; d=google.com; s=arc-20160816; b=o9HNK/IPaQYONF/enLXNBWYDxPtCOCNkplEcwIqsBnsNDaKOLqy1WP3ClgNL80D5sK kHcAaSvtcoDRJnrkFizlfB1+kToWbNN9If2BRRag/LjqSJ1YmTsWaOSGZ5NWnyMs1HrQ SEHNxnSGJfYZyKxRh3nPOgXNmnML2T1yYajirelGyD48rj2YXqQs5WpehACfm/m+9OxW dYb/SReqBRjRe+ujH58Sf0uWvyCo1gZp2uYFY98pC2hh5xsjvHm/swVCVFEmlmsu3QLA GeanG9s8jd51V1WuYg8haFrHSQQ/djNxrHaDJ5sqkIWaCT1FPqen8ux2+aNpQllyEPl+ AUOA== 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; bh=b2x6+Lvt8OhSD6bMA5lhZA3rnSXDhR4DAhV4qeiMFI4=; fh=QEOXWjOzdQ6IHl4PD0t0SQm/sclZIApa+PyUrITPcWU=; b=XLw4cQFwaMJvOgWv3vGxHI2y/gkMMUcOcDizUujNdfnisvdhPkVJR7j1bqr9N5aVvN uWlKE60B79DrDZVCC7zY3Zb2yRiHg5Iw1zA4BO1iszDRqtp25azVY65Q4G25fuKiq+6w 0d7UwFpqz80CNYIe1+vDPuT/REoJXoDKp8z7JB0+asREzVU4+KBOVxy/3X2cIeCoWl8X ETAU9s7X5f1bkX6v/53SJTAk35uY+1xm0rhwMtx8m+4uekgE+mAbObAmH5iT0gVTDZ/K F+666sUqH/4p5az5UKM6aZFEg6qAKbtsAHinqv3+RT9VFa8Xj1ISUhJ+lufnVeQkH/Xn JIpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id 23-20020a630f57000000b0057759a5b7ccsi6324866pgp.305.2023.10.09.02.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 27CA480D2E6D; Mon, 9 Oct 2023 02:23:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345810AbjJIJWu (ORCPT + 18 others); Mon, 9 Oct 2023 05:22:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345778AbjJIJWn (ORCPT ); Mon, 9 Oct 2023 05:22:43 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9968DE for ; Mon, 9 Oct 2023 02:22:40 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTE-0006tB-3J; Mon, 09 Oct 2023 11:22:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTD-000NWm-MM; Mon, 09 Oct 2023 11:22:35 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTD-00C4pH-DG; Mon, 09 Oct 2023 11:22:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Basavaraj Natikar , Shyam Sundar S K , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/20] pinctrl: amd: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:44 +0200 Message-Id: <20231009083856.222030-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1768; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=V7AnU5mBt80bO3f/bU7N6FqQ85j+a4pI1X5vE/2OSgI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wI1+nZs515nJnjZmZdqHxhOhVNRVBbcm892 LSzhWR+GvSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8CAAKCRCPgPtYfRL+ Ttf7CACi6wQsY9DE8xhf2gF61QGcptRTb8H5D+pStx06n6zNcoRco2+PjJF/HNZLUjDok4IzKX2 8DI/1L7yRW3qkHLxoNRi1z0zce0ceVr+TuATh7388F8TrHbv4AbYmw0hOqsiUuXlzZmBxCqzDdG 9inVO+L0dGBOTU0+pv0WUCi7kD/SK7+wZX4NI/pKmkt4q+lc4R2geO6dB+OunvBfV863gD0uraX 5fPv/KpusCfa6MH+qqmzfF2W2T5wtMIbL1v1QiixCXkw2wOhaz0nsDgdSojQAlGlonoH6aQ0g98 yxLQF4/pjNT18Y9Y8O/2GwgEEUKDkJiM5lziHxMEUu/hf5NH X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:12 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269263742415192 X-GMAIL-MSGID: 1779269263742415192 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-amd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 74241b2ff21e..fb58acb843d9 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c @@ -1166,7 +1166,7 @@ static int amd_gpio_probe(struct platform_device *pdev) return ret; } -static int amd_gpio_remove(struct platform_device *pdev) +static void amd_gpio_remove(struct platform_device *pdev) { struct amd_gpio *gpio_dev; @@ -1174,8 +1174,6 @@ static int amd_gpio_remove(struct platform_device *pdev) gpiochip_remove(&gpio_dev->gc); acpi_unregister_wakeup_handler(amd_gpio_check_wake, gpio_dev); - - return 0; } #ifdef CONFIG_ACPI @@ -1197,7 +1195,7 @@ static struct platform_driver amd_gpio_driver = { #endif }, .probe = amd_gpio_probe, - .remove = amd_gpio_remove, + .remove_new = amd_gpio_remove, }; module_platform_driver(amd_gpio_driver); From patchwork Mon Oct 9 08:38:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149899 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742764vqo; Mon, 9 Oct 2023 02:22:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoscngBLOE77MbD6qdyIyVvRr7ronxypm858nlQqY6PlBlEnfyWvH+xtg/xHAEwMJ/l9U+ X-Received: by 2002:a05:6a20:7f83:b0:15e:b8a1:57b9 with SMTP id d3-20020a056a207f8300b0015eb8a157b9mr16765231pzj.24.1696843378788; Mon, 09 Oct 2023 02:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843378; cv=none; d=google.com; s=arc-20160816; b=yO1/EYkhiJ6NSt4Ph+3cMs4V7H8jZyO+p4T/m4i38WGmYt1gPOy/olq8TmW8SqfVjK h+PSgYuFkGKoCzkdaXI51avVKrL79sO5J+XWWIzF8i8vuharioEu8L6AMUg9pkwzDg3/ KUbW/Cw0zR3HTaTarcz7J8KjMR+v7MWfxzGSeFAIzPpm4JiwdBTajonWUtC6YJQUUx/W 45itssiHdGA0MaD2FTl3LNw7lz3CN00AiD1NnmNqB/m1tZBEfu+/EX9HULns43z2xotR OZX8LukG/qPgeisCanzTToylFOgD9VL9BdeyTe7u1FQqDoX/CzzbKQduHiBly/iof+kp C/7Q== 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; bh=jedGpN/a9+f366iI54ipiE2vtlx7H76ElYh4hAwoonM=; fh=dfUUv0FvKdknTHlyWpSQp0jEw8xwF+Rpu8OiiA4X8Ds=; b=Pyqle54QjApu6lp7oKgq/lsqs+xsgeH40fP2W/GYCj59Aw3D4JMU4C3/iK85z5ezTG CbwHBvRd66c6e7Kn6KMQeyKxJvicmz/ARzmJupXF2LyDF/Cgjfy39wUbq5iwkSVKxLIE 7VJup1c5jMOVY9XjcuOp+OZTX6b433Z2tqGQ1HvqzhtXz6kUQicydH1xyE+OU1HmjT85 /wkAcuh+O5Q6c4XfnSjIcPzM26wo0+vfKDgfj9z/bKQfheQokzw7P20j4dJZpRWs1UJA vLCL5b06oP6TBtOm7Xh8mVNq2xLrSR6BvVeDt1Ieu8mLhZw3wuWUE0w1bOwDOuBGnV3P qQ9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id j190-20020a6380c7000000b005641315d956si9324500pgd.147.2023.10.09.02.22.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:22:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3176A8042A8F; Mon, 9 Oct 2023 02:22:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345789AbjJIJWp (ORCPT + 18 others); Mon, 9 Oct 2023 05:22:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345707AbjJIJWl (ORCPT ); Mon, 9 Oct 2023 05:22:41 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB565CF for ; Mon, 9 Oct 2023 02:22:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTE-0006tV-Cz; Mon, 09 Oct 2023 11:22:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTE-000NWs-0L; Mon, 09 Oct 2023 11:22:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTD-00C4pL-NR; Mon, 09 Oct 2023 11:22:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Jesper Nilsson , Lars Persson , linux-arm-kernel@axis.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/20] pinctrl: artpec6: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:45 +0200 Message-Id: <20231009083856.222030-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1758; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=REwHugWByH9MZiAq/xaUHUffBTFsuoloAV+rOifD5WE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wJ0B8jigP3Dxi7n9R6rd5K2RcM9kcrzEbQ3 oJLJrwV1AyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8CQAKCRCPgPtYfRL+ TjIfB/41KqJBdmph4C1MLpdcUe6c+RY3hCISKnr2/I2/lax9Tbb+w4xBwLLzqqNgdxopKbkGJEe 1uO2DLLNtbS6jFO+p9j0dJR47AR3ZYlIx0IlDrTsFBHFqSeCJZKn2VwyeNGwc+myk8VQniU0cJ3 ++SAUQqPTYzSOuO1LZXT1RPQexyt6bcMa/8p0T4/aOdQKGSta0+GEBcK1KyjJ6ktgKM/Av+DwUH E47opsIFgA7KXx9HkDDsxo+cj6pKu9KIcf8ubfLG4c61M6mB9OCvsea8NYQcOyzdN39TNndY0BA t/zFFA+FkJKmtFyo+p1HrKlBvSqRs85XfxEm9Tat9R7vsZP0 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:22:56 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269243150981393 X-GMAIL-MSGID: 1779269243150981393 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-artpec6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c index d6c9f9dcff97..dd93f124e0a0 100644 --- a/drivers/pinctrl/pinctrl-artpec6.c +++ b/drivers/pinctrl/pinctrl-artpec6.c @@ -970,13 +970,11 @@ static int artpec6_pmx_probe(struct platform_device *pdev) return 0; } -static int artpec6_pmx_remove(struct platform_device *pdev) +static void artpec6_pmx_remove(struct platform_device *pdev) { struct artpec6_pmx *pmx = platform_get_drvdata(pdev); pinctrl_unregister(pmx->pctl); - - return 0; } static const struct of_device_id artpec6_pinctrl_match[] = { @@ -990,7 +988,7 @@ static struct platform_driver artpec6_pmx_driver = { .of_match_table = artpec6_pinctrl_match, }, .probe = artpec6_pmx_probe, - .remove = artpec6_pmx_remove, + .remove_new = artpec6_pmx_remove, }; static int __init artpec6_pmx_init(void) From patchwork Mon Oct 9 08:38:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149898 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742721vqo; Mon, 9 Oct 2023 02:22:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElbqx9ys10vB+niQgRg/eSmg4xqXrLvCSQ345OYrTB3ek7QonDR4bw1T7SBiVFKM4u9OT2 X-Received: by 2002:a17:902:e750:b0:1c5:efd1:82b4 with SMTP id p16-20020a170902e75000b001c5efd182b4mr16610810plf.29.1696843371301; Mon, 09 Oct 2023 02:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843371; cv=none; d=google.com; s=arc-20160816; b=Hj4shpL0ES4bEVbkV+oAOm3BpGMSd6aHl44QDdbywB2lhaSWW/ljlbG4zQOJnce8t/ zkrE+6J75glON9wnUJShpsq20HIzTy0Q40yx6hdizdLrbwxhvkJx0Raw99POH1F6DvZU K0ibUvQ/ARoMMsw/fhwDT7h+Lexs4zc0uQU9mWT+nfv1F4k14N1Pc5+vv2sTO+Q3k80n IulM7hHzxujojtNJRCrG7JhktKDxM72xEvkAqDXRDvNIV1k0iX5W7doWjis0mi6iq0w4 MYwCpt3q6i0Gzet1IvuxVI4q0XcYPPc5usQoGKUKp1MRlCMBuc6XH74VlSGCtBOh4MNI 0Axw== 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; bh=h1Qg5v6DO4SOWmascaXNgPUMJfSDDgOZ+m8pKPK2xIQ=; fh=F4bs7feh0kNPfpkxC+XiThUexV96iac3bkIm5iNd+h4=; b=Wr/v3IOyK3TFaR9xUxKkLxWWJnmQjeyVB6ezTBuqFo/HJhXtxZGUVrbf26NInh/Gr0 h8BGPPhphsMpG5aLpUtIs4hw2f82kSEEd4piiW75+xOO2ceQlIkzA1BJMWvNRhCirpAu gllAiAMCE00XdQkC7hD67L9IDS9fd/quQmZce1uft7C2gziXLPpSNVeKKWc6iQJdVGt9 wU/wKLTyjZT6jgfqZsP2xTOrBHETl9jwZ3zFIEdMZ1Xs7YcYfdAXLCDyaRrqOfkR8K3Q OmCPRPb9yMPO9OWGQoilzJEY9voWSx8JKl8AysIy6HewN+lRvpinIG/PT0eC02gWLKwc XGiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h12-20020a170902f7cc00b001c604f8de9fsi8827596plw.631.2023.10.09.02.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4E0B0802120A; Mon, 9 Oct 2023 02:22:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345774AbjJIJWm (ORCPT + 18 others); Mon, 9 Oct 2023 05:22:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345695AbjJIJWj (ORCPT ); Mon, 9 Oct 2023 05:22:39 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CFF97 for ; Mon, 9 Oct 2023 02:22:38 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTE-0006td-KC; Mon, 09 Oct 2023 11:22:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTE-000NWw-7o; Mon, 09 Oct 2023 11:22:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTD-00C4pP-Uy; Mon, 09 Oct 2023 11:22:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/20] pinctrl: as3722: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:46 +0200 Message-Id: <20231009083856.222030-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1797; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=MPWtYbMOQgZR7mlnb/mgL+Kp5Cn22AjikhRP10lPHcU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wKE74xmYD8QqeyqKDdAd0aRFg6ar601wE4U 3O0gprgCImJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8CgAKCRCPgPtYfRL+ TigkB/0ezfjZNnv82AK92u26hpU28QyX4rIKqnS5KQojWwblAi+52ppN5+EMlbRRrFGYY5wSBn4 TnVuCrRpr6YUxKBV7pz7p490x5ndIbSoG2wc3Y0AXYrp9XbqC4bqPLq4mQ+9jfG3MKEC25+WbyF /N4Q5VRsfG5fuV5jlzoXjNzTr97EzrLIVmpy8UTVLLBHJl9lz1SpLYObXzJPtPwtcrBAg5KLuWn hIb4IhnvbcAahYVYJOl+49L09sxhggWJFA1jqK1ZQCSJN46A4o0WbeL0RKpHJ2srBnCTvjJZuvO tM6KKRWDc4dB+lNZ28YbuKUFaS09UNJJsveOHajkwX6taoPs X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:22:48 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269234792846540 X-GMAIL-MSGID: 1779269234792846540 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-as3722.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index f0e5d87ac50b..84b47a6cc3a6 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c @@ -587,12 +587,11 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) return ret; } -static int as3722_pinctrl_remove(struct platform_device *pdev) +static void as3722_pinctrl_remove(struct platform_device *pdev) { struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); gpiochip_remove(&as_pci->gpio_chip); - return 0; } static const struct of_device_id as3722_pinctrl_of_match[] = { @@ -607,7 +606,7 @@ static struct platform_driver as3722_pinctrl_driver = { .of_match_table = as3722_pinctrl_of_match, }, .probe = as3722_pinctrl_probe, - .remove = as3722_pinctrl_remove, + .remove_new = as3722_pinctrl_remove, }; module_platform_driver(as3722_pinctrl_driver); From patchwork Mon Oct 9 08:38:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149909 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743191vqo; Mon, 9 Oct 2023 02:24:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr8P/xNFH00DI8m8nRivoJx+Y5aCqJSGTrM0R4iLhtkByenycLv5/qYvj/jHBk0d9BoJRz X-Received: by 2002:a17:902:da89:b0:1c7:3aad:305e with SMTP id j9-20020a170902da8900b001c73aad305emr14806114plx.27.1696843442413; Mon, 09 Oct 2023 02:24:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843442; cv=none; d=google.com; s=arc-20160816; b=v0SP1cibW9nfP691LdK2Grc92r3VdFETVFq5QRd4adZJ5vI76QJfd9tZdZr3Jdgq64 e8bLhYF724HBWT2qiFBQMvcId18Bv+1qXBCTKeRo+Sn3stQ4iX+PY61zl54L6fdkPQ0E NUJgp+UUKmB1kDt+VflKcaYTvbAe+woxI17qw6dW/RO1qUJGY2eO/WHVqfFXWpHuJpdl 3+qw8REzn1evyj0Cr3DriQlqWVUdGQKEkj4h0ezbCWOIzYslEyDaHrWESeze0hA/d9ZL gmvZ4E+XlnW/vRa3jjqhIdynA3rEzDyKtpzKfo1WF2CVfFaBPWeCe9R5ppj/jeSZ806T wJOg== 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; bh=Sk1j9wNXeq8vF3a+f0oXGOtGgrr0JlRkXrqVozWrg50=; fh=dJXZ9AKnq+9P1sEpeYBIKd7ZLoPiu8RghfPaOZun9t8=; b=E5iG6k4OEpjUwLIhGwQSd+r/kxcemrRMuaQ1BLiGC3hxgTdw7ki14u49O3JOMUS9Ij qLD8AJcD8NKiXzalq6RXjKdQOCdlfa/xqYzUbWtsvhqGmYJLejUeSupDy6Hozw5TsDUV 2DTOx8/p/4qq19cj8cjFWPcgWt5r5rh8WxELVCuUVVqZUa2Ecl0GDCF+2a6K3ebS7oNN hS0vBYh/YPsZYzesJwBN9DW27BXLvLg+I4sWkTh7bNfcXr8ofCJgsmZoRO/vbMRs17l2 rhX0kcXQoUqua3nSQ4TYFGyKRL6GgciVSfC6BwQ5G6pL3wriF6TW0YCP2LgFSJMXBGij F1+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u6-20020a170903124600b001bdf6eb05f2si9522588plh.227.2023.10.09.02.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 50C5E802122D; Mon, 9 Oct 2023 02:23:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345804AbjJIJXb (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345852AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CBA610D for ; Mon, 9 Oct 2023 02:22:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTE-0006ts-SJ; Mon, 09 Oct 2023 11:22:36 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTE-000NWz-F4; Mon, 09 Oct 2023 11:22:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTE-00C4pT-5l; Mon, 09 Oct 2023 11:22:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Heiko Stuebner , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/20] pinctrl: rockchip: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:47 +0200 Message-Id: <20231009083856.222030-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1992; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1r75hWhFIwS3Xxx1rg10xcxelpQqUr47pBcp8katCvo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wLOmza0DUzIsCY9zfipvZ36aTSt6DU6kjvl EYs+uaL1TSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8CwAKCRCPgPtYfRL+ TnXnB/9xI3Eby3413pFsFuP6EKG8aPL42C5OSRsytr3PhPLwgGp3LeX4/f2CzGzcQvQ1x/iXOLl mnhbwlPcElww+ahQoXDEsvpW4wLsNmZjTbrttMB+eHZ4TdXWn8dW6qsnosiATY3xSAgYsVn3UF8 t+K1fNRR9o5yOWL5uTaH06nXwmqZ2ZTFt3Kghc4NpMcJw5QeI0e89NdlHfR7lgUCFbLXgRUFkJa oCxEl53LUOeQSti/1W5K5dL7lAeLhX3H87pGo0fDnnXDfS9tEfty6ZoAXQTzp9sBf5oi8e13aYb qRGs+RIDCz2PyhmyH+dx8TTA+OCZH1VE4pVnXA+OpmzaD+1y X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: Yes, score=5.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, SUSPICIOUS_RECIPS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:55 -0700 (PDT) X-Spam-Report: * 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS * [2620:137:e000:0:0:0:3:0 listed in] [zen.spamhaus.org] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level * mail domains are different * 2.5 SUSPICIOUS_RECIPS Similar addresses in recipient list * -0.0 SPF_PASS SPF: sender matches SPF record * -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list * manager X-Spam-Level: ***** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269309479065361 X-GMAIL-MSGID: 1779269309479065361 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Heiko Stuebner --- drivers/pinctrl/pinctrl-rockchip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 45e416f68e74..3bedf36a0019 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3429,7 +3429,7 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev) return 0; } -static int rockchip_pinctrl_remove(struct platform_device *pdev) +static void rockchip_pinctrl_remove(struct platform_device *pdev) { struct rockchip_pinctrl *info = platform_get_drvdata(pdev); struct rockchip_pin_bank *bank; @@ -3450,8 +3450,6 @@ static int rockchip_pinctrl_remove(struct platform_device *pdev) } mutex_unlock(&bank->deferred_lock); } - - return 0; } static struct rockchip_pin_bank px30_pin_banks[] = { @@ -3982,7 +3980,7 @@ static const struct of_device_id rockchip_pinctrl_dt_match[] = { static struct platform_driver rockchip_pinctrl_driver = { .probe = rockchip_pinctrl_probe, - .remove = rockchip_pinctrl_remove, + .remove_new = rockchip_pinctrl_remove, .driver = { .name = "rockchip-pinctrl", .pm = &rockchip_pinctrl_dev_pm_ops, From patchwork Mon Oct 9 08:38:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743300vqo; Mon, 9 Oct 2023 02:24:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9Ix4Iy1s/bM2F+gst6KNVZRGxdt+mJPpSzcABSueh9YzV3So8MVItbjR29qytfR6aWZ1s X-Received: by 2002:a05:6a20:8408:b0:14d:2b8d:d62f with SMTP id c8-20020a056a20840800b0014d2b8dd62fmr20081009pzd.47.1696843459270; Mon, 09 Oct 2023 02:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843459; cv=none; d=google.com; s=arc-20160816; b=uRBPQ7CFrNVq9O+FVFkMNrVafOsFEINl8XMhGLDv88BVVl/8HOzk5d9Q98m1OtV/PR jGx/nJAs1kJ3gKzwBybZvULJP88WgnvlciOD7fpm+7pZzVrgZXQK5y5tIfWRN/F/22t6 CWZbqwxVkJ5c92ylAlloCXsQpW0Ls0OQTRofXuHFX2xOh/wMpcTAfWVHavcguuyQwD+p hVjwjaqYWRW8Y/j/B3wj4LTcEwXE0fG5NL2igByZueDuZexGvkeB11I4EXC/tRVD7Ovp RaM/4S3qMWvPWyfN5a+V+tK4W2JSol4+ZAISFEh5XGGTBfCWa0j2RMLiUFNyfUR33rNR D4UA== 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; bh=uHOqurzSf1tuBRJpA4p9DE77EM6SeT+RotY0TYOHsdY=; fh=uUylZnDcSU0D174UQqR16g6nvZ/zEF/ADmbyGwLrIrU=; b=rhvxE9kxy6Tf3TIMdD0W7wiUN+LbeVoQ49bGE9eKDMlumPfYh5QXDhmKjnREXbM9bi r7DOxoGiT9GKiUpJ4h7IA8lIgGA1Kv1JWnKaG7N2jwqTkLqT9HJZKOZI11lv5miTnlCZ DWyNICHDProHB57p59cM49wZ+ig9mYf7YC9ZJoajisMRHGSst90MSTzLh+lFWRS6r2T5 7W0ATr+uJUdOL6Aq8Stv0VA5WUqGnwDkZXNj9YjDTNOgfoLeBR2OPR+6d6rVVULXGc0/ 7yc6dZ6MViynVEkrNKWafwrvQNjXYlYymiFKwaKrDsnGRA4GArr2HiRWS9vIb71JQSJk Djtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id a27-20020a637f1b000000b005824bad8f83si7223111pgd.846.2023.10.09.02.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B446580A4146; Mon, 9 Oct 2023 02:24:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345906AbjJIJXf (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345780AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A66610B for ; Mon, 9 Oct 2023 02:22:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTF-0006u0-3A; Mon, 09 Oct 2023 11:22:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTE-000NX4-MJ; Mon, 09 Oct 2023 11:22:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTE-00C4pX-D2; Mon, 09 Oct 2023 11:22:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Tony Lindgren , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/20] pinctrl: single: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:48 +0200 Message-Id: <20231009083856.222030-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1718; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=a/v66eHU5Uj0mdLHd/QFQaWVOjMQuym5mHOAFMrvkQo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wMpQfffOI+H9Vi/B/d91YEdLm5ZWEcXq4/D AEvGVfpkcyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8DAAKCRCPgPtYfRL+ TqL0CAC3v82p5Lv7oN5Wy3K6FJmKhHnhom34PdJZSWq78xBLF1KufxJbcTFiyVO+Zsmp3afdWvu 714iTYS+1erVsGJ/c6pHn28JHuYEgo/K7nQfx1RBmWyGbsv/4tYf1JRHq/+OiJM3oKqJqVnRYka KyACUXPnItwsfQA8UU6jMRbGgEXWzW2nYgj63NTwEmbYOLYq7QRl3SnRdxxCf8ZQgVGDC0xSWsu 4wW5IXkcRWvcvi0r7k2o3npSnzmZepMhoDomj8c0eBdAPKoR5TV9mS3QDxcuBUCuinyadge+OY4 sBbvV5GdCjcOGe3S2ZO0mjb2PNnds/PboCOBcR7knUT0rTys X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:08 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269327204133739 X-GMAIL-MSGID: 1779269327204133739 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-single.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index f6c02c8b934d..1f915269d347 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1925,13 +1925,11 @@ static int pcs_probe(struct platform_device *pdev) return ret; } -static int pcs_remove(struct platform_device *pdev) +static void pcs_remove(struct platform_device *pdev) { struct pcs_device *pcs = platform_get_drvdata(pdev); pcs_free_resources(pcs); - - return 0; } static const struct pcs_soc_data pinctrl_single_omap_wkup = { @@ -1979,7 +1977,7 @@ MODULE_DEVICE_TABLE(of, pcs_of_match); static struct platform_driver pcs_driver = { .probe = pcs_probe, - .remove = pcs_remove, + .remove_new = pcs_remove, .driver = { .name = DRIVER_NAME, .of_match_table = pcs_of_match, From patchwork Mon Oct 9 08:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743093vqo; Mon, 9 Oct 2023 02:23:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjKqY3o37VsNwFt0cK5OsO7pypXyol1cn49agM9bMHcy+Md8OTV2rGLvmB1UVsFaay7UuL X-Received: by 2002:a05:6808:1153:b0:3af:7de8:ca90 with SMTP id u19-20020a056808115300b003af7de8ca90mr18964341oiu.56.1696843428856; Mon, 09 Oct 2023 02:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843428; cv=none; d=google.com; s=arc-20160816; b=yxklMNWFhCmsL3w3SMVWS4lcIrNMw1psKWrSZRB2BLKiyzyGkSazcan5kBT8pwN4gn 7awtAd5LrHmbIfKZ0Xyh3iFX7TkkgQ3EfLumhqOdd6AUevRCBmK9QqG6jzf6iXlTvmQ6 UYLT1fP9v28enC1UrqytyaW+7tFxtZDV7oj+zILMc9qTVmxqX0yajeB9PsvbxgCeowwM u+TiJVHOobMheHQ5+9jCEWRK3TpYQ4I4Ouxg67XA52BEj8+LxjY4tvpGcEr4FAITsWO/ xlRgwVP4/ZOlBNQmV77pcBCtaJNowCfVGzrXExxzM3lLyqDmmzHAsyH5NnWeBnXK1YBQ g3FA== 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; bh=4B9l/nApjamW0NhPLSo8iEr2lEBIIpdLx/ssCEKJKuY=; fh=EK0TiEPDXwQYjg/dVfVc6VtgpcdVGZXZkg01DD6Ny9I=; b=OIzdzyc2CpKk13B8U5F9v2pDk8MhrdBwC3uMiT5nFS6TuawYgEB4q4xlGuY5M1R8uB RfDzqLybPeYs9OJXEAhofhoQ4b79TMOh5pLQIswNuHs9tEe1AShhnG/fs90XjdPgqEjH 4uLUv4KU4yo+jLVrporWjY+rvd9lPxS1o47Vj+XMOsDp+Df7vK7ZtkYNAhqN5YRAmpd7 7emwVbc76pCZz3E/gn4tPRfS6FcXYpC2G3hlkpAK2wumYHoIsP2TdeNYgn8Ak8O0U+ez uvGaNY2cCtiIfXlUGj8LSnz4d2wRxPTseW5Dthf3qzfTEHBBjW0SbxOlvUqO0kJZ3noN kOyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u21-20020a63b555000000b005897bfc2ecbsi8298533pgo.205.2023.10.09.02.23.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8A05E804398A; Mon, 9 Oct 2023 02:23:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345763AbjJIJXQ (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345865AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6015C10E for ; Mon, 9 Oct 2023 02:22:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTF-0006uH-DO; Mon, 09 Oct 2023 11:22:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTF-000NX9-0B; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTE-00C4pb-NE; Mon, 09 Oct 2023 11:22:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Maxime Coquelin , Alexandre Torgue , linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/20] pinctrl: stmfx: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:49 +0200 Message-Id: <20231009083856.222030-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1870; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=PgpMnVQndSD56U26Qe9f+HDWSOr4u9++3LxM4ikfokI=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPXxTYpbahPY0vU5SKpNnd1LLWngypTvykl6VQwL3b 92rOS87GY1ZGBi5GGTFFFnsG9dkWlXJRXau/XcZZhArE8gUBi5OAZgI71T2/0mqOXml5U71y83+ 5QtO/ybMIN1Q/Kpu5roQhzqhieruz96ncFc1unAsXL7/9ZeuytoWT9YvaomGezbrXRT6GFx2SzK obD/Pu6MeE1gLZtddeOywgHm6cXzLnb7939X3c9SFmK8u+2y4dNI8rq9326eoLDs553hjocupl2 wOjZueGDy4rr01LSjIoFf1uYzRLcFplSeYInlNag5XeAULK37gnn7gtu+D8oBEo/sq3YdXXP5f8 CG9M6bqq17Km+wl3j36FV5nDjT/LuuyMnfaxP7qtt8jkRdy59P23uadXGjZ0GAv/KCq+j77Amfz tv5OgYNz1+fss0pU19aLbv3yod8ibzbHf16OQDVTkb0A X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:42 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269295076955207 X-GMAIL-MSGID: 1779269295076955207 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-stmfx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c index d7ab82432a52..6313be370eb7 100644 --- a/drivers/pinctrl/pinctrl-stmfx.c +++ b/drivers/pinctrl/pinctrl-stmfx.c @@ -734,7 +734,7 @@ static int stmfx_pinctrl_probe(struct platform_device *pdev) return 0; } -static int stmfx_pinctrl_remove(struct platform_device *pdev) +static void stmfx_pinctrl_remove(struct platform_device *pdev) { struct stmfx *stmfx = dev_get_drvdata(pdev->dev.parent); int ret; @@ -746,8 +746,6 @@ static int stmfx_pinctrl_remove(struct platform_device *pdev) if (ret) dev_err(&pdev->dev, "Failed to disable pins (%pe)\n", ERR_PTR(ret)); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -856,7 +854,7 @@ static struct platform_driver stmfx_pinctrl_driver = { .pm = &stmfx_pinctrl_dev_pm_ops, }, .probe = stmfx_pinctrl_probe, - .remove = stmfx_pinctrl_remove, + .remove_new = stmfx_pinctrl_remove, }; module_platform_driver(stmfx_pinctrl_driver); From patchwork Mon Oct 9 08:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742853vqo; Mon, 9 Oct 2023 02:23:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlPWnBTVsScvZTrMWjXbui7Aw8zD9k5KcPdwrcccLvUlTumOubAcmMM6lW+vniHAWr8Ue6 X-Received: by 2002:a9d:7c99:0:b0:6b9:bf1e:c141 with SMTP id q25-20020a9d7c99000000b006b9bf1ec141mr17422079otn.23.1696843391990; Mon, 09 Oct 2023 02:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843391; cv=none; d=google.com; s=arc-20160816; b=IXVDwUKMqNXnHUtzrOIiW4tZ3A2Zcbjj00+T8YYlr47WHXrzDry7BjYozH6xR0As5M aSd7AnW8feEQhxVWjRHXwftHBeCDTNFXCnHt9n0kQfEChsB1T/IHFU3XQG+SZKyBXvCy fIDgcpUv2mHJKulshrlqo66oZJbZFWv57Ubdr2wWxN2iZCTtTeMLxzRvrmnti+hqrEYi VwFbSHCeCLXaqh3B/BWwVFCJO2ZyZw6U16nR5PYBpBDbJ8qAiPMOk04krxfYW0DZcWp5 Ylec+AGcQlK0IVEWj0Y69T4pUT63nMME4PWmIrXHOfN5gseM6KPt31nJyJbVFFrUPPQZ sM0A== 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; bh=CoSTE5KQyTPVstIQRJOL+Jc1xZWQmMAFJC7f3niuXds=; fh=F4bs7feh0kNPfpkxC+XiThUexV96iac3bkIm5iNd+h4=; b=euzZ/pHmtPqzH1hXU40kwZtDjg3Gx8XRMd8Jg2Mh4XcZhgwlVIDggwesNolqLF16Hu c27TBmf6I88MX9HFAjfolU8XsKK2jyu0M44y6snVyRFvcA7THDrsZrMbNdBVcpNXrvU8 2yi5r7TFWTRzm6lLJvDpo3AqBRZL8SCiYmY82D+XWIqjWjWBMA93swDw9guTmoOrhkJ3 85uC6g9VzGC7a9JtGMWY9U/0PtI5PP78bOU/TYIh6IY4Yc9IjD1qYqHfUWahwm5i7zFa bRtA+odufajy2tHwP9/aWJ7zJiCGFBKMrwDZZGmII2Pjb0qpr8qpH5KqMB1sVPuQLt1i gV/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id w67-20020a636246000000b00581d45a5accsi6222356pgb.838.2023.10.09.02.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 6013A80B3B75; Mon, 9 Oct 2023 02:23:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345782AbjJIJWo (ORCPT + 18 others); Mon, 9 Oct 2023 05:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345745AbjJIJWk (ORCPT ); Mon, 9 Oct 2023 05:22:40 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C312C6 for ; Mon, 9 Oct 2023 02:22:39 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTF-0006uJ-JM; Mon, 09 Oct 2023 11:22:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTF-000NXC-6U; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTE-00C4pf-Tc; Mon, 09 Oct 2023 11:22:36 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/20] pinctrl: tb10x: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:50 +0200 Message-Id: <20231009083856.222030-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1762; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=DKr3s0/IU/9sggic3G90VxKYmkp4LOaBG2R8uqmIaBI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wPHaUEnsZbOMDT1bwDG9HhpL7Mrhfl6NcXM XP1WUpvkImJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8DwAKCRCPgPtYfRL+ TqOkB/4+mvvSTSCbIkonA1f363duBm9ycbAcAL+Qj6k7tBYZT9yRJi1bt8NK7NGDgWUOJRKVDVt iU29qId7bbp5GSMZsDVj3RCQVISSzx8K5mGddUCpF2HCbJ3GsMh2Y1nq6DeWLAy4qEYqp/8jUAo Kj6wLoJaD5pyOuDOqZ0AJBhGbmNlUQcNz0EWkeqkVT/LGyTy9Xc94XQZZ1vQL2+vdRinKxTRvnR TPNDuXVMA/cYQOUvAlmTVC20vg23+XoxtE2AIL4hFxRBuvBvcJcU44n0zQZ5MeLBdomrnV1ZRPo 633k1yS3UHwHRNGH5q7O7VW3j6jHRdGca620Oyg9s6g7fN9Q X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:02 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269256094059744 X-GMAIL-MSGID: 1779269256094059744 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/pinctrl-tb10x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c index ab49bd708969..c3b76e6511ac 100644 --- a/drivers/pinctrl/pinctrl-tb10x.c +++ b/drivers/pinctrl/pinctrl-tb10x.c @@ -804,13 +804,11 @@ static int tb10x_pinctrl_probe(struct platform_device *pdev) return ret; } -static int tb10x_pinctrl_remove(struct platform_device *pdev) +static void tb10x_pinctrl_remove(struct platform_device *pdev) { struct tb10x_pinctrl *state = platform_get_drvdata(pdev); mutex_destroy(&state->mutex); - - return 0; } @@ -822,7 +820,7 @@ MODULE_DEVICE_TABLE(of, tb10x_pinctrl_dt_ids); static struct platform_driver tb10x_pinctrl_pdrv = { .probe = tb10x_pinctrl_probe, - .remove = tb10x_pinctrl_remove, + .remove_new = tb10x_pinctrl_remove, .driver = { .name = "tb10x_pinctrl", .of_match_table = of_match_ptr(tb10x_pinctrl_dt_ids), From patchwork Mon Oct 9 08:38:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743203vqo; Mon, 9 Oct 2023 02:24:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH31EmIGAb7OGhDm0/Cqhg/OWco9UfAXde+Tap/C9a6Igfkn2Nd3gevre+V+pF/86vdAikL X-Received: by 2002:aca:220e:0:b0:3af:26e3:92e with SMTP id b14-20020aca220e000000b003af26e3092emr12278524oic.28.1696843443242; Mon, 09 Oct 2023 02:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843443; cv=none; d=google.com; s=arc-20160816; b=btcFKMWAaHC5OgfTIGwJ7m2VZ+rH/0NkHRS4SO1U8lTPOhn0wo2TPIqfUC2nemjcaa 2On0GvZuQAPyzWLWWWeAZ5NyWjM0QmO9yFkkSOHazLKSEqwjMl6jwAyF8hpSIG4Xr/hn Q4MUQ8b12uk61FBHV5OPieR/5Qle2lIlaguyi/WCU03gaaBCIrSDIkmJ1vlyyhGq1Jf3 ku6VmliswB5/S46meVHxaV9LawB2SK9fVdeH7Uv1QwCS9AEUjxM76hqLheQ6zNMf003U 6H0HkkZzctr8dawuV2ndRAS3Fh73QQdJESIQi0Thph8CqD1BVMtTdO7rOhh4QOMnjpK5 qpBw== 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; bh=MDpGHAJuRY+klY9c0bUokmXWkDt6lj3lHFCOoclh9DU=; fh=zglxO0SysMwVcCaNh/QdPA4BLju7R+eEhrAqmRT38Sc=; b=Fk/mi34As4WobJXmu0XOypUie+lhkx3oz9ed5DENkEKxspcZEKEmkVlDRR3d6rOQVi v2uhIJI2dAYl01MTAJSbSYYDqayyTpnIFtiNOzfk/L/8xaMohEAiC94/mX1yrZgcYKpM WPQ0yaLVEkP4uotY8MiAyYH2pjv3/NvZYkOwOUbM25Xpk6awLr+gGXl/3zzItpWdF0Kj v95vW7T0yQ+Lp+10kNPxYLpX4FMr8HjI0m00SuIKme2sNxP9LvI4vPy7mGzPqbXe43jR Vp20qzrHVSKUMQBJR0jPiwGjA3XyUJhOepQLACt5Aa2pjI3F8OiBxvvZBPo6zXYnhAWv EUrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id y7-20020a636407000000b005898e10f9c4si7193479pgb.203.2023.10.09.02.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3209F80BC3E1; Mon, 9 Oct 2023 02:23:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345929AbjJIJXT (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345892AbjJIJW6 (ORCPT ); Mon, 9 Oct 2023 05:22:58 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 635C0114 for ; Mon, 9 Oct 2023 02:22:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTF-0006uV-Pq; Mon, 09 Oct 2023 11:22:37 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTF-000NXG-Cw; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pj-3q; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/20] pinctrl: qcom: spmi-gpio: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:51 +0200 Message-Id: <20231009083856.222030-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1785; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iUS4SwEkb7r81ttsiZuCAWGZ8BPSgfZwboQcZSPLTn8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wQMOny6ci1vflQLeBPNgnGEOvIztvOzj2IO go4zjz8LpGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8EAAKCRCPgPtYfRL+ TqlWB/4icqIp1ueWLdYJ0x2M3biO6YlUZ53y9wFVw/r0HWXI3KfVN2PuVBFCBgXpHxAcQ/8x746 yw1fM8SiMBH/xSuk4oJIqkenN3SNZo1LdJRh1D9DcAV550NqhNOY+cS2Psv5VeSxT9BYb/BqEKl EnLZSSIG2lqHuv7eZKZDewzkP0tsLOJBoIQqoEQIps7nrfgwokxfv6AH05yCxDY4P7e75IARECZ eaBLe8Ybr9RrvVOp69tdQ6SDnYACvUbgFYRQDsGYfJlgg8oWaEsY3PWNCSmJV1c0II1djf9W4F5 7ux4ZDhGCgaDR90Gg1HoHUKVrS5yyFDBWkm8x+Ami2TztYzH X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:54 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269310703325928 X-GMAIL-MSGID: 1779269310703325928 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index deded9c6fd7d..f4e2c88a7c82 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -1185,12 +1185,11 @@ static int pmic_gpio_probe(struct platform_device *pdev) return ret; } -static int pmic_gpio_remove(struct platform_device *pdev) +static void pmic_gpio_remove(struct platform_device *pdev) { struct pmic_gpio_state *state = platform_get_drvdata(pdev); gpiochip_remove(&state->chip); - return 0; } static const struct of_device_id pmic_gpio_of_match[] = { @@ -1265,7 +1264,7 @@ static struct platform_driver pmic_gpio_driver = { .of_match_table = pmic_gpio_of_match, }, .probe = pmic_gpio_probe, - .remove = pmic_gpio_remove, + .remove_new = pmic_gpio_remove, }; module_platform_driver(pmic_gpio_driver); From patchwork Mon Oct 9 08:38:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743097vqo; Mon, 9 Oct 2023 02:23:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHuZ4Edq2z8Y9j1Smyn6WD2CS+gOgv34OuV3CocmERtaRlvYusLHjBpCybXhBsHua64Rlo X-Received: by 2002:a17:902:f7cf:b0:1c6:1c80:5663 with SMTP id h15-20020a170902f7cf00b001c61c805663mr11301208plw.41.1696843429725; Mon, 09 Oct 2023 02:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843429; cv=none; d=google.com; s=arc-20160816; b=v1fg9jitB4L9uYlcclHkfz8hhezcu4e6lweoF8n8ZpzEF5owMC4+1OKyiVv24rFD3G gobsrpH+al+IaDMXWm5T9cX16NHxlh6GW8SXnzD0zypQsCYj+mW1Jf056L8OLZYkKsz5 Zu1eqB3SLLJInCS9MsJ//r2AB38QvbsoEtZgItkszv/rNFDZoPgOa+HN/8DW/4VbadE7 abOuoHpcsuJJqflkPm/9OmTg/uu7jiD8p2IYJ9dcMExuMKwuTbR+hxoSW8pmDdpSTbLq JukgYBfPZoTAW0wifbvExS6FqdDZLtGm87m13EA8qudz2oq7BeRn4NXuA6U9khU33qK5 k5Cw== 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; bh=gtgfj0/LjgH9DduxeSeeg/RL4tBaBFgtQ54zEaWaiUg=; fh=nnDpGuzKheoGLVJuCXVTzLE1MC/9svRnJkpKrKOI+9Q=; b=oB/JijNq2JB/2/ODiA6NZK+0yNzzGCmtSeGzUs5gqe5KOFKv1OXUMoCzu1e9/wOt0Q N3QGmnOX2QgDxh2DftSOy2jW0LQ9MZ3j+bVl44FBsqRCNVsWmbsF133WFbIGao4fj0oM eYkrmJTPIdSLWOFX02Nq9x370T/jXBbD8P2CE9rCiQV/S2dqbLetPKqWXOcKclkhuWN9 cjsdhvv94zuv8Raf11I2r/3a8fDq5B/Y989HLn8WedkZ0cQvLddNXXY6iClogQdu6bmb UthYGnpBendXFpu5krSmf12Ip7YUCCMjkLLtGPfNezTnY0oCpbT7Wbboo5x5WRnZh/QC ZrGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id ko16-20020a17090307d000b001c7361b71c9si8981860plb.114.2023.10.09.02.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 379D9802122C; Mon, 9 Oct 2023 02:23:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345943AbjJIJXL (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345857AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3240110 for ; Mon, 9 Oct 2023 02:22:46 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTG-0006ut-2i; Mon, 09 Oct 2023 11:22:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTF-000NXK-Lv; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pn-Cm; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Bjorn Andersson , Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/20] pinctrl: qcom: spmi-mpp: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:52 +0200 Message-Id: <20231009083856.222030-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1767; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vzs3F7Uou+X3yMekBIMHBzYB6Le6JQJjl2rEX4wo4hk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wRHdTZkFmrB0K1w+Co1UvRWrgd7FyRrKniw iSqkGIF5ZGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8EQAKCRCPgPtYfRL+ TllIB/9WEsCcLEKVnpUUTRCZBVoZtnBzyHbwYc5LVGsiTRl5TWNsYW0ZXAf4mRAud4cANi6doH9 GAn/d7W3siShHXxsPQFh3JUfURELWF0mUQCP2JiVT3sE7sGlIEa2+9zOiQHgLJPKesRaaHGd4lb zZWFIRJoTlumBk0/QmSrt2rEiW+CHaz8gDcZ2gP7r8jcwsYROmcVOoeQAL/p7fOPgbDvwDNpb4T n4sJJKNLX7Jvn3JFWrQUP+03db/VpQipjk2E8MVVARCY8rsqZnxMcKr3H/ji+0jN+L9smcQEJCm IIO+Pc0z55LK95bmF4l7EpLeBR/FTvvxaCKYNS4ubqApR0Qk X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:41 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269295849490344 X-GMAIL-MSGID: 1779269295849490344 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index fe0393829c20..d16ece90d926 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -971,12 +971,11 @@ static int pmic_mpp_probe(struct platform_device *pdev) return ret; } -static int pmic_mpp_remove(struct platform_device *pdev) +static void pmic_mpp_remove(struct platform_device *pdev) { struct pmic_mpp_state *state = platform_get_drvdata(pdev); gpiochip_remove(&state->chip); - return 0; } static const struct of_device_id pmic_mpp_of_match[] = { @@ -1001,7 +1000,7 @@ static struct platform_driver pmic_mpp_driver = { .of_match_table = pmic_mpp_of_match, }, .probe = pmic_mpp_probe, - .remove = pmic_mpp_remove, + .remove_new = pmic_mpp_remove, }; module_platform_driver(pmic_mpp_driver); From patchwork Mon Oct 9 08:38:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743457vqo; Mon, 9 Oct 2023 02:24:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFH2F8PqD8034kW50OUtte+rnk1+exMFLW2iNRN5I99fDfBWbDswVTGGGjRb9MOR3gJE5Tt X-Received: by 2002:a05:6808:14d5:b0:3ae:bae2:fa76 with SMTP id f21-20020a05680814d500b003aebae2fa76mr19361694oiw.36.1696843492176; Mon, 09 Oct 2023 02:24:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843492; cv=none; d=google.com; s=arc-20160816; b=owuVwvxOovdqWkVEUwBye3T9dUgzyaAHr3slNBF97hD0XHLD4wkaWb53pViAYeuRG5 Yux5tSRjFWk8RL7K6QAnBAh3t0h5FihHGqNwbj0oweZ/KozrDay3jxBZoWrQogIMdpV3 9TatjlXDbOWfP4vKx7Un/SZxFQ1sOhlgEET32bPvutlP6fxQgdo5T62dwDgbg2oLU2Dl ipAOVcnbioKiFfPFz4sHjRK3k7UkTpSQiCa/s0+qXmoZ32S/kyFyFM1rehBYjGDaLVPS zynfLvgW6W18umb8cfrocrmHx+SUhxAp+JvXIU+qTywuj7l+qUNCM1QFH9s1f/bKuJGG Lf3g== 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; bh=gks3CMkH9nIYBuGRNHQry/Z+95vzQcihfThuUkjeDUg=; fh=zglxO0SysMwVcCaNh/QdPA4BLju7R+eEhrAqmRT38Sc=; b=X1kZ+DuzhUX174VtKgYhro5I0lMiBgMwf9G4Tft8qfLjLvKG/OXx7R5HS2NDWJDF9N iL7pFKxPQ/HCYeooTlHm/esLBRqTNRcnwqHRplHL41fyaNmmyWuEqEWbREluTKk6VAal OQh7j0GOAqTEyg/5dMUqCKI0msEws5bEVjlrXKlFp4Az6rh/aetSeO24FQ4intTEpnQK 942uYrvkNw0egCBu82viGqYX9qiOuD6bjPI7CZsRr4sbLCWYBm+9tZTEJbU43Fl1Ss0K i1NjfsX6kEj8wzZ/9YHZf5NJVKnL+nM76ukaK7+OT3EPS0kbFX5NPdjAg2Cc0f0ZkrPV nDlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id m1-20020a656a01000000b00584ac83e108si10246529pgu.729.2023.10.09.02.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7501080412C2; Mon, 9 Oct 2023 02:24:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345880AbjJIJXi (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345820AbjJIJW6 (ORCPT ); Mon, 9 Oct 2023 05:22:58 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B180711B for ; Mon, 9 Oct 2023 02:22:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTG-0006v1-9I; Mon, 09 Oct 2023 11:22:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTF-000NXO-SC; Mon, 09 Oct 2023 11:22:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pr-J3; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/20] pinctrl: qcom: ssbi-gpio: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:53 +0200 Message-Id: <20231009083856.222030-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=28+bfS44N/MplXkQ7tL5fBHkxWSovei9m4bBOfdvZTk=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlTlPUJPvnCdeSfEnPErd++MeYkb5cx7z6wPNfmsceZA8 sJ5TXWBnYzGLAyMXAyyYoos9o1rMq2q5CI71/67DDOIlQlkCgMXpwBMhDuNg2H6bZ/Lv1JijevK pfJzzhk94p528L3dxQ5T+TPMi0riq9kPCdm8LcwxKS1g6Wt3uWB3l9PFvz1i/7p53CLxmSxP5+3 weM2bNH3OMlOZSebbTTnWFU8P7Dn/cvnGdOEEAY98tkQ36YCXdiK9Lq+q1Ux+TH/kar6VLfKTQu TTJ5sn31bOuuUzz5O5VIfTuKGsT6e+IfrLxAQVcfMn5SnTNJ5IK6TU/T4xq0VbuKU6v3OmTG5r/ ox+u0V9Si+51QNK2Bp7w364uTMWvNJIrTKdcslrWv9DnVO7/HpPbih9zXb3seDPQv7PfQdO1bvM CZz8PUo+6NDvrT9zIpl/CfxdI/pUcd/Vzhz72T/M1i0FAA== X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:47 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269361835312794 X-GMAIL-MSGID: 1779269361835312794 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index e0d43d076c01..9cd5247ea574 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c @@ -853,13 +853,11 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) return ret; } -static int pm8xxx_gpio_remove(struct platform_device *pdev) +static void pm8xxx_gpio_remove(struct platform_device *pdev) { struct pm8xxx_gpio *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - - return 0; } static struct platform_driver pm8xxx_gpio_driver = { @@ -868,7 +866,7 @@ static struct platform_driver pm8xxx_gpio_driver = { .of_match_table = pm8xxx_gpio_of_match, }, .probe = pm8xxx_gpio_probe, - .remove = pm8xxx_gpio_remove, + .remove_new = pm8xxx_gpio_remove, }; module_platform_driver(pm8xxx_gpio_driver); From patchwork Mon Oct 9 08:38:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743334vqo; Mon, 9 Oct 2023 02:24:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLxYkdMZRHzo1FMueKCL4tBKpb+bSbdiY6qVYimmKR4NL5c+GivrCE+wMUL7Kmcfdxl41l X-Received: by 2002:a17:90a:4ce3:b0:26d:d81:82fb with SMTP id k90-20020a17090a4ce300b0026d0d8182fbmr11050549pjh.29.1696843468459; Mon, 09 Oct 2023 02:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843468; cv=none; d=google.com; s=arc-20160816; b=Kz9glTm5mY3XF4Yy7tQx2y+ndDdV9q58UuUfSloxP7FS16zjjqOs4zSfKW9oZv+v4M 9+Mj5ohTIMJqbLNqJJG17G4rxUPAwa1+b3B8cBRxDvmVKlsVVVhBCTrMqQnEU1KMQ2WR /HIfpdwbVn5WE+3EyPiRkrRLYUrD6N3Pw7NuFXIId1su1ahw1g1ms7lSE+mS3H4cgnNJ B9GKsWu67c4KCTo3uVwGOfD1FSPHypB18ahh90zAb2Gcxbg0O1qBf1fl5Z8Jg3D02Gr9 GxJc92haifRMmktziq3ukkh7X2g0yedBN0Nt3DrfBNER4/cjHUeThmc7IXZYAih5BdBI 5DDA== 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; bh=qIhcd2jLjlkXMmnm2hmwj8HLTk2NfhSVbGLyOMVNE5o=; fh=zglxO0SysMwVcCaNh/QdPA4BLju7R+eEhrAqmRT38Sc=; b=CYzo+sjsLoOhAxC+JngghTIGeJz/RUE/8LAQxNcIeaBhAozjHQyIghFrgilH6D1XMv IHEl4JguGAdABGrD/GVIAtNcbS9/3FdUeqpZrOnVZ+HN5e0ecvfh1iAE9rfuV070uN3d xLPhbXOppjf5VSqFl9f0KZdUKL5EMBWGV1uW5IpbPLIUvG2vjqDd+P4C8E8vWlVBb7EV BCjhte1VPP1PN7pPWzSDBcJn1Zo72TkWZA/Anqp/dVrXNULPRv4GDWoXwodyYJCPJJdx 6902Z+Jnpiaq2FLISaHm1i3IVhWbZ60MQWJQog+nk8y255tHEScfPvYr8EfCQohejWJX 8/ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id il9-20020a17090b164900b002772f04f9bfsi12503249pjb.113.2023.10.09.02.24.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5A60F80412E6; Mon, 9 Oct 2023 02:24:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345623AbjJIJXX (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345893AbjJIJW6 (ORCPT ); Mon, 9 Oct 2023 05:22:58 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 241E3112 for ; Mon, 9 Oct 2023 02:22:47 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTG-0006vI-I4; Mon, 09 Oct 2023 11:22:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTG-000NXS-4q; Mon, 09 Oct 2023 11:22:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTF-00C4pv-S1; Mon, 09 Oct 2023 11:22:37 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/20] pinctrl: qcom: ssbi-mpp: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:54 +0200 Message-Id: <20231009083856.222030-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1775; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=SsYV2sgsr7TRLETWckrWLWBbUnJpb3Z9p/eiCeOFjYo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wT3rSpr1DOqqnrcxvuvs6vVTLJ+V1OTMu3R BiQ9k2k4wGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8EwAKCRCPgPtYfRL+ TufRB/9rDhQgknJt/0gZukbSFaLF3GDSd6FbDP4NDJm/W5NtDI6yBh8sVvW+ipkChaYtBTlYuMJ CyRf5hTQyXEJlTUEY2sAvNHTakFfdiD8e9m349Rqec+HJN6Pmt5PAQFrJkwq/ki/+Aodp6pr9wG /sjglQ4RUhcpcbsxaAZs5HR9FG6twy1HJ53gx5cIipuOvnNjow1WVxoUIBMLHDN3jBC52VjvL+h 0sVOeA5d8EDbHJ+AdWHFSzR5Y0iLTX6gGTPstwJvjaZ4SKxyrcH2hxGKb33DeeQYFECAe2c5F0f H4Cvqij42TB0aicPrqkL2C3Gg2inW3TtF2K/vaR10wZ31rEO X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:20 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269336644319188 X-GMAIL-MSGID: 1779269336644319188 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 985d1a0ee8f8..3aee6835a2de 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -936,13 +936,11 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) return ret; } -static int pm8xxx_mpp_remove(struct platform_device *pdev) +static void pm8xxx_mpp_remove(struct platform_device *pdev) { struct pm8xxx_mpp *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - - return 0; } static struct platform_driver pm8xxx_mpp_driver = { @@ -951,7 +949,7 @@ static struct platform_driver pm8xxx_mpp_driver = { .of_match_table = pm8xxx_mpp_of_match, }, .probe = pm8xxx_mpp_probe, - .remove = pm8xxx_mpp_remove, + .remove_new = pm8xxx_mpp_remove, }; module_platform_driver(pm8xxx_mpp_driver); From patchwork Mon Oct 9 08:38:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1743289vqo; Mon, 9 Oct 2023 02:24:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWeZkgCuqOqLq+71iWJIQRejIu7G2c6isAGn5dXZf78rRIIPsgveikPn0h+nqTt2NWpB85 X-Received: by 2002:a05:6358:716:b0:143:897e:6e31 with SMTP id e22-20020a056358071600b00143897e6e31mr14324883rwj.7.1696843457542; Mon, 09 Oct 2023 02:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843457; cv=none; d=google.com; s=arc-20160816; b=zvTjdk0YQq5FYLHKNN9lijqpDnlFnJtDUqhnnZ99f1RXso5Oot8PWm+DC0FurgiIMD CxlRBiN6xy9iAcMohsbimz7FeW1EkUvi290FtzkCQY6QJjwD+2luFrx+zLdcX0TzFJyA hzZGu6p+09Qz3ztszkSWBlc9HasApseTyLyuGOrJEdqbfRfYPDOKlyvIfYX98LWIAOWU lCdRylNny2JQx1YDDZRrnJUfI9EEb5bGEsmfXapW6RCze/imINvWzgHugb8Oq+mArQ+j dF8lxycKe9ET2JrxBo0dQRAv5cCV+umuHQbKO1dkAVsPbBOcGlavFz8eopv9T1QDgTSe dehA== 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; bh=9+90J/YgwfwNaoISZpHstdUzTATjXlZS6/Vw9OFwdFk=; fh=hA75HFj+zIdzA6YffrcMOu+1VJ4F8I2bKx4Cb/dHtpU=; b=QkcomJ525B+Kwozrq0ex/E7AvUSlcEq2oon9ITMQh8D224E3dy63vK4KMcpNoLw928 zd2Uh61117wjZ5hHzCnYCjPjgk2LbAf02HqEZ9YcqxAGxtprQZoXMqeuh26u6Rq5er8b TWAREY7ZcaC7mKYMPVIt4mSWFco+KVT1PBEC8il9qNdWgNcEIiyu5zmIXMoJx+UELmuM BL0xtQgamBA5j5wNCEspgy2W8k75f3HYIM2AWObyank5LrRvoF8q87yXCRBvW+QFURTP 1YHfByZP587K4AfyOegJG+OhR8r5lXmU0lJEcYStWLaKJJvmkSr4IVEdnf5rShl6Y7a0 dREg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id s27-20020a63925b000000b00573fc592e9dsi6025534pgn.848.2023.10.09.02.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 123D180D2E67; Mon, 9 Oct 2023 02:24:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345995AbjJIJXo (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345849AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73335101 for ; Mon, 9 Oct 2023 02:22:45 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTG-0006vN-Nr; Mon, 09 Oct 2023 11:22:38 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTG-000NXW-B7; Mon, 09 Oct 2023 11:22:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTG-00C4pz-21; Mon, 09 Oct 2023 11:22:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/20] pinctrl: renesas: rzn1: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:55 +0200 Message-Id: <20231009083856.222030-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1830; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=whu1K3F7uiPsNXc85/ItXxw8lSWdHF4ifU6FSRE1eb0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wVKp/h4ZmXafNql0+fn8GJ8n3xLvUqunKyn 9hjgl1/LeSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8FQAKCRCPgPtYfRL+ Tno+B/4x6SoP3sqUW0skGY4krgmujz6/rJAcDeQTwBv7ti5toHbjFhYFTeyZWzj7JoS+XzO+pru EtVB6g8xRdV8pO8+t8pgjnNzHsNl8yZazWPyuye9g5D4pmKhH+yPlMBQtX3bua5Mqznb4tcc7nK R9I449F3w0NToI7rCRiNt/eEs1One16x8nDJfjH68YDJA7OsXH5Vi4k9m6tYwQxkpwOl1sGMxdh S/va6B43w9zNhP8dfWM/7q7Rpy9P9FAUfhAo4DYnwm5eMSUdXaKbeRSkiJT+pGtSv5o9PyTZPSY ewklrqHyUZK9oPohr3mtuZFOdwBYbxwipnmeVxla9eKGD+PB X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:24:06 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269324961248604 X-GMAIL-MSGID: 1779269324961248604 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Acked-by: Linus Walleij --- drivers/pinctrl/renesas/pinctrl-rzn1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c index 374b9f281324..4b2f107824fe 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c @@ -920,13 +920,11 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev) return ret; } -static int rzn1_pinctrl_remove(struct platform_device *pdev) +static void rzn1_pinctrl_remove(struct platform_device *pdev) { struct rzn1_pinctrl *ipctl = platform_get_drvdata(pdev); clk_disable_unprepare(ipctl->clk); - - return 0; } static const struct of_device_id rzn1_pinctrl_match[] = { @@ -937,7 +935,7 @@ MODULE_DEVICE_TABLE(of, rzn1_pinctrl_match); static struct platform_driver rzn1_pinctrl_driver = { .probe = rzn1_pinctrl_probe, - .remove = rzn1_pinctrl_remove, + .remove_new = rzn1_pinctrl_remove, .driver = { .name = "rzn1-pinctrl", .of_match_table = rzn1_pinctrl_match, From patchwork Mon Oct 9 08:38:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 149902 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1742969vqo; Mon, 9 Oct 2023 02:23:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ9HOEuX5Mo/A4ncnsL0bkPZQdrhCbahATKbWCk14n2Ks5xC96orsATymn1hfTRpiqjMxI X-Received: by 2002:a54:4519:0:b0:3a7:7d4:4f91 with SMTP id l25-20020a544519000000b003a707d44f91mr15919882oil.14.1696843411926; Mon, 09 Oct 2023 02:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696843411; cv=none; d=google.com; s=arc-20160816; b=LGJAGspJOhmA/suexW6O278Mdl0vaDB3tJUNCnnnl1oKNyIcawutYheENjay8OKE9O RHoV/c3X2n5veCq22PRoaHS3kIQaOjjcV4ws6R/Bmpd+UkgLuhMoHdbDbbrrFfxGOKRo oPGvy+X4LafrrIX3LJ13seXAuNVUlWiHdjnVf5xpb4pQBGxlMDu6TZaKWeoT4NBj4/NF Oj8IESCQeWzxgz3LxIhQcihmFZSQEaszRHrVmUPjqpBG6RfZlFPPgcwa4r4KlM5wTtVp /Pio6Qm6PJpT4IdxIWFqjFdI5PldfS8dZhGYQDEhB2EMz1+OT67T9shyn6D7pZIezBcm klDg== 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; bh=O69/phDxrAUF6Y0wyv9PBVaC64eppg5/JxRAnwgC4P4=; fh=YDRVl7Ox4Q4QAKz3wG9riYJ2+Uc9K6DH1jNyaPMUBsU=; b=HX4VyfQY+tWaY7BkIaHvjD9BXCKDHJVYVy5Mlz0yrGmtlARKc3tlgEFoQxD2hg0Xha 2VhBYIBjHwYzSteOIJ1Cucpni8RrSY/O1d9aLcPuMyJ9uE1/uGqqqHpnTB0vaQqZMnO/ YW2jj67Ch4GSgyS2FwoOuV+TzRDjo6MUpDKVAu0eQh6AOTU9Gqoj2afBpeJNrsXRjOyG lVmXF9NVy11SVghN+6nH0IFGI+D+HGXYOUqgwC/cyauOHaHH4QRmxpfzgU+GHnhkVrFQ 4b7KmQyKu+Stl1N+aH3+1kRCXzFcB0HObHa61UMzoECL09Gz0G6nZcv49NriwdiO+Hql WM5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a21-20020a63e855000000b005740ab95917si5569441pgk.45.2023.10.09.02.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 02:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 0443180569AF; Mon, 9 Oct 2023 02:23:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345846AbjJIJXI (ORCPT + 18 others); Mon, 9 Oct 2023 05:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345834AbjJIJW5 (ORCPT ); Mon, 9 Oct 2023 05:22:57 -0400 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31BCFE for ; Mon, 9 Oct 2023 02:22:44 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qpmTH-0006vZ-4e; Mon, 09 Oct 2023 11:22:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpmTG-000NXa-Ht; Mon, 09 Oct 2023 11:22:38 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qpmTG-00C4q3-8r; Mon, 09 Oct 2023 11:22:38 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Linus Walleij Cc: Yangtao Li , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/20] pinctrl: ti: ti-iodelay: Convert to platform remove callback returning void Date: Mon, 9 Oct 2023 10:38:56 +0200 Message-Id: <20231009083856.222030-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> References: <20231009083856.222030-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1968; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=E5trTcRoNSwSyEuUHcMDaOFkPpFFcP6BQycpHwUzrnM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlI7wWYc+w238a15MR82zLPaznFyBypGE4m0Mmw nFuEvoswv6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZSO8FgAKCRCPgPtYfRL+ TlQ6B/sF69klNLh4E/ZW1+7VqRXSYhnFlh058WXmc5u+eyGTwVlcZveJj5Wcq5ZnMF4YQlwlnvu egigIqMUrsIX2itLv/9KzyKGwhpa8gc0K1gbHgO+ONIXeLh/3zZ356IqS7VhyHqlLbTAg1Lhdk3 9gsxd752UUJ2Dy0mCWNK4ac+eUnb6UWjKF5b6xeUxai2NtQT6hDFOcgyEhOqo+5k8NygG5ZleZB FQGLsYAafpXpagasU9NInkHJge1t5QTrWwj4AAFk50ounnR98wsW/Aw9XLSM1L5GuvbkOTiUFlQ QeXRcTCQv6IjBJI8MKFj3K1DBRaZ1ZpkyS/Vpdviq71he9oD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 02:23:29 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779269277031231060 X-GMAIL-MSGID: 1779269277031231060 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c index f3a273562095..0ac2548ca68d 100644 --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c @@ -896,10 +896,8 @@ static int ti_iodelay_probe(struct platform_device *pdev) /** * ti_iodelay_remove() - standard remove * @pdev: platform device - * - * Return: 0 if all went fine, else appropriate error value. */ -static int ti_iodelay_remove(struct platform_device *pdev) +static void ti_iodelay_remove(struct platform_device *pdev) { struct ti_iodelay_device *iod = platform_get_drvdata(pdev); @@ -909,13 +907,11 @@ static int ti_iodelay_remove(struct platform_device *pdev) ti_iodelay_pinconf_deinit_dev(iod); /* Expect other allocations to be freed by devm */ - - return 0; } static struct platform_driver ti_iodelay_driver = { .probe = ti_iodelay_probe, - .remove = ti_iodelay_remove, + .remove_new = ti_iodelay_remove, .driver = { .name = DRIVER_NAME, .of_match_table = ti_iodelay_of_match,