From patchwork Tue Jun 28 14:03:11 2022 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: 12898368 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 9D68DC433EF for ; Tue, 28 Jun 2022 14:04:45 +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=nZNRwRt9GrhnM0gR9rKBRo2cP2Vj+XyfSl2JPJtWEok=; b=GfoQVe0xVpIMAt M+1jyboq6nenwSq78JloRAgqn5fffOsXNrqAmEZ41ALi55p7zN43RcJmyJ+aQRVzKjelSfBo4ZydT kmofdFxR98ppKG1welZnf4OTbqW1S/LQBqbyLsubQ0abdmY5gq6FJvu1Kbj4FZXgmOBqf0oBU3p1j D6H/rc1KagAJ2MA/pnLvI6eXxOANyW/kn7p8kxP8SHR0KJW7JzSt4yHZv5Sd3jVDDDfDUS3rRQf38 pjOz4jHJh8sGiyYQHSwshLmI1vOFEMu6FYWGZ39etAgJ8tl7+JU8+c1Tf5wY8K9D3IcrUe+xYRjWd H2M03RaQnQflEyOmPJwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6BoU-006cW0-AJ; Tue, 28 Jun 2022 14:03:34 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6BoQ-006cRZ-Ch for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 14:03:31 +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 1o6BoG-0008Ka-UJ; Tue, 28 Jun 2022 16:03:20 +0200 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 1o6BoC-003DT7-Ln; Tue, 28 Jun 2022 16:03:20 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1o6BoF-001gzN-0L; Tue, 28 Jun 2022 16:03:19 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sekhar Nori , Bartosz Golaszewski , Russell King , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, kernel@pengutronix.de, linux-i2c@vger.kernel.org Subject: [PATCH 5/6] gpio: pca953x: Make platform teardown callback return void Date: Tue, 28 Jun 2022 16:03:11 +0200 Message-Id: <20220628140313.74984-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220628140313.74984-1-u.kleine-koenig@pengutronix.de> References: <20220628140313.74984-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3568; h=from:subject; bh=QXt4mJ3H+NGdOsmDjNtywoIO4ywvdWEcvDHh7lh6T6s=; b=owGbwMvMwMV48I9IxdpTbzgZT6slMSTt5hIVfL5mxdXA93cKJ/wrtEgVZFq4OtLERqV+eucBnlOS 8T2fOhmNWRgYuRhkxRRZ6oq0xCZIrPlvV7KEG2YQKxPIFAYuTgGYyPE77P/r8kVs2v/a1PU8eT+1/P ENwemeiXdTV12qeHTbnOtFzPd35yLtixLNN+5j/iec48D0ccXhg8Y6tmt8osQjJcVOW0bLshUwGLOY LLp5/mLF/6Jz3yvOBlS+3CtadVY9R8kuws93rf4tkcg9izvUWA/5BRnoe98qsLF8lvmbubZac59l+o +HhwVdElSXOuXIswmIqWV/Vnc4byDYnaXu7/HzwB456RX/2SQ51iy3i+6+x8+3NaNAyfxQRP5CiVK+ I/6XvOyui7yNcXj88Hv25nPrjp4SeLuB/bFMxsdSe5uWvvcLA5iezKmVSCp6s6fr+Ncyf59yQfWiH6 u9hPe+tc1p/zRpnuiujk3e1sFhAA== 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_070330_484025_003A1255 X-CRM114-Status: GOOD ( 17.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All platforms that provide a teardown callback return 0. New users are supposed to not make use of platform support, so there is no functionality lost. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Forwarded: id:20220502170555.51183-1-u.kleine-koenig@pengutronix.de Reviewed-by: Andy Shevchenko --- arch/arm/mach-davinci/board-da850-evm.c | 12 ++++-------- drivers/gpio/gpio-pca953x.c | 11 +++-------- include/linux/platform_data/pca953x.h | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index efc26b472ef8..09253e70d0dc 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -518,8 +518,8 @@ static int da850_evm_ui_expander_setup(struct i2c_client *client, unsigned gpio, return ret; } -static int da850_evm_ui_expander_teardown(struct i2c_client *client, - unsigned gpio, unsigned ngpio, void *c) +static void da850_evm_ui_expander_teardown(struct i2c_client *client, + unsigned gpio, unsigned ngpio, void *c) { platform_device_unregister(&da850_evm_ui_keys_device); @@ -531,8 +531,6 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client, gpio_free(gpio + DA850_EVM_UI_EXP_SEL_C); gpio_free(gpio + DA850_EVM_UI_EXP_SEL_B); gpio_free(gpio + DA850_EVM_UI_EXP_SEL_A); - - return 0; } /* assign the baseboard expander's GPIOs after the UI board's */ @@ -699,13 +697,11 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client, return ret; } -static int da850_evm_bb_expander_teardown(struct i2c_client *client, - unsigned gpio, unsigned ngpio, void *c) +static void da850_evm_bb_expander_teardown(struct i2c_client *client, + unsigned gpio, unsigned ngpio, void *c) { platform_device_unregister(&da850_evm_bb_leds_device); platform_device_unregister(&da850_evm_bb_keys_device); - - return 0; } static struct pca953x_platform_data da850_evm_ui_expander_info = { diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 08bc52c3cdcb..3eedeac9ec8d 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c @@ -1099,20 +1099,15 @@ static int pca953x_remove(struct i2c_client *client) { struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev); struct pca953x_chip *chip = i2c_get_clientdata(client); - int ret; if (pdata && pdata->teardown) { - ret = pdata->teardown(client, chip->gpio_chip.base, - chip->gpio_chip.ngpio, pdata->context); - if (ret < 0) - dev_err(&client->dev, "teardown failed, %d\n", ret); - } else { - ret = 0; + pdata->teardown(client, chip->gpio_chip.base, + chip->gpio_chip.ngpio, pdata->context); } regulator_disable(chip->regulator); - return ret; + return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/include/linux/platform_data/pca953x.h b/include/linux/platform_data/pca953x.h index 4eb53e023997..96c1a14ab365 100644 --- a/include/linux/platform_data/pca953x.h +++ b/include/linux/platform_data/pca953x.h @@ -22,7 +22,7 @@ struct pca953x_platform_data { int (*setup)(struct i2c_client *client, unsigned gpio, unsigned ngpio, void *context); - int (*teardown)(struct i2c_client *client, + void (*teardown)(struct i2c_client *client, unsigned gpio, unsigned ngpio, void *context); const char *const *names;