Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3082278rwl; Thu, 13 Apr 2023 15:41:05 -0700 (PDT) X-Google-Smtp-Source: AKy350Yf5HcAb+u+3jeVMpKhogoyU3p13wXb/ngPZHE2B1yof10JUmbVEjvWnTBDK1oFw1PDExAk X-Received: by 2002:a17:902:d4d0:b0:1a1:9020:f9c7 with SMTP id o16-20020a170902d4d000b001a19020f9c7mr621750plg.44.1681425665342; Thu, 13 Apr 2023 15:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681425665; cv=none; d=google.com; s=arc-20160816; b=P+KjnGYxZ5EUNFCQuShjj84pU2Ba8YyTbOVhZZ/iXzEMawPTMBVA8Xuc9zuKsAYvii ydex6K+CiXCTpbf3hnQYf1QYHdyKXMJ9Vl6EjMR8RjgL6ftirtJ2z6k/c5TXX0lTKpZw KWd+25qaRbL1G5gEtwIfCBXrdv0Rzk/leNO2v77BfqIHs77zj8dUAIYZfgxlZ+RY4lDL hqR7Zc8xGIvYZJ1T59wMDPt65ZcWz+H5DRUVJIN5u+4b8ubmxw2zKqLpjVKTzqRaHhH1 ct2ZyFc5b40AWlPNUFG5wsTjBmz8V5jqvHsNgq8z6tPCkmgN/M0+8lhfbUIfDUC5/Dvs tfnw== 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=9/tF64+50IQ2ldWBt2D0mOIAXSJ3npswMYc2jJ632as=; b=OGK8v8MMDZDca2+kuY5RACJaLvYCs41cgdyreRxJQ5Dl65oHwKEwcNLW85UWdmSa/S Rk1a4r8uXEH30vtvms5owB6bTy5KRykuw5Z96YjPBK3ujwJ+8Kjo6j1KdzBugSf8fIHF 268zVxGTj9TYMmp9MePcGIw+H+DlW0bQzv90CITVZuNw7bU+Z7w2W1mmumq3SPPRToB/ 9A1fGAswgv9qdC1py6D1vPrr5YMUhf0YoUR3Bmw+C/PUTCEkrNrkopcEqioyLA++oD7X 0Y6dQIBRqvxpI4l7rRiuP1tvENufuByp810/Hr8fetChRM7dHENU3OqbVns0pXjndeVL b6uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZoJMnSoi; 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 d9-20020a631d09000000b0050c0305bcc3si2751553pgd.872.2023.04.13.15.40.53; Thu, 13 Apr 2023 15:41:05 -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=ZoJMnSoi; 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 S230145AbjDMWil (ORCPT + 99 others); Thu, 13 Apr 2023 18:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbjDMWij (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 659064219 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 E94D4640D3 for ; Thu, 13 Apr 2023 22:38:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1F8BC433D2; Thu, 13 Apr 2023 22:38:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681425516; bh=TB9f6dRHMA0rIjXItrHT/Bu0YIp1W1oxyGnuQSn4ftY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZoJMnSoi1IRiWJ/EmUcgYHLLsrDtndDcwiSaZ7PqubVIqPYDJeBgak6Vr0p/vsX+a ugSBDf3/HaV4KDmICVLWiobs1YEjQIL/akKqBzp59GRZtEehxhlphZRBZTjTyjKiN/ Uj7nBcbd8hEtRRCLWw9tj1Xe+7i9M/N1YPtxR6JlcCPC/LxkEche+uc7DWjg+Kf16L 5G8quJDkxyB27nFycmk0SnIBrdfntZRndgvsCcduLtuDZW53M4OKqrrH/+nj13J0bP vAjcUApHsa/i9KWAs8Rc7bQtAEGMhwEA2CgUxky5eFmCaYFi4ObqWVB2l9bm2ZRME6 ilTilQmVmztzQ== 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 Subject: [PATCH 1/6] spmi: hisi-spmi-controller: Convert to platform remove callback returning void Date: Thu, 13 Apr 2023 15:38:29 -0700 Message-ID: <20230413223834.4084793-2-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-2-u.kleine-koenig@pengutronix.de Signed-off-by: Stephen Boyd --- drivers/spmi/hisi-spmi-controller.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spmi/hisi-spmi-controller.c b/drivers/spmi/hisi-spmi-controller.c index 5bd23262abd6..9cbd473487cb 100644 --- a/drivers/spmi/hisi-spmi-controller.c +++ b/drivers/spmi/hisi-spmi-controller.c @@ -324,13 +324,12 @@ static int spmi_controller_probe(struct platform_device *pdev) return ret; } -static int spmi_del_controller(struct platform_device *pdev) +static void spmi_del_controller(struct platform_device *pdev) { struct spmi_controller *ctrl = platform_get_drvdata(pdev); spmi_controller_remove(ctrl); spmi_controller_put(ctrl); - return 0; } static const struct of_device_id spmi_controller_match_table[] = { @@ -343,7 +342,7 @@ MODULE_DEVICE_TABLE(of, spmi_controller_match_table); static struct platform_driver spmi_controller_driver = { .probe = spmi_controller_probe, - .remove = spmi_del_controller, + .remove_new = spmi_del_controller, .driver = { .name = "hisi_spmi_controller", .of_match_table = spmi_controller_match_table, -- https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/ https://git.kernel.org/pub/scm/linux/kernel/git/sboyd/spmi.git