Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3139245rwb; Mon, 7 Aug 2023 08:48:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0/+rCuTMwoszXa/hXxMl5h8Ysa6WyCLJzZd37rDVOG2SGGCNX+njZ4gAb3BPUsK18heVU X-Received: by 2002:a17:90a:3004:b0:263:72c5:9ac6 with SMTP id g4-20020a17090a300400b0026372c59ac6mr7262866pjb.11.1691423316836; Mon, 07 Aug 2023 08:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691423316; cv=none; d=google.com; s=arc-20160816; b=rQUQbWaxU/YvoYmrSMD54wU85l0vH79rM3NkAnnwjc/47HohWzNmxT6JcyR6L69z3+ 5f0GXl5WHBFoo4FhwdZpsF2f23oE1+DF2g35ZGujUHO39NCA7bpGfXB5wE2Dbh2lTihS Kkbr02+WJnstx12na8sCdc6oCb/+7YHNbkJEi62MSql2Nqvt88wn3CmUUVt/dJ6qO3OM Ti5lXop4tRBN17azzEFyAmqh/TOE6YWeip1CVOdMSSkVOzP2VTHnD646+tMKfDhGFewF 4fAeyeSnGtX5cZagrl6VNmbKg2uUN/FtGwXfENNr5hWeZAsP6K0EvWMN8eRnD9aoIYKF UKgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pRItn2cF5TQNt64raTRsWPd5Q0EJhD3/KF9OeDZ1Jek=; fh=w6NuLEQ4qOFDCMoIRTHM9btrhkuDaubqsSyMRCtFbBc=; b=CM6tfU7S8eSfRksJyh1UFaJqC7bSZbY2OBzHY3UEHSQ28gQ/X1IgSpe2yNJYbmdKK+ cbJE7c3lChtZ4hImEHPHR6cqruRKAjs0Wf7qAjY9c4SW1sq5kQ3q0TjrgfXgQm+ULdEq X9kffEbQZ1mm7b22aVKhUIxqeQEFPDV/PnM0hmiMgI8qZZ5B3G+c39DzU8V9W5ZYk3g1 JQ+z4kxDT+vUpgMAUCXYZVwMADnCWOJ2zbx1K9CWGAi/Gmn7ImeQkwt7Wt8Dlf0/tfiE 4j3G5bZdpnDpNKRbebRri8b4hSxhcBdmlC8myX4iQFB6dMx7ZglkMR/nho6KKxsjikFG LCXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MUElYBBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb10-20020a17090b4a4a00b002680c21ca6csi9520920pjb.95.2023.08.07.08.48.24; Mon, 07 Aug 2023 08:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MUElYBBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbjHGP1J (ORCPT + 99 others); Mon, 7 Aug 2023 11:27:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbjHGP1I (ORCPT ); Mon, 7 Aug 2023 11:27:08 -0400 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F3BE10F6 for ; Mon, 7 Aug 2023 08:27:04 -0700 (PDT) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-58419517920so50866567b3.0 for ; Mon, 07 Aug 2023 08:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691422024; x=1692026824; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pRItn2cF5TQNt64raTRsWPd5Q0EJhD3/KF9OeDZ1Jek=; b=MUElYBBzp1nPLlNHE6f/TMFiwNBEnp4Jh6A6+RXtQRmfIPxPveRZ6FSfvExGpHEGoB RiwQQQxoK/oWcZ1+Ls05mu9ejhCXsQ2dUL1r0Kc6+JldzbZTVfBMJ+14l7tCB3/VFwM8 Y/DaiHPImTPCgI+S4a/8uWx8qZVK9u5sqRdc5zw9BXE9M2F6fPwyWWl4t+ZkK2PtuTFi /GwylrICjRXYosRcN3l5CqE5HrLmurEEGMIsJmx1k7ga9EPPnKZgoAL+d6Rqmp/IiGy8 7SDUc8lLFjCOfstH631w+MQ/5F4gCNV69IDXo0Uogb/QrQvPBTD+I+H4+Rxdi65+8hhl /NgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691422024; x=1692026824; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRItn2cF5TQNt64raTRsWPd5Q0EJhD3/KF9OeDZ1Jek=; b=kvkGnk0I2BKNeZ9ds4oDTDqNL9JxWZEsL/uZ4XxiA0bzsvJpqIMdrUV7veZ0FQX5UG XFyH4emY+JvOB7TLXS+Ih9oLpSLRAal8hbpaSsPfYReLmDTHzf3SEjLPKT1XThoyRxxG A88fl/D++SInxXwEKVms1QxSqRHaozLpzlxCy1NpjyYKNXxof00v2lVqT/FaRZlQxVvc 9Vgt9wnhUtGkfazVgcnd7pupJuqcqXI6cq8JEK8ULgG23hgokHHnpSIGEARxSdI5+0Ay YOksmxCerDZCoxmBROapuSXIglVgzoe0bKjY2vK1v6L1m9aPMfwoOvLj7U5UdXlHs7ww EUXg== X-Gm-Message-State: AOJu0Yxe+d1+j4tnWFDxoR8zSFM7y0oo/0F6wHVJwpzdUVRbEFqg5z65 PQyjZWZiMGs4kQ/LBoOc1T0JQsQpaykJzFXHsIDA6Q== X-Received: by 2002:a25:2396:0:b0:c12:29ac:1d36 with SMTP id j144-20020a252396000000b00c1229ac1d36mr10222700ybj.7.1691422023820; Mon, 07 Aug 2023 08:27:03 -0700 (PDT) MIME-Version: 1.0 References: <20230727070051.17778-1-frank.li@vivo.com> In-Reply-To: <20230727070051.17778-1-frank.li@vivo.com> From: Ulf Hansson Date: Mon, 7 Aug 2023 17:26:27 +0200 Message-ID: Subject: Re: [PATCH v3 01/62] mmc: sunxi: Convert to platform remove callback returning void To: Yangtao Li Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 27 Jul 2023 at 09:01, Yangtao Li wrote: > > 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. > > Cc: Uwe Kleine-K=C3=B6nig > Signed-off-by: Yangtao Li > Acked-by: Jernej Skrabec Normally I would prefer one patch per host driver, but in this series the changes are so trivial that it just becomes more difficult for me to manage. Please squash all changes that convert from using ->remove() to .remove_new() into one single patch for the mmc host drivers. Note that, I discovered there are some additional cleanups being part of the series, those deserve to be submitted indepently of this. Kind regards Uffe > --- > drivers/mmc/host/sunxi-mmc.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c > index 69dcb8805e05..d3bd0ac99ec4 100644 > --- a/drivers/mmc/host/sunxi-mmc.c > +++ b/drivers/mmc/host/sunxi-mmc.c > @@ -1486,7 +1486,7 @@ static int sunxi_mmc_probe(struct platform_device *= pdev) > return ret; > } > > -static int sunxi_mmc_remove(struct platform_device *pdev) > +static void sunxi_mmc_remove(struct platform_device *pdev) > { > struct mmc_host *mmc =3D platform_get_drvdata(pdev); > struct sunxi_mmc_host *host =3D mmc_priv(mmc); > @@ -1499,8 +1499,6 @@ static int sunxi_mmc_remove(struct platform_device = *pdev) > } > dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_d= ma); > mmc_free_host(mmc); > - > - return 0; > } > > #ifdef CONFIG_PM > @@ -1556,7 +1554,7 @@ static struct platform_driver sunxi_mmc_driver =3D = { > .pm =3D &sunxi_mmc_pm_ops, > }, > .probe =3D sunxi_mmc_probe, > - .remove =3D sunxi_mmc_remove, > + .remove_new =3D sunxi_mmc_remove, > }; > module_platform_driver(sunxi_mmc_driver); > > -- > 2.39.0 >