From patchwork Thu Nov 9 20:28:34 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: 163580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp690368vqs; Thu, 9 Nov 2023 12:31:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXrxJdikWAsxHxWOwUxf6lFKQ4px2MqVMXfQac71mdOQAyUiUE+Yr/5/aVW92GqU/2UiDO X-Received: by 2002:a17:90a:e7c7:b0:281:858:a086 with SMTP id kb7-20020a17090ae7c700b002810858a086mr2769028pjb.6.1699561896112; Thu, 09 Nov 2023 12:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561896; cv=none; d=google.com; s=arc-20160816; b=gQooFVpiIo95byX4VKkQTMdAabH+fThJR92TJGjc0zIpfCDr7d8czatbGRxX5arJKT yGex+Kjjm4yo1AyyMvrS92py3B+q6KE5Rstk46rTcRGHiZH7pnxFpNVuuBAVrvTwIiCL 30FxjtrGDo6N+rB6QIwNnCQkolpxUqc/drD28flpSFacYlKDVEb4wbvnA4nDbeKI4+JT E5Tudevz8fFwimIcCdf6bi3BaX0kMuu+cCvJarF9zJSUs4IcWRHEnwNw4D3ptb+DgeoP mY7QQL/7KjE3qikrGUOCdNAz9k4dNhOsxnlzW2S+iRiyG0b/rWd3sSMLibBayVxme4ul HoeQ== 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=iKhGeEagneKG6sH5NKA/G/stiJozrALhS6Ua8ThxJRM=; fh=IPpOo4MAuIDMYj5lnXsOUoonV8gzUQ3LrR5MUq6vDLA=; b=fXgZBefuUHHjyG8TPx+2Y2oszJ97C0nX7rwlXLNGPnCy+NPM1at/rQxQrn/XqeamsY hbkSG26AhdnKX5t0ohrVV1vl819y9s9OD0fq+oEUONNa3T1Zcq4Ofi2K9vu0+mqM4mI3 yfI5hLMvZhlJ+azQCaSjssbpzQqDGpVB4NIbDpYk43z6uUcHSUqqytOoqFhtb80SZU0r 3HG++8XbS04pWbBtZdsKCTXMQrjanJlY6TyTGYCxw8MK952l/Q1ITczedwj2mD5JyapK wN+mYr/ykM1iKNo2DBxJ0eJuvNrlm7Tz8h1WOV3K8as6nPl92DuzFZEcCEvRqbNTAmxV QCUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f9-20020a17090ace0900b0026b49c1aa50si2447128pju.111.2023.11.09.12.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:31:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id E46D8809565C; Thu, 9 Nov 2023 12:31:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345263AbjKIU3p (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345226AbjKIU3c (ORCPT ); Thu, 9 Nov 2023 15:29:32 -0500 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 7803444BC for ; Thu, 9 Nov 2023 12:29:20 -0800 (PST) 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 1r1BeD-0002zp-S5; Thu, 09 Nov 2023 21:29:05 +0100 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 1r1BeD-007rWg-FB; Thu, 09 Nov 2023 21:29:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeD-00GGtb-61; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/12] bus: qcom-ssc-block-bus: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:34 +0100 Message-ID: <20231109202830.4124591-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> References: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2068; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wAGXyo4THEZ3YXfAy6+ytes/4cv/Fu7eWX0o6nDhAIA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUDzTrNcskF9F/f7KcEHQ1rf0f1wYIKKo0UFW olFqxNoc1mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A8wAKCRCPgPtYfRL+ TgRsB/9KhxhY9k0o2+A6JUS7K5v6XNCj4Wzgont+kCkzwMz/YYOJdMy9/JnUbv14K6dc1O3Aww0 tt9LfxAfT3CFQc8WtA5pFIP365Ar9BwyOXvVONlNbJ4NzeuvU6xuKnMco+Q7Wa0cjGpmub+SeA8 2bp2L6R3EGe9KT/Fp9+CxNswZHItWHgw4EwSsEK5yneju39Hgdxiw6E3cdlUc30lR0+FRY07Q0u j0ua1Tpnwn4a+qwxCsziQscqxoXF9PQ770v79b+T2WARxVaZC0eVEC5gwe7mSne70eAIdw+AKnP duc01QYWIctEMduPOoAIKfLVrFc6MMbPFlY0pw328//49g3k 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 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 (agentk.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:31:06 -0800 (PST) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119814801586108 X-GMAIL-MSGID: 1782119814801586108 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/bus/qcom-ssc-block-bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/qcom-ssc-block-bus.c b/drivers/bus/qcom-ssc-block-bus.c index 3fef18a43c01..5931974a21fa 100644 --- a/drivers/bus/qcom-ssc-block-bus.c +++ b/drivers/bus/qcom-ssc-block-bus.c @@ -350,7 +350,7 @@ static int qcom_ssc_block_bus_probe(struct platform_device *pdev) return 0; } -static int qcom_ssc_block_bus_remove(struct platform_device *pdev) +static void qcom_ssc_block_bus_remove(struct platform_device *pdev) { struct qcom_ssc_block_bus_data *data = platform_get_drvdata(pdev); @@ -363,8 +363,6 @@ static int qcom_ssc_block_bus_remove(struct platform_device *pdev) qcom_ssc_block_bus_pds_detach(&pdev->dev, data->pds, data->num_pds); pm_runtime_disable(&pdev->dev); pm_clk_destroy(&pdev->dev); - - return 0; } static const struct of_device_id qcom_ssc_block_bus_of_match[] = { @@ -375,7 +373,7 @@ MODULE_DEVICE_TABLE(of, qcom_ssc_block_bus_of_match); static struct platform_driver qcom_ssc_block_bus_driver = { .probe = qcom_ssc_block_bus_probe, - .remove = qcom_ssc_block_bus_remove, + .remove_new = qcom_ssc_block_bus_remove, .driver = { .name = "qcom-ssc-block-bus", .of_match_table = qcom_ssc_block_bus_of_match,