From patchwork Fri Mar 3 17:20:12 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: 13159193 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6879C64EC4 for ; Fri, 3 Mar 2023 17:31:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=djRMkC1zGgE1Gd9uQNseRglUu0sjUBOJNUbPpFyWTrY=; b=n7L/zR8w7ufs1N BZWVJNo8zi3O4AwmM4KQnVRz9hXNRWhAo2/3+BNwK8ixGwKBnK1PlgEpa6Rn6Bcqv+aPH+vcMJYLE SaYL1vhdSCc+vv1S03ZD7Mq21eKZjRBHm/ZfRBldrswGi/HsChpULKAcD9TbnxQoVKFbBZkPJ271l ExjCRBy50zbfCrkv0HJJaDNlC2ohXftHTRYiATjeq1kawjFBgvksfXLJDFgUWCD0H5dRA8Bssvzld 6DJ+eYbc8EPI/0v/z5lHUpBHe4I5mjhQKzIuNbNHaV+5zelb/GHv1+qa8sohWHxABignzjCcueCnF yno8vpKtFdWq6hh+l7mA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pY9FQ-006xzb-4i; Fri, 03 Mar 2023 17:31:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pY960-006tFe-3c for linux-rockchip@bombadil.infradead.org; Fri, 03 Mar 2023 17:21:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=+XZIihPAZWmJPi7uAj2lm0bHI9d5NzrTphb9A8dxRrc=; b=qwHHkO+pmcYR3MvkPHmHa03Jsz 3M20Vfs6h4qGoLQ5VX1N0Vf7mMatcmL5iUOvriLLg0Xd6aIRbAc3E+RNYc0gY8tn0Qt+SWDNzJYQn Qjdhd9KXzC+v4gc6QDjwL6nrRTdsjufh4oejlGC+CNl6RXeCQ4ItE/83G4CBo9EiyaDNv+3eilbFE 5/ySt0Dxj1wr5X/r/pEdVbS4hDeo0E2uuJoRXwYvWdDD0+YL/ZqWerTVpPJMcbI/JM7+LU9cP/+aG 25TczKR3CZvhtzECxb5FoAd7utOIMyP/aB8nkHnBV+lMBv4QA9nPkguhkt83dAVtcwfhVWy3CBhDc NlhsZH7A==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pY95t-00FkTd-0x for linux-rockchip@lists.infradead.org; Fri, 03 Mar 2023 17:21:26 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006yR-QV; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bn9-M5; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlY-Jf; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Heiko Stuebner Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 58/87] spi: rockchip-sfc: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:12 +0100 Message-Id: <20230303172041.2103336-59-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1816; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=bX62lV2TXhh+Chr6nrCmzfML6Z1r56z5yaVi5PzLxgA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivrj5tHxRTJlYZlxWo0q/BM24wM1jynBx/c5 uaQAIHVd/OJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr6wAKCRDB/BR4rcrs CZu3CACfuE1Q77oNhvmLE3bTfyqTKU1HGoOxSnsSfbLWeiTFpbR/XRDXh1thy8s0qRpJmxVySx/ N39A8idBKYGWHpgfkyIwXeTx4owGnrUL85wJTzzObScztrImSWymvOHuJHinVigWiXbXN0XFxmT UNa6A5Hs1oPk5pk5/XN8QGCagstBYSPCeP9pZ5nObujWvuAywQBSSPcIUbkNSGe91uH1f73VLeM Sdq7rwk1zLrioymoaIw1clRQnrgxnp2cL0/oFw+MvwQ/KGyujDWCfdgasdeD/TWgAtW+XND2sww Jt92SNe+wj4ovzmxSdVYpD6g2qMBLBWnZEkfpNcoHaf9xUUe 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230303_172121_622556_808D5777 X-CRM114-Status: GOOD ( 15.77 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 (mostly) ignored 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. 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/spi/spi-rockchip-sfc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index bd87d3c92dd3..80e1ee110d31 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -656,7 +656,7 @@ static int rockchip_sfc_probe(struct platform_device *pdev) return ret; } -static int rockchip_sfc_remove(struct platform_device *pdev) +static void rockchip_sfc_remove(struct platform_device *pdev) { struct spi_master *master = platform_get_drvdata(pdev); struct rockchip_sfc *sfc = platform_get_drvdata(pdev); @@ -665,8 +665,6 @@ static int rockchip_sfc_remove(struct platform_device *pdev) clk_disable_unprepare(sfc->clk); clk_disable_unprepare(sfc->hclk); - - return 0; } static const struct of_device_id rockchip_sfc_dt_ids[] = { @@ -681,7 +679,7 @@ static struct platform_driver rockchip_sfc_driver = { .of_match_table = rockchip_sfc_dt_ids, }, .probe = rockchip_sfc_probe, - .remove = rockchip_sfc_remove, + .remove_new = rockchip_sfc_remove, }; module_platform_driver(rockchip_sfc_driver); From patchwork Fri Mar 3 17:20:13 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: 13159194 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E6764C64EC4 for ; Fri, 3 Mar 2023 17:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uDya1apNhrDq9WbUfue/M1SMhvV8lEt5FYQPbjVjlm0=; b=pq/7gvBs8CZOti mr1n1IxdU4ebWd5XSjjeVXifYOdWbIiqHYGm6H8aYwh1WxqBjHW2xcuq9rvvCEqPmEu6BYsGoNpQ2 JWL/2sizof+Bx06l0YkgRTZrCVbKHX8ZRItIHvuUJttJ+KGGODJclgIkTnLEFX2kGCofPzp3nJF9H +tbIqwFMkIgGScXrLsOTEkAm2guPZX/hw/j4i3AlMWx1TefL6PjCwD0Py0P7Ku8k9UjNZmd+wBVHS v1edqcJAp6CfYw3EfJw4KOOuQJOyLlik7ubPAZWqsQd64JTJNhqOX1hewxEyOV/FZzpYynzf4Sbx7 nVLqeWfF8s1nlxP8BXLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pY9FN-006xyV-Oo; Fri, 03 Mar 2023 17:31:09 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pY960-006tFd-3c for linux-rockchip@bombadil.infradead.org; Fri, 03 Mar 2023 17:21:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=egPtZ3+/WmN0KpDUAKntc6mGSM0sn5nk4DEElLm3qXI=; b=aQ5LTIwtlehV9EWmxOnZbtLfsB x5owPybIoMPVuB/MFM5eDTOkWvs92724eULcHOpyNBP0U8gmaksSL+SVTfWWTI3TTnl7/Rm8Oc0RY mLyWxTmw3JhiP4R6g7cwnc8PZsSbYC+nMuzzuLf7xrPcYa4uLiNcRUqekcF7x28nOO7sGUcPRemzI 9zPrlBnmVGTlFZCnvZdrwH/tcpAWnIchDmwZCDvxkdR8h3CjAqG+92UTfofYpIJGezjlgT/6SZtG1 p6KvEtshlAAM1/qv++O0D5TrlConaunxE3oSOTAtytlKPhieG+1oWSOM+6AEcXDZI/5te5i8b8tit 9soDa0zQ==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pY95t-00FkTj-0k for linux-rockchip@lists.infradead.org; Fri, 03 Mar 2023 17:21:26 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY95c-0006yw-Mb; Fri, 03 Mar 2023 18:21:04 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pY95b-001bnE-QV; Fri, 03 Mar 2023 18:21:03 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pY95a-001tlc-QN; Fri, 03 Mar 2023 18:21:02 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mark Brown , Heiko Stuebner Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 59/87] spi: rockchip: Convert to platform remove callback returning void Date: Fri, 3 Mar 2023 18:20:13 +0100 Message-Id: <20230303172041.2103336-60-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> References: <20230303172041.2103336-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1800; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OmQ12uht8IWlDyauzXhSL2XViaI0ICmiBz/+eTBWyf4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkAivwwXz9uomS2WWf/vdPN4WnOrhcDT0sutXWv xQEsEcj8FWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAIr8AAKCRDB/BR4rcrs CchTB/9Cy3Sbh53UV3ob62jodXiRh/CIKWsQH9D12P9G+M+z5/BfO5xRodY6wK1kS2klGV6tbVG l9d1DMjddgR8KSpou08TP3nI/LOrdO5xNr/jO7jEscJ1smQT4PBTw3386tOg2F+t8Xl3Q3yiHlL ueO/4tjj7D0FYYpTn5qXoBT1L2NBmPvU7k0KHetB1715NmZCPoK7amCPDmBHoEpH3mIx5B7E8Fg IeMQDqHNZKZ8+JVegL/YYkXbUYr+qbh4VpYkchuck8ikPngQwnVCtH61xnwqj8ll/5G3lQXMmMu qpDC+qYlMtVAkmrf6AWfKnn5G9zawZtJOvHV3JnbrD+BEEOn 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-rockchip@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230303_172121_378142_E96E0174 X-CRM114-Status: GOOD ( 15.40 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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 (mostly) ignored 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. 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/spi/spi-rockchip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 79242dc5272d..8888a5ff7b2f 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -947,7 +947,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) return ret; } -static int rockchip_spi_remove(struct platform_device *pdev) +static void rockchip_spi_remove(struct platform_device *pdev) { struct spi_controller *ctlr = spi_controller_get(platform_get_drvdata(pdev)); struct rockchip_spi *rs = spi_controller_get_devdata(ctlr); @@ -967,8 +967,6 @@ static int rockchip_spi_remove(struct platform_device *pdev) dma_release_channel(ctlr->dma_rx); spi_controller_put(ctlr); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1076,7 +1074,7 @@ static struct platform_driver rockchip_spi_driver = { .of_match_table = of_match_ptr(rockchip_spi_dt_match), }, .probe = rockchip_spi_probe, - .remove = rockchip_spi_remove, + .remove_new = rockchip_spi_remove, }; module_platform_driver(rockchip_spi_driver);