Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3082260rwl; Thu, 13 Apr 2023 15:41:04 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQi63ibx0d7t9HmgYr4tQiTb7m/fMHNDLCtPOgI1WdyP4OqmiQw6boCZoV+mKGxk7+VyvH X-Received: by 2002:a05:6a20:2a05:b0:d6:e295:7dbd with SMTP id e5-20020a056a202a0500b000d6e2957dbdmr3609073pzh.28.1681425663905; Thu, 13 Apr 2023 15:41:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681425663; cv=none; d=google.com; s=arc-20160816; b=NQaR232RnA/Fh8JceHrZCmhsfB6g1XppiQKLkFo6WyJVpX0cKWQSgoxPj+aa6Scpyt DFDsKQVETThlMvapoYM928yB3OoMzjILSToCDWgbWBTDh/x4Ik1vnFaLF7ndRFvsrHh9 042TFWmNcz18qgVZJBNncpmQCnQWfwnKMRtacPmFHkVaJ86F18jj27cz5V2D/9hMva++ UzJFTZlPUZizR80d5NNCtlOmo8QcbceR/kA06iTXFRFzhGUWYoqJz3ESclx3VaVemmtQ c9HRphyR4dgF9hVYLM0k3uuOSbSvsr3phdLcRSGl0HbAwE3nm1JLf6QFPtj0BzIYJH8P nCMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wEjpHrsOSE8mnhrkLjIzvinp6omOXRVU3VSmkbXf3xg=; b=F2sznJkHAzn4w6Bn3itguCUruECvWWhI8vLt0bywccYS6G9arGbSFWeEmmdIg4qeqL OyPKJtU9q6SYScO9yJMAsxrB+VwLJasAIGR/LalRNBdUBlnWnqRuAqFgWoNhCkMVbAd5 Rl3g9VxqHBRjfJYbHkLYfdW85fGP29mJ9AlIjtznFbaRChjNb7CbBFed8M08LR/vG5+k OcUhvoYvlYXou0Rx13TAs6jwsgHTxfBxFOxK2nkNREhXUrreqSFtiuFz8k/imytcNEuH sDgbR3KlCnbd6YcdTOhFMmsqqvuzBW4wPdAyxdQZybOzUVjeYyonPoVW7A3lejFwcsU+ 12sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QuoWqeeI; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x190-20020a6386c7000000b005133f65dc69si2974807pgd.219.2023.04.13.15.40.51; Thu, 13 Apr 2023 15:41:03 -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=@kernel.org header.s=k20201202 header.b=QuoWqeeI; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbjDMWiq (ORCPT + 99 others); Thu, 13 Apr 2023 18:38:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbjDMWij (ORCPT ); Thu, 13 Apr 2023 18:38:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 989AC4220 for ; Thu, 13 Apr 2023 15:38:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F34764214 for ; Thu, 13 Apr 2023 22:38:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 404F8C4339C; Thu, 13 Apr 2023 22:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681425516; bh=1ut5ph7e7MTXUwUNQA6pS+bDTFfCrhkn8nTjBsvJ2ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QuoWqeeI/4fHwhbcFRfE3XXX4wRw3ynb3QYEVORZyifc7y5EjVS7aGK0vth4n7Kbs jCRl3llEpbF56D80gAeaUKJqY8e8FtoU1zpK+ojPn7tqFkJuv0g0KRVCgy8bY8brqt IwJX6HeEBeW6D1nj55ybN+6Wvgl/e9WkkXilY4KDJIl51bsKNTeCPf7lkPibaGa6X6 C/gdjRENXOpQUtNOYQAIdqQxANYr3J6OvyhlDB7k79qbjO2qyizSMQuGKZyUn88dzj bGZJnH94/H/HPtpNd6+KHFgzohUlyNmnc3m/Em6nyf58Hk6itMM9eEVxr2aHm/+khj Mx0N/QM6Xj+CQ== From: Stephen Boyd To: Greg Kroah-Hartman Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , linux-kernel@vger.kernel.org, patches@lists.linux.dev, AngeloGioacchino Del Regno Subject: [PATCH 2/6] spmi: mtk-pmif: Convert to platform remove callback returning void Date: Thu, 13 Apr 2023 15:38:30 -0700 Message-ID: <20230413223834.4084793-3-sboyd@kernel.org> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog In-Reply-To: <20230413223834.4084793-1-sboyd@kernel.org> References: <20230413223834.4084793-1-sboyd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König 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 Link: https://lore.kernel.org/r/20230306073446.2194048-3-u.kleine-koenig@pengutronix.de Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Stephen Boyd --- drivers/spmi/spmi-mtk-pmif.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spmi/spmi-mtk-pmif.c b/drivers/spmi/spmi-mtk-pmif.c index ad511f2c3324..fbcb3921e70c 100644 --- a/drivers/spmi/spmi-mtk-pmif.c +++ b/drivers/spmi/spmi-mtk-pmif.c @@ -503,7 +503,7 @@ static int mtk_spmi_probe(struct platform_device *pdev) return err; } -static int mtk_spmi_remove(struct platform_device *pdev) +static void mtk_spmi_remove(struct platform_device *pdev) { struct spmi_controller *ctrl = platform_get_drvdata(pdev); struct pmif *arb = spmi_controller_get_drvdata(ctrl); @@ -511,7 +511,6 @@ static int mtk_spmi_remove(struct platform_device *pdev) clk_bulk_disable_unprepare(arb->nclks, arb->clks); spmi_controller_remove(ctrl); spmi_controller_put(ctrl); - return 0; } static const struct of_device_id mtk_spmi_match_table[] = { @@ -533,7 +532,7 @@ static struct platform_driver mtk_spmi_driver = { .of_match_table = of_match_ptr(mtk_spmi_match_table), }, .probe = mtk_spmi_probe, - .remove = mtk_spmi_remove, + .remove_new = mtk_spmi_remove, }; module_platform_driver(mtk_spmi_driver); -- https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/ https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git