From patchwork Tue Oct 12 15:39:26 2021 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: 12552943 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40111C4167B for ; Tue, 12 Oct 2021 15:39:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 299A2610A2 for ; Tue, 12 Oct 2021 15:39:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237512AbhJLPl7 (ORCPT ); Tue, 12 Oct 2021 11:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237507AbhJLPl7 (ORCPT ); Tue, 12 Oct 2021 11:41:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E112C06174E for ; Tue, 12 Oct 2021 08:39:57 -0700 (PDT) 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 1maJsd-0008NO-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsa-0004iV-UO; Tue, 12 Oct 2021 17:39:48 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsa-0004Wb-TV; Tue, 12 Oct 2021 17:39:48 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Thierry Reding Cc: Mark Brown , Sam Ravnborg , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, linux-spi@vger.kernel.org Subject: [PATCH v2 01/20] drm/panel: s6e63m0: Make s6e63m0_remove() return void Date: Tue, 12 Oct 2021 17:39:26 +0200 Message-Id: <20211012153945.2651412-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=s7lxpA3SlxdAgalZdfZtQ9BEymVUSL76ohaDIVT+Hbk=; m=QwS8VQ147nh5eUkRo9mxGTfBcUgnx3Jl4gdGJ73rKHM=; p=gB1Eh6qhdZKXG7+Sv2MnM6FjygYEx1l/LzdGrasJ/Qc=; g=4d3b9377dd7211c6773f6965376e81757de8d724 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlq/oACgkQwfwUeK3K7Akmjgf/Yz4 5vOpjYxqgOZK7YhMlgWEMY2UMzrf8E+RXKJk77ktsE8UokcCxvISzNgFqYMqXAf5QOZFF4qwGh0hy HvQknmD6QcThauWd46RwTXVRMtu10Iy2uIQdqLKw+bTgeEf6z4k66dn1yKbR6RwliBvDZlkSeC/OA wj1iWzqoFlRdWdsK0bXySrKkCmuH339v0MvPhmU+ZKRjHhaC6Bsk6vs/P9cy7D0OtVkbnrIl1MO+i zuHWP5/Lmb5sGU4Pxmx9RR971muNiyE55QoiOdG6kqlay0Sv6gPQqMqtkNG5JAR4fL5r+7eiVzZYf /OKmjqvUJFAeKCAtQuqsz37t3ga0Q7A== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now s6e63m0_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c | 3 ++- drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c | 3 ++- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 4 +--- drivers/gpu/drm/panel/panel-samsung-s6e63m0.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c index e0b1a7e354f3..e0f773678168 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c @@ -116,7 +116,8 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi) static int s6e63m0_dsi_remove(struct mipi_dsi_device *dsi) { mipi_dsi_detach(dsi); - return s6e63m0_remove(&dsi->dev); + s6e63m0_remove(&dsi->dev); + return 0; } static const struct of_device_id s6e63m0_dsi_of_match[] = { diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c index 3669cc3719ce..c178d962b0d5 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-spi.c @@ -64,7 +64,8 @@ static int s6e63m0_spi_probe(struct spi_device *spi) static int s6e63m0_spi_remove(struct spi_device *spi) { - return s6e63m0_remove(&spi->dev); + s6e63m0_remove(&spi->dev); + return 0; } static const struct of_device_id s6e63m0_spi_of_match[] = { diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index 35d72ac663d6..b34fa4d5de07 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -749,13 +749,11 @@ int s6e63m0_probe(struct device *dev, void *trsp, } EXPORT_SYMBOL_GPL(s6e63m0_probe); -int s6e63m0_remove(struct device *dev) +void s6e63m0_remove(struct device *dev) { struct s6e63m0 *ctx = dev_get_drvdata(dev); drm_panel_remove(&ctx->panel); - - return 0; } EXPORT_SYMBOL_GPL(s6e63m0_remove); diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.h b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.h index 306605ed1117..c926eca1c817 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.h +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.h @@ -35,6 +35,6 @@ int s6e63m0_probe(struct device *dev, void *trsp, const u8 *data, size_t len), bool dsi_mode); -int s6e63m0_remove(struct device *dev); +void s6e63m0_remove(struct device *dev); #endif /* _PANEL_SAMSUNG_S6E63M0_H */ From patchwork Tue Oct 12 15:39:27 2021 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: 12552937 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81129C4332F for ; Tue, 12 Oct 2021 15:39:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 694FD610C7 for ; Tue, 12 Oct 2021 15:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237494AbhJLPl6 (ORCPT ); Tue, 12 Oct 2021 11:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237484AbhJLPl5 (ORCPT ); Tue, 12 Oct 2021 11:41:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F18AC061749 for ; Tue, 12 Oct 2021 08:39:56 -0700 (PDT) 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 1maJsd-0008NP-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsb-0004iY-5t; Tue, 12 Oct 2021 17:39:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsb-0004Xa-4r; Tue, 12 Oct 2021 17:39:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Bartosz Golaszewski , Linus Walleij Cc: Mark Brown , kernel@pengutronix.de, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 02/20] gpio: max730x: Make __max730x_remove() return void Date: Tue, 12 Oct 2021 17:39:27 +0200 Message-Id: <20211012153945.2651412-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=tqcLhBG6DHD9svNAkG7NX2lapdSljmx+R8lQuV0tyGU=; m=glB6j2gf38uOQhExkc8b6Ih2Xw+z3n90qct7TLl53sM=; p=r2yVQD05AL+Evhwa0VXFPaN8Mh5hwPH1743xH+oyVXE=; g=fe2da4bd8c15949a113d004f924867e64330ca3f X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlq/4ACgkQwfwUeK3K7AnyGAf8D4Y /1vPk7Isyb+yrfTxAk/QvVR5qLbSLluQxbVa5yiO1pHGEfyJ+EQEdc2UOkCrJGguN1WWux7LldQP5 PFNK5rOpEHK3gVznK9Je8KN7ULKB1BzpWNZfbsN4e1uG4U6sfs4kgOH4YDnS1dSy6/YNRB9VqFdhl FlEXktFPFjL4+IvPliipW5ltkK3MkmrTRxWXIynSgBvovI+khRFY+ULoO0hlQGjsnk8tZ+VGJMJKR 80SeADe/NBtdwSWLOIDHsxZwQmuPCRBR7EinTFYeAb6hMqPWJq5xpW+5tvlIK38Apnh0cUlBuglt0 3QAD4e5PXSdgkz3V5AuOplU6bQA3l9Q== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org An spi or i2c remove callback is only called for devices that probed successfully. In this case this implies that __max730x_probe() set a non-NULL driver data. So the check ts == NULL is never true. With this check dropped, __max730x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/gpio/gpio-max7300.c | 4 +++- drivers/gpio/gpio-max7301.c | 4 +++- drivers/gpio/gpio-max730x.c | 6 +----- include/linux/spi/max7301.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-max7300.c b/drivers/gpio/gpio-max7300.c index 19cc2ed6a3f5..b2b547dd6e84 100644 --- a/drivers/gpio/gpio-max7300.c +++ b/drivers/gpio/gpio-max7300.c @@ -50,7 +50,9 @@ static int max7300_probe(struct i2c_client *client, static int max7300_remove(struct i2c_client *client) { - return __max730x_remove(&client->dev); + __max730x_remove(&client->dev); + + return 0; } static const struct i2c_device_id max7300_id[] = { diff --git a/drivers/gpio/gpio-max7301.c b/drivers/gpio/gpio-max7301.c index 1307c243b4e9..5862d73bf325 100644 --- a/drivers/gpio/gpio-max7301.c +++ b/drivers/gpio/gpio-max7301.c @@ -66,7 +66,9 @@ static int max7301_probe(struct spi_device *spi) static int max7301_remove(struct spi_device *spi) { - return __max730x_remove(&spi->dev); + __max730x_remove(&spi->dev); + + return 0; } static const struct spi_device_id max7301_id[] = { diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index b8c1fe20f49a..bb5cf14ae4c8 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c @@ -220,18 +220,14 @@ int __max730x_probe(struct max7301 *ts) } EXPORT_SYMBOL_GPL(__max730x_probe); -int __max730x_remove(struct device *dev) +void __max730x_remove(struct device *dev) { struct max7301 *ts = dev_get_drvdata(dev); - if (ts == NULL) - return -ENODEV; - /* Power down the chip and disable IRQ output */ ts->write(dev, 0x04, 0x00); gpiochip_remove(&ts->chip); mutex_destroy(&ts->lock); - return 0; } EXPORT_SYMBOL_GPL(__max730x_remove); diff --git a/include/linux/spi/max7301.h b/include/linux/spi/max7301.h index 21449067aedb..e392c53758bc 100644 --- a/include/linux/spi/max7301.h +++ b/include/linux/spi/max7301.h @@ -31,6 +31,6 @@ struct max7301_platform_data { u32 input_pullup_active; }; -extern int __max730x_remove(struct device *dev); +extern void __max730x_remove(struct device *dev); extern int __max730x_probe(struct max7301 *ts); #endif From patchwork Tue Oct 12 15:39:28 2021 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: 12552941 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52A32C433EF for ; Tue, 12 Oct 2021 15:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B419610C7 for ; Tue, 12 Oct 2021 15:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237486AbhJLPl7 (ORCPT ); Tue, 12 Oct 2021 11:41:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237463AbhJLPl5 (ORCPT ); Tue, 12 Oct 2021 11:41:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1388EC061570 for ; Tue, 12 Oct 2021 08:39:56 -0700 (PDT) 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 1maJsd-0008NQ-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsb-0004ib-Ab; Tue, 12 Oct 2021 17:39:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsb-0004Xk-9i; Tue, 12 Oct 2021 17:39:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Bartosz Golaszewski , Linus Walleij Cc: Mark Brown , kernel@pengutronix.de, linux-gpio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 03/20] gpio: mc33880: Drop if with an always false condition Date: Tue, 12 Oct 2021 17:39:28 +0200 Message-Id: <20211012153945.2651412-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=U928Zsjke4PePvMRBLGBdH7AFPIzISeqQDiRVuernkA=; m=KxvpK5Ffg66PylsxXar0DvY3vkY/yY2nG7ASvrBO71A=; p=CeVmNWRKcwk9K6MjZI6ZUG5Bs+V4ag4EumMETP3nWgo=; g=d918bff0a84daefa24b904c36ae4cfaf68e06a4f X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrAEACgkQwfwUeK3K7AnyWAf/cY7 yIK3QC8W2j0EfS6xGFjlrb+SfAplc0oqDaUPqZQC2ZAoLPzzEQ/ToYVRaa7pvxDaQGDzA1zCJW6Zm GgQlxiRoDQjrYRswm323xiICx5ecoy5l/sdVEJ1kXl5gIsVaDC70yYV/b6BiCIQiAoo8WofQcThJV Rx2SY2ABGCtwiPvugTbVuMDdA87UfYSaKseBBa4QzoJhaU9A2zMFitBmrI9V+NjkTLgdlxJtq+i// fnOjLcdeu6Z/LRjIf3QW2PQhf+3pagEBk0SV/IEejaVOtKkU9w9BX98YREH3zAZc30CApRlv1wF9h pF8risKiCCfCChA2ivow4xtXn/989Ew== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org An spi remove callback is only called for devices that probed successfully. In this case this implies that mc33880_probe() set a non-NULL driver data. So the check for mc being NULL is never true and the check can be dropped. Also the return value ofspi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/gpio/gpio-mc33880.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c index f8194f7c6186..31d2be1bebc8 100644 --- a/drivers/gpio/gpio-mc33880.c +++ b/drivers/gpio/gpio-mc33880.c @@ -139,8 +139,6 @@ static int mc33880_remove(struct spi_device *spi) struct mc33880 *mc; mc = spi_get_drvdata(spi); - if (!mc) - return -ENODEV; gpiochip_remove(&mc->chip); mutex_destroy(&mc->lock); From patchwork Tue Oct 12 15:39:29 2021 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: 12552947 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A273C433EF for ; Tue, 12 Oct 2021 15:40:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EED29610CE for ; Tue, 12 Oct 2021 15:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237520AbhJLPmB (ORCPT ); Tue, 12 Oct 2021 11:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237516AbhJLPmA (ORCPT ); Tue, 12 Oct 2021 11:42:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01423C061745 for ; Tue, 12 Oct 2021 08:39:59 -0700 (PDT) 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 1maJsd-0008NR-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsb-0004ie-Ju; Tue, 12 Oct 2021 17:39:49 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsb-0004Xu-Iq; Tue, 12 Oct 2021 17:39:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Guenter Roeck , Jean Delvare Cc: Mark Brown , kernel@pengutronix.de, linux-hwmon@vger.kernel.org, linux-spi@vger.kernel.org, Michael Hennerich Subject: [PATCH v2 04/20] hwmon: max31722: Warn about failure to put device in stand-by in .remove() Date: Tue, 12 Oct 2021 17:39:29 +0200 Message-Id: <20211012153945.2651412-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=VzmQt12yOkne619FyHfm2Mxhtg4zmARLaeg/MgRfc80=; m=DyHMncx8nwCv8RWUfmtNPrRiBJD5zN20Ra+GWMZCSCM=; p=bBkC2gJ5XT8B1VAvVS6dFZGhwZYy9lCY9z6NFqcALPQ=; g=d02ecae4dfa3faae03d9f4b8b4e5ec93f10e7ffd X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrAQACgkQwfwUeK3K7AnmBAf+KP3 y97hK0gi5k1i2iYpdL1ypkDWhHnV9v/T7OCbzY0uR/9urLtF6vAMPK7tv5N5F0cxTxYtaqErlLmmJ L9EW0Bp2vc3x2pQfA109t3PBGMyI1bZdTBynHrSHSYy6/j/nVL4zI1ZVOt5Od0dTm84cErv5jnp4i pfzaRSDug+bGg/d7JDC8OHvSRdcqAFlHSjgxOFAuhICMMjs0R8ZuCepX0phV/hULtNPs2rxgFEcas wj8F8EP69XW1h51TRt9jMjdq4Adt9osdHBQ97qT9phc7SSJlM0j4/4QwwJF9GhMkmAEmeE2asJRdN fMdIW8KVrk+za/BXIwKTa3zRnn5ai5A== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Acked-by: Michael Hennerich Signed-off-by: Uwe Kleine-König --- drivers/hwmon/max31722.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/max31722.c b/drivers/hwmon/max31722.c index 613338cbcb17..4cf4fe6809a3 100644 --- a/drivers/hwmon/max31722.c +++ b/drivers/hwmon/max31722.c @@ -103,10 +103,16 @@ static int max31722_probe(struct spi_device *spi) static int max31722_remove(struct spi_device *spi) { struct max31722_data *data = spi_get_drvdata(spi); + int ret; hwmon_device_unregister(data->hwmon_dev); - return max31722_set_mode(data, MAX31722_MODE_STANDBY); + ret = max31722_set_mode(data, MAX31722_MODE_STANDBY); + if (ret) + /* There is nothing we can do about this ... */ + dev_warn(&spi->dev, "Failed to put device in stand-by mode\n"); + + return 0; } static int __maybe_unused max31722_suspend(struct device *dev) From patchwork Tue Oct 12 15:39:30 2021 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: 12552949 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78BF6C433FE for ; Tue, 12 Oct 2021 15:40:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60936610C9 for ; Tue, 12 Oct 2021 15:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237504AbhJLPmA (ORCPT ); Tue, 12 Oct 2021 11:42:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237508AbhJLPl7 (ORCPT ); Tue, 12 Oct 2021 11:41:59 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AA74C061762 for ; Tue, 12 Oct 2021 08:39:57 -0700 (PDT) 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 1maJsd-0008NT-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsc-0004ik-Q7; Tue, 12 Oct 2021 17:39:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsb-0004Y5-OP; Tue, 12 Oct 2021 17:39:49 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov , Michael Hennerich Cc: Mark Brown , kernel@pengutronix.de, linux-input@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 05/20] input: adxl34xx: Make adxl34x_remove() return void Date: Tue, 12 Oct 2021 17:39:30 +0200 Message-Id: <20211012153945.2651412-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=wc1dQ8068Cu8i6oLG4jCUQi32w4OqgSEom4N8oawnTg=; m=Z35zEqGg82zhKujZki3WXSREWKfbS0aTa8UkTMklTJg=; p=QT+3ZtPBPblOHahXh7QoMrpcjZbKAO38bG2mksoUihY=; g=d0f6a150c9b3211526c2456a0a1697e753433591 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrAcACgkQwfwUeK3K7Am60Qf+OLq TRNUKjj9ZdPMZz9LSWQ7qRcyA2ecYCox73W++UjSX0A5IB0wlkQbV1/sINvSF7VBGY/rZSp5NvwWw RbxGIvUEAgA3gUfMWSLFG9g2loJw2uxJ4ocFSnRw23ajBJxAk5o5LQDjNoo//53mPWJaqvia6yrop hnBi4YW76IxRDG3jux0GSWLeqC0Jy3iDOZnl3lFzfHTPTolz1H6wmodw6cNFVsUY8o4EsDQJzN2iV 5ieTv16jymTfxb04ewbC2f7PJI019gPPWOaoyuIBsgVqUskIXgb+SuvKuxw0phecmkv008IXxWyer pDPBsy+h+g3TSFpHZXZN+yAm7Ihgzfg== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now adxl34x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König Acked-by: Michael Hennerich --- drivers/input/misc/adxl34x-i2c.c | 4 +++- drivers/input/misc/adxl34x-spi.c | 4 +++- drivers/input/misc/adxl34x.c | 4 +--- drivers/input/misc/adxl34x.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c index e64368a63346..a3b5f88d2bd1 100644 --- a/drivers/input/misc/adxl34x-i2c.c +++ b/drivers/input/misc/adxl34x-i2c.c @@ -103,7 +103,9 @@ static int adxl34x_i2c_remove(struct i2c_client *client) { struct adxl34x *ac = i2c_get_clientdata(client); - return adxl34x_remove(ac); + adxl34x_remove(ac); + + return 0; } static int __maybe_unused adxl34x_i2c_suspend(struct device *dev) diff --git a/drivers/input/misc/adxl34x-spi.c b/drivers/input/misc/adxl34x-spi.c index df6afa455e46..6e51c9bc619f 100644 --- a/drivers/input/misc/adxl34x-spi.c +++ b/drivers/input/misc/adxl34x-spi.c @@ -91,7 +91,9 @@ static int adxl34x_spi_remove(struct spi_device *spi) { struct adxl34x *ac = spi_get_drvdata(spi); - return adxl34x_remove(ac); + adxl34x_remove(ac); + + return 0; } static int __maybe_unused adxl34x_spi_suspend(struct device *dev) diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c index 4cc4e8ff42b3..34beac80e6f0 100644 --- a/drivers/input/misc/adxl34x.c +++ b/drivers/input/misc/adxl34x.c @@ -896,15 +896,13 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq, } EXPORT_SYMBOL_GPL(adxl34x_probe); -int adxl34x_remove(struct adxl34x *ac) +void adxl34x_remove(struct adxl34x *ac) { sysfs_remove_group(&ac->dev->kobj, &adxl34x_attr_group); free_irq(ac->irq, ac); input_unregister_device(ac->input); dev_dbg(ac->dev, "unregistered accelerometer\n"); kfree(ac); - - return 0; } EXPORT_SYMBOL_GPL(adxl34x_remove); diff --git a/drivers/input/misc/adxl34x.h b/drivers/input/misc/adxl34x.h index 83a0eeccf613..febf85270fff 100644 --- a/drivers/input/misc/adxl34x.h +++ b/drivers/input/misc/adxl34x.h @@ -25,6 +25,6 @@ void adxl34x_resume(struct adxl34x *ac); struct adxl34x *adxl34x_probe(struct device *dev, int irq, bool fifo_delay_default, const struct adxl34x_bus_ops *bops); -int adxl34x_remove(struct adxl34x *ac); +void adxl34x_remove(struct adxl34x *ac); #endif From patchwork Tue Oct 12 15:39:31 2021 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: 12552939 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 022C8C433F5 for ; Tue, 12 Oct 2021 15:39:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E17E9610CC for ; Tue, 12 Oct 2021 15:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237484AbhJLPl6 (ORCPT ); Tue, 12 Oct 2021 11:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237462AbhJLPl5 (ORCPT ); Tue, 12 Oct 2021 11:41:57 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 237A9C061745 for ; Tue, 12 Oct 2021 08:39:56 -0700 (PDT) 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 1maJsd-0008NS-Up; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsc-0004ih-1B; Tue, 12 Oct 2021 17:39:50 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004Y8-0I; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dmitry Torokhov Cc: Mark Brown , kernel@pengutronix.de, linux-input@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 06/20] input: touchscreen: tsc200x: Make tsc200x_remove() return void Date: Tue, 12 Oct 2021 17:39:31 +0200 Message-Id: <20211012153945.2651412-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=94oorPupYOLS40HYKqyvmBk6HGvbhR+NJnei2QkNFGk=; m=Bsn3NLP3I1exqSpvJBONKOIhA7oOcADEshibx4agNIQ=; p=XrMASlvC85yGCSzZ81aLygEbijEM+OrmhchqNjTkj3k=; g=d5cc911828fc149b672baef67a39ff26315a5a39 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrAoACgkQwfwUeK3K7AkMDAf/TYq JLQRB8P0IbWTquAN/H8sAzdf2o7/37Hhn/ane5ZSaO1+1/tPr9idW9Jdu9J1G45oPlCB9cmkBVUWM ljZEbyPT8JAxVBKgaabtLTnLwLBSQXLlxOegQTbocsY2uN1FLEyJoRbsbBz1Uyi2n6ftrq/CGK++D TZZL7XLBRkf9s4Z9kAjF0byjb1QHhzBkCU63HYB8d+xH8iMeOYvTcoYsNd9esukKNLksnAQVTe9V7 rA1zX7t3Cd5WhtUWPU8lFkRmdfng6PrlONTSaVojdFEb4uLdyJaLKZiMvR/xnknm1MC1QjhO4DSeK O2DFaY/OtnJUGBcFUVePzu0iK9u0wDg== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now tsc200x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/input/touchscreen/tsc2004.c | 4 +++- drivers/input/touchscreen/tsc2005.c | 4 +++- drivers/input/touchscreen/tsc200x-core.c | 4 +--- drivers/input/touchscreen/tsc200x-core.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c index 0272cedcc726..9fdd870c4c0b 100644 --- a/drivers/input/touchscreen/tsc2004.c +++ b/drivers/input/touchscreen/tsc2004.c @@ -45,7 +45,9 @@ static int tsc2004_probe(struct i2c_client *i2c, static int tsc2004_remove(struct i2c_client *i2c) { - return tsc200x_remove(&i2c->dev); + tsc200x_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id tsc2004_idtable[] = { diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c index 923496bbb368..a2f55920b9b2 100644 --- a/drivers/input/touchscreen/tsc2005.c +++ b/drivers/input/touchscreen/tsc2005.c @@ -66,7 +66,9 @@ static int tsc2005_probe(struct spi_device *spi) static int tsc2005_remove(struct spi_device *spi) { - return tsc200x_remove(&spi->dev); + tsc200x_remove(&spi->dev); + + return 0; } #ifdef CONFIG_OF diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index b8d720d52013..27810f6c69f6 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c @@ -577,15 +577,13 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, } EXPORT_SYMBOL_GPL(tsc200x_probe); -int tsc200x_remove(struct device *dev) +void tsc200x_remove(struct device *dev) { struct tsc200x *ts = dev_get_drvdata(dev); sysfs_remove_group(&dev->kobj, &tsc200x_attr_group); regulator_disable(ts->vio); - - return 0; } EXPORT_SYMBOL_GPL(tsc200x_remove); diff --git a/drivers/input/touchscreen/tsc200x-core.h b/drivers/input/touchscreen/tsc200x-core.h index a43c08ccfd3d..4ded34425b21 100644 --- a/drivers/input/touchscreen/tsc200x-core.h +++ b/drivers/input/touchscreen/tsc200x-core.h @@ -74,6 +74,6 @@ extern const struct dev_pm_ops tsc200x_pm_ops; int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, struct regmap *regmap, int (*tsc200x_cmd)(struct device *dev, u8 cmd)); -int tsc200x_remove(struct device *dev); +void tsc200x_remove(struct device *dev); #endif From patchwork Tue Oct 12 15:39:32 2021 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: 12552957 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01507C4332F for ; Tue, 12 Oct 2021 15:40:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE2476108F for ; Tue, 12 Oct 2021 15:40:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237419AbhJLPmM (ORCPT ); Tue, 12 Oct 2021 11:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237521AbhJLPmI (ORCPT ); Tue, 12 Oct 2021 11:42:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62F5BC061767 for ; Tue, 12 Oct 2021 08:40:02 -0700 (PDT) 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 1maJsj-0000I1-Qq; Tue, 12 Oct 2021 17:39:57 +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.92) (envelope-from ) id 1maJsj-0004kB-9q; Tue, 12 Oct 2021 17:39:57 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004YH-6D; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Mauro Carvalho Chehab , Yasunari Takiguchi Cc: Mark Brown , kernel@pengutronix.de, linux-media@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 07/20] media: cxd2880: Eliminate dead code Date: Tue, 12 Oct 2021 17:39:32 +0200 Message-Id: <20211012153945.2651412-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=i/V0IwiXrJHb2puTsy4r3UAQrVBpJK4uRHfeGK5dIi4=; m=6Brp6ipiIrN4N0gba2jlJ7ZY/JS2k/XshUNdN7/roa8=; p=8ZiFid/gojahfXRtSIUMwOZadkeWb7YdowfHaijfOII=; g=d6494736086a7092e3c965bf6057c1246baeecdc X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrA0ACgkQwfwUeK3K7AmsNgf7BfZ I7zwHdHpHgVO+f3PbnRyDrjG6tyn0xgkcl2ZNNWmkO0e3wtFAGep6OmlaRjEFEb7uz6XTIDdQZds0 K2cFwH5xSVJF+C9Y95vGqz7sr81H0imQJ908h3lpoqVZzdzNaxm2jFV/CTUZB/h/rE1e/ymSnFY6M 7KSC2dCwKbohf/IWACgBCc4BTxjQqcJA/YpTYzqoFJVANDpLF/fA3N3pihjeXB1aBaDu8tfPp4Fhz tTIUTOiFAQ60Oh3ihxCRB7IpjD68df45f3+J1qfuWhZBoN0S4bl0sA+fZWx5B7zAP343Cij38bDH6 jy3bUzJWLhv1g4KA2UzL1A4oSoxmfEA== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org An spi remove callback is never called with an spi_device pointer that is NULL. Also it is only called for devices that probed successfully. As cxd2880_spi_probe() always sets driver data, spi_get_drvdata() cannot be NULL. Also the return value of spi remove callbacks is ignored anyway and not freeing resources in .remove() is a bad idea. Signed-off-by: Uwe Kleine-König --- drivers/media/spi/cxd2880-spi.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/media/spi/cxd2880-spi.c b/drivers/media/spi/cxd2880-spi.c index b91a1e845b97..67cacf29a61e 100644 --- a/drivers/media/spi/cxd2880-spi.c +++ b/drivers/media/spi/cxd2880-spi.c @@ -628,19 +628,8 @@ cxd2880_spi_probe(struct spi_device *spi) static int cxd2880_spi_remove(struct spi_device *spi) { - struct cxd2880_dvb_spi *dvb_spi; + struct cxd2880_dvb_spi *dvb_spi = spi_get_drvdata(spi); - if (!spi) { - pr_err("invalid arg\n"); - return -EINVAL; - } - - dvb_spi = spi_get_drvdata(spi); - - if (!dvb_spi) { - pr_err("failed\n"); - return -EINVAL; - } dvb_spi->demux.dmx.remove_frontend(&dvb_spi->demux.dmx, &dvb_spi->dmx_fe); dvb_dmxdev_release(&dvb_spi->dmxdev); From patchwork Tue Oct 12 15:39:33 2021 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: 12552959 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F702C433EF for ; Tue, 12 Oct 2021 15:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1977C61076 for ; Tue, 12 Oct 2021 15:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237462AbhJLPmM (ORCPT ); Tue, 12 Oct 2021 11:42:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237567AbhJLPmI (ORCPT ); Tue, 12 Oct 2021 11:42:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18FF9C061766 for ; Tue, 12 Oct 2021 08:40:02 -0700 (PDT) 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 1maJsk-0000II-Bq; Tue, 12 Oct 2021 17:39:58 +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.92) (envelope-from ) id 1maJsj-0004kF-QI; Tue, 12 Oct 2021 17:39:57 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004YK-Gg; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 08/20] mfd: mc13xxx: Make mc13xxx_common_exit() return void Date: Tue, 12 Oct 2021 17:39:33 +0200 Message-Id: <20211012153945.2651412-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=J0ahGtF24eL+BKixNT+eVqqWAgunLx1WrSLObTBrLHE=; m=iAYXBDyS7vtYm0Q4B+/bh1iHsdzFe765AJZBSjfwEOk=; p=TJRcqcmzluYBW46T1V2zGB+3lNMcmVPb0isZQJg7eQs=; g=eb89a423a41a45a2129a3976ae022c06593f26d7 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrBAACgkQwfwUeK3K7AngyAf/Uku 9UVj6F4MAHMPRreuoef2rVCjDXTOodXnPRnIMMFD4UkjXv3xZq+OBgvNfSmBOA0ogWR6kVlIKAYMF HaUwynitP2D0mX1caehzcu0GMdgdJty1Nna8EaNfG4hsjoOo8YBwIVRBVxlfuHAF51TcdEv7SFxoi LxmNDUkuFC0hvCfWUm0DMU2xMUMQPiF1alKHSSQMFeNz0OH4AQ498VOhd77+fxyxRzzHcRyMQ/uf+ qLOwQ+4smg+fg9kG48ESXNacqRCpOWq/I1tng4ZJV7cUPZcpDANyaxiGmc9rxD/Xo5skmEklbZSVt A1+1bFZFnFl2O7Y8Zlz+6X0U/T+X8hQ== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now mc13xxx_common_exit() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/mfd/mc13xxx-core.c | 4 +--- drivers/mfd/mc13xxx-i2c.c | 3 ++- drivers/mfd/mc13xxx-spi.c | 3 ++- drivers/mfd/mc13xxx.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index 1abe7432aad8..8a4f1d90dcfd 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -496,15 +496,13 @@ int mc13xxx_common_init(struct device *dev) } EXPORT_SYMBOL_GPL(mc13xxx_common_init); -int mc13xxx_common_exit(struct device *dev) +void mc13xxx_common_exit(struct device *dev) { struct mc13xxx *mc13xxx = dev_get_drvdata(dev); mfd_remove_devices(dev); regmap_del_irq_chip(mc13xxx->irq, mc13xxx->irq_data); mutex_destroy(&mc13xxx->lock); - - return 0; } EXPORT_SYMBOL_GPL(mc13xxx_common_exit); diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 65b4dd8e5afb..fb937f66277e 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -87,7 +87,8 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, static int mc13xxx_i2c_remove(struct i2c_client *client) { - return mc13xxx_common_exit(&client->dev); + mc13xxx_common_exit(&client->dev); + return 0; } static struct i2c_driver mc13xxx_i2c_driver = { diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index 286ddcf5ddc6..4d8913d647e6 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -168,7 +168,8 @@ static int mc13xxx_spi_probe(struct spi_device *spi) static int mc13xxx_spi_remove(struct spi_device *spi) { - return mc13xxx_common_exit(&spi->dev); + mc13xxx_common_exit(&spi->dev); + return 0; } static struct spi_driver mc13xxx_spi_driver = { diff --git a/drivers/mfd/mc13xxx.h b/drivers/mfd/mc13xxx.h index ce6eec52e8eb..bd5ba9a0e14f 100644 --- a/drivers/mfd/mc13xxx.h +++ b/drivers/mfd/mc13xxx.h @@ -44,6 +44,6 @@ struct mc13xxx { }; int mc13xxx_common_init(struct device *dev); -int mc13xxx_common_exit(struct device *dev); +void mc13xxx_common_exit(struct device *dev); #endif /* __DRIVERS_MFD_MC13XXX_H */ From patchwork Tue Oct 12 15:39:34 2021 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: 12552961 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB2B7C433FE for ; Tue, 12 Oct 2021 15:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 958AB6108F for ; Tue, 12 Oct 2021 15:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237461AbhJLPmN (ORCPT ); Tue, 12 Oct 2021 11:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237566AbhJLPmI (ORCPT ); Tue, 12 Oct 2021 11:42:08 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EBCBC061765 for ; Tue, 12 Oct 2021 08:40:01 -0700 (PDT) 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 1maJsk-0000IJ-BW; Tue, 12 Oct 2021 17:39:58 +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.92) (envelope-from ) id 1maJsj-0004kE-QN; Tue, 12 Oct 2021 17:39:57 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004YN-Lr; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alexandre Torgue , Lee Jones , Maxime Coquelin Cc: Mark Brown , kernel@pengutronix.de, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v2 09/20] mfd: stmpe: Make stmpe_remove() return void Date: Tue, 12 Oct 2021 17:39:34 +0200 Message-Id: <20211012153945.2651412-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=SOnI2C3pbw0/O28+bQURH4mfZHs+NU3wIaeoHQEhKVQ=; m=WtM/zIhnsdBjs14lkJxT6oj9lbrAmktyLAk6bUH98nQ=; p=12TNER7mUCvsHC1mdfBXwGyRLzDN5LFZT6ziTZdlCA0=; g=86f514a8b5b16374e79dbf0810b2cbb16248162e X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrBMACgkQwfwUeK3K7AkJ2Qf+LCW +85vQ6tu/jWfSSgYAvn8LHz3+AajKY0uE/DwGlbw+H0cZTonSutyxs/n2tpOzZ3KT5dhXwEf8priE SUQcvBXiI9YcTNsRQLpm+kJnEcs1J/gbqLx9+/SXuw7zFzYwlCidx6xbvE0p1wQFAEeTjtfpI4cXc H4rA8+4Y8shGLzw1iaqwM5xoe6azGfj9Ys0K5os0/pADRFcF5k1bSqFrP5HPZgDA9SSRf9S31PEHZ 39uiQ4zAyuXJ7WAOFkE8AyX5vzFuJy13MmGM+DphylR7gRTgdlQDeDKfhXU/jx4miCXTl5HBQ3hTh /3mOtnGZsPUQEWgGE10bQ+Xb7F9gvbw== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now stmpe_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/mfd/stmpe-i2c.c | 4 +++- drivers/mfd/stmpe-spi.c | 4 +++- drivers/mfd/stmpe.c | 4 +--- drivers/mfd/stmpe.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index cd2f45257dc1..d3eedf3d607e 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c @@ -95,7 +95,9 @@ static int stmpe_i2c_remove(struct i2c_client *i2c) { struct stmpe *stmpe = dev_get_drvdata(&i2c->dev); - return stmpe_remove(stmpe); + stmpe_remove(stmpe); + + return 0; } static const struct i2c_device_id stmpe_i2c_id[] = { diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c index 7351734f7593..6c5915016be5 100644 --- a/drivers/mfd/stmpe-spi.c +++ b/drivers/mfd/stmpe-spi.c @@ -106,7 +106,9 @@ static int stmpe_spi_remove(struct spi_device *spi) { struct stmpe *stmpe = spi_get_drvdata(spi); - return stmpe_remove(stmpe); + stmpe_remove(stmpe); + + return 0; } static const struct of_device_id stmpe_spi_of_match[] = { diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 58d09c615e67..e928df95e316 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -1496,7 +1496,7 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum) return ret; } -int stmpe_remove(struct stmpe *stmpe) +void stmpe_remove(struct stmpe *stmpe) { if (!IS_ERR(stmpe->vio)) regulator_disable(stmpe->vio); @@ -1506,8 +1506,6 @@ int stmpe_remove(struct stmpe *stmpe) __stmpe_disable(stmpe, STMPE_BLOCK_ADC); mfd_remove_devices(stmpe->dev); - - return 0; } #ifdef CONFIG_PM diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h index 83491e99ba3c..1b4f91d03bbf 100644 --- a/drivers/mfd/stmpe.h +++ b/drivers/mfd/stmpe.h @@ -98,7 +98,7 @@ struct stmpe_client_info { }; int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum); -int stmpe_remove(struct stmpe *stmpe); +void stmpe_remove(struct stmpe *stmpe); #define STMPE_ICR_LSB_HIGH (1 << 2) #define STMPE_ICR_LSB_EDGE (1 << 1) From patchwork Tue Oct 12 15:39:35 2021 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: 12552945 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81E72C4332F for ; Tue, 12 Oct 2021 15:40:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CD0C610CC for ; Tue, 12 Oct 2021 15:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237519AbhJLPmB (ORCPT ); Tue, 12 Oct 2021 11:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237513AbhJLPmA (ORCPT ); Tue, 12 Oct 2021 11:42:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE498C061570 for ; Tue, 12 Oct 2021 08:39:58 -0700 (PDT) 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 1maJsg-0008RX-SM; Tue, 12 Oct 2021 17:39:54 +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.92) (envelope-from ) id 1maJsf-0004jh-SK; Tue, 12 Oct 2021 17:39:53 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004YQ-QX; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Lee Jones Cc: Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 10/20] mfd: tps65912: Make tps65912_device_exit() return void Date: Tue, 12 Oct 2021 17:39:35 +0200 Message-Id: <20211012153945.2651412-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=nx2G3bSXyIBmXaCH/JIMwwjfiGaioLfJDUtNgpYpxVg=; m=LMEJl9AEXG+mpOLwOIRYDu4jaVrbQ1G8O5KgAC1rhv4=; p=kmQFR3EAOk/QVFV0rwWjN00wyW1LWfMmamyUeZzQodw=; g=a9d478ecc85a81aad5001d3bdbf6a57f2e27c5c7 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrBYACgkQwfwUeK3K7Ak4ggf+KCE RtY38KnOc1s4VOsf14cNYW3JEmQ3+IH/7wLF/CepBLxpQ9vYekWzTIWeM/kcOgi0dko+jbFl/GL1/ 0CmUxarlws87FyZWMo8HoRGAlCSNi1GdVRdpnw85h+1pq1DKdL9NZ60RLiRJQ16qZ4lueg5mFlRPD agEMrj70dXA/4X4bwobg3Kv+ZUdSj43PMk+wyWUBYPReyxepIucKTePoO0URXUqR7sipQTYlOu4++ cKCRqclK5/iXAGaNYN8TXJADqDgDGDQPtRE8Yyc3IbyQyo0Cviq3kmHQUVTwSol+TpZP5vSyF55DM Nxohfb05EG5FVAxJU1+yIhZ0HBUaeTw== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now tps65912_device_exit() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/mfd/tps65912-core.c | 4 +--- drivers/mfd/tps65912-i2c.c | 4 +++- drivers/mfd/tps65912-spi.c | 4 +++- include/linux/mfd/tps65912.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c index b55b1d5d6955..c282a05e7146 100644 --- a/drivers/mfd/tps65912-core.c +++ b/drivers/mfd/tps65912-core.c @@ -115,11 +115,9 @@ int tps65912_device_init(struct tps65912 *tps) } EXPORT_SYMBOL_GPL(tps65912_device_init); -int tps65912_device_exit(struct tps65912 *tps) +void tps65912_device_exit(struct tps65912 *tps) { regmap_del_irq_chip(tps->irq, tps->irq_data); - - return 0; } EXPORT_SYMBOL_GPL(tps65912_device_exit); diff --git a/drivers/mfd/tps65912-i2c.c b/drivers/mfd/tps65912-i2c.c index f7c22ea7b36c..06eb2784d322 100644 --- a/drivers/mfd/tps65912-i2c.c +++ b/drivers/mfd/tps65912-i2c.c @@ -55,7 +55,9 @@ static int tps65912_i2c_remove(struct i2c_client *client) { struct tps65912 *tps = i2c_get_clientdata(client); - return tps65912_device_exit(tps); + tps65912_device_exit(tps); + + return 0; } static const struct i2c_device_id tps65912_i2c_id_table[] = { diff --git a/drivers/mfd/tps65912-spi.c b/drivers/mfd/tps65912-spi.c index 21a8d6ac5c4a..d701926aa46e 100644 --- a/drivers/mfd/tps65912-spi.c +++ b/drivers/mfd/tps65912-spi.c @@ -54,7 +54,9 @@ static int tps65912_spi_remove(struct spi_device *spi) { struct tps65912 *tps = spi_get_drvdata(spi); - return tps65912_device_exit(tps); + tps65912_device_exit(tps); + + return 0; } static const struct spi_device_id tps65912_spi_id_table[] = { diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h index 7943e413deae..8a61386cb8c1 100644 --- a/include/linux/mfd/tps65912.h +++ b/include/linux/mfd/tps65912.h @@ -322,6 +322,6 @@ struct tps65912 { extern const struct regmap_config tps65912_regmap_config; int tps65912_device_init(struct tps65912 *tps); -int tps65912_device_exit(struct tps65912 *tps); +void tps65912_device_exit(struct tps65912 *tps); #endif /* __LINUX_MFD_TPS65912_H */ From patchwork Tue Oct 12 15:39:36 2021 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: 12552969 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ABC4C4332F for ; Tue, 12 Oct 2021 15:40:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61E616109E for ; Tue, 12 Oct 2021 15:40:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237513AbhJLPmQ (ORCPT ); Tue, 12 Oct 2021 11:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237579AbhJLPmJ (ORCPT ); Tue, 12 Oct 2021 11:42:09 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 741BDC06176A for ; Tue, 12 Oct 2021 08:40:03 -0700 (PDT) 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 1maJsk-0000Ic-K5; Tue, 12 Oct 2021 17:39:58 +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.92) (envelope-from ) id 1maJsk-0004kc-2O; Tue, 12 Oct 2021 17:39:58 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsc-0004Ya-W8; Tue, 12 Oct 2021 17:39:50 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman , Michael Hennerich Cc: Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 11/20] misc: ad525x_dpot: Make ad_dpot_remove() return void Date: Tue, 12 Oct 2021 17:39:36 +0200 Message-Id: <20211012153945.2651412-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=EXMrVNkUbqY7V63T+YTPXXS2HlLbCtvatL19qm2WHtg=; m=BGTwvqK+RKGgnKfGCyGNhmDyuScjHEci5h4DxVv3qZM=; p=yQdEfF2PwN8/D0REJaPAIE32zm4eLHsNwhbjpfrb8sA=; g=815ab97c4c8e25de58d548a08c2b1645b2fa6f38 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrBoACgkQwfwUeK3K7AmGcggAoNS 06dPcnO+6j1pP3ayFGgKUoNViSu9t9pTbqsP+nGynrmy0BmboLt4Or9PtUDkjBYhe1oTm/epKjODS KxGtdXdOk9tf7GMUqobiMj0M4FlGAVQNrXVFvQ/865TGqZpKJIHM4DSpjH8UPbuskxMt8DT6PRp7G hr4EWdwFTvkgMLAebwxOFBAr1U+QaJRTT6S93oanABwCl4/MiiYlSj1DniyFCueVIJDejeoSI3b0Y NFxptp7/yvI45y+lp/xxwjy5fDwquaH1mz9At5lDQbojbBpPbkxJzwleqC7uRc5eDHHuJAYwMz6qf V5aUXMHf5vbb9KEcNPIIHKo8JUctJ/Q== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now ad_dpot_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König Acked-by: Michael Hennerich --- drivers/misc/ad525x_dpot-i2c.c | 3 ++- drivers/misc/ad525x_dpot-spi.c | 3 ++- drivers/misc/ad525x_dpot.c | 4 +--- drivers/misc/ad525x_dpot.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/misc/ad525x_dpot-i2c.c b/drivers/misc/ad525x_dpot-i2c.c index bd869ec5edba..0ee0c6d808c3 100644 --- a/drivers/misc/ad525x_dpot-i2c.c +++ b/drivers/misc/ad525x_dpot-i2c.c @@ -69,7 +69,8 @@ static int ad_dpot_i2c_probe(struct i2c_client *client, static int ad_dpot_i2c_remove(struct i2c_client *client) { - return ad_dpot_remove(&client->dev); + ad_dpot_remove(&client->dev); + return 0; } static const struct i2c_device_id ad_dpot_id[] = { diff --git a/drivers/misc/ad525x_dpot-spi.c b/drivers/misc/ad525x_dpot-spi.c index aea931dd272e..a9e75d80ad36 100644 --- a/drivers/misc/ad525x_dpot-spi.c +++ b/drivers/misc/ad525x_dpot-spi.c @@ -92,7 +92,8 @@ static int ad_dpot_spi_probe(struct spi_device *spi) static int ad_dpot_spi_remove(struct spi_device *spi) { - return ad_dpot_remove(&spi->dev); + ad_dpot_remove(&spi->dev); + return 0; } static const struct spi_device_id ad_dpot_spi_id[] = { diff --git a/drivers/misc/ad525x_dpot.c b/drivers/misc/ad525x_dpot.c index 5d8f3f6a95f2..756ef6912b5a 100644 --- a/drivers/misc/ad525x_dpot.c +++ b/drivers/misc/ad525x_dpot.c @@ -743,7 +743,7 @@ int ad_dpot_probe(struct device *dev, } EXPORT_SYMBOL(ad_dpot_probe); -int ad_dpot_remove(struct device *dev) +void ad_dpot_remove(struct device *dev) { struct dpot_data *data = dev_get_drvdata(dev); int i; @@ -753,8 +753,6 @@ int ad_dpot_remove(struct device *dev) ad_dpot_remove_files(dev, data->feat, i); kfree(data); - - return 0; } EXPORT_SYMBOL(ad_dpot_remove); diff --git a/drivers/misc/ad525x_dpot.h b/drivers/misc/ad525x_dpot.h index ee8dc9f5a45a..72a9d6801937 100644 --- a/drivers/misc/ad525x_dpot.h +++ b/drivers/misc/ad525x_dpot.h @@ -209,6 +209,6 @@ struct ad_dpot_bus_data { int ad_dpot_probe(struct device *dev, struct ad_dpot_bus_data *bdata, unsigned long devid, const char *name); -int ad_dpot_remove(struct device *dev); +void ad_dpot_remove(struct device *dev); #endif From patchwork Tue Oct 12 15:39:37 2021 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: 12552971 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D2EFC433F5 for ; Tue, 12 Oct 2021 15:40:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23BD36108F for ; Tue, 12 Oct 2021 15:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237566AbhJLPmX (ORCPT ); Tue, 12 Oct 2021 11:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237599AbhJLPmO (ORCPT ); Tue, 12 Oct 2021 11:42:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE176C06174E for ; Tue, 12 Oct 2021 08:40:12 -0700 (PDT) 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 1maJsk-0000In-VL; Tue, 12 Oct 2021 17:39:59 +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.92) (envelope-from ) id 1maJsk-0004lT-Am; Tue, 12 Oct 2021 17:39:58 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsd-0004Yd-5J; Tue, 12 Oct 2021 17:39:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Eric Piel , Greg Kroah-Hartman , Hans de Goede , Mark Gross Cc: Mark Brown , kernel@pengutronix.de, linux-spi@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: [PATCH v2 12/20] misc: lis3lv02d: Make lis3lv02d_remove_fs() return void Date: Tue, 12 Oct 2021 17:39:37 +0200 Message-Id: <20211012153945.2651412-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=WWMONXS4nQyU8LWJfp5LQwiwkNadPD19C12YOs6BjVY=; m=EvLChWJEMdkgjbEsXVN6Tz2xXArpU22O6tu5BfLNtt4=; p=byHwshnJ1HXVTYPhlZe1MP3r9RDx0xvXW0YzUKY8y4U=; g=fb6c05d76d7186cee9555ca62f10f13d9cb21e0b X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrB0ACgkQwfwUeK3K7AntmwgAizc 4ZLndCQSQvNPnnd6VQaNAowrpYfjodoF6V9t42rOpFjQzX5hHXo9dbydNWaqFqlhstEyKY0l01G6h K5CNfCO5OMobY0irptnCsmttTjvylRCxebMLjGqDYm+jlA48WYiWhoCdIkTL4wpHj0hAenynVuAUa FcQvPSEiC1y14RMpgP7zycmcCBa8al4NO2zRsCjnIMjRfPvGHEaFFkNwSpHCioDbZsAw5s/Q+hnC+ q+LTJTHEQc9bNHi2MOQByDI1v3HGkLhTGt/uLjPfms7Qj5EKibZ0+uy7YvVxzXaUkg+gBnCAAmDTO +q4cVFlG+wOSBnV4RDJlX15UkQ3hMuw== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now lis3lv02d_remove_fs() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König Reviewed-by: Hans de Goede --- drivers/misc/lis3lv02d/lis3lv02d.c | 3 +-- drivers/misc/lis3lv02d/lis3lv02d.h | 2 +- drivers/misc/lis3lv02d/lis3lv02d_spi.c | 4 +++- drivers/platform/x86/hp_accel.c | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 70c5bb1e6f49..3a7808b796b1 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -878,7 +878,7 @@ static int lis3lv02d_add_fs(struct lis3lv02d *lis3) return sysfs_create_group(&lis3->pdev->dev.kobj, &lis3lv02d_attribute_group); } -int lis3lv02d_remove_fs(struct lis3lv02d *lis3) +void lis3lv02d_remove_fs(struct lis3lv02d *lis3) { sysfs_remove_group(&lis3->pdev->dev.kobj, &lis3lv02d_attribute_group); platform_device_unregister(lis3->pdev); @@ -894,7 +894,6 @@ int lis3lv02d_remove_fs(struct lis3lv02d *lis3) pm_runtime_set_suspended(lis3->pm_dev); } kfree(lis3->reg_cache); - return 0; } EXPORT_SYMBOL_GPL(lis3lv02d_remove_fs); diff --git a/drivers/misc/lis3lv02d/lis3lv02d.h b/drivers/misc/lis3lv02d/lis3lv02d.h index c394c0b08519..195bd2fd2eb5 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.h +++ b/drivers/misc/lis3lv02d/lis3lv02d.h @@ -312,7 +312,7 @@ int lis3lv02d_joystick_enable(struct lis3lv02d *lis3); void lis3lv02d_joystick_disable(struct lis3lv02d *lis3); void lis3lv02d_poweroff(struct lis3lv02d *lis3); int lis3lv02d_poweron(struct lis3lv02d *lis3); -int lis3lv02d_remove_fs(struct lis3lv02d *lis3); +void lis3lv02d_remove_fs(struct lis3lv02d *lis3); int lis3lv02d_init_dt(struct lis3lv02d *lis3); extern struct lis3lv02d lis3_dev; diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index f664ed123730..9e40dfb60742 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -102,7 +102,9 @@ static int lis302dl_spi_remove(struct spi_device *spi) lis3lv02d_joystick_disable(lis3); lis3lv02d_poweroff(lis3); - return lis3lv02d_remove_fs(&lis3_dev); + lis3lv02d_remove_fs(&lis3_dev); + + return 0; } #ifdef CONFIG_PM_SLEEP diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c index cc53f725c041..b183967ecfb7 100644 --- a/drivers/platform/x86/hp_accel.c +++ b/drivers/platform/x86/hp_accel.c @@ -349,7 +349,8 @@ static int lis3lv02d_remove(struct platform_device *device) led_classdev_unregister(&hpled_led.led_classdev); flush_work(&hpled_led.work); - return lis3lv02d_remove_fs(&lis3_dev); + lis3lv02d_remove_fs(&lis3_dev); + return 0; } #ifdef CONFIG_PM_SLEEP From patchwork Tue Oct 12 15:39:38 2021 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: 12552975 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9D7FC433EF for ; Tue, 12 Oct 2021 15:40:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C364F6108F for ; Tue, 12 Oct 2021 15:40:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237576AbhJLPmX (ORCPT ); Tue, 12 Oct 2021 11:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237516AbhJLPmQ (ORCPT ); Tue, 12 Oct 2021 11:42:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81F03C061765 for ; Tue, 12 Oct 2021 08:40:14 -0700 (PDT) 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 1maJst-0000hT-Hg; Tue, 12 Oct 2021 17:40:07 +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.92) (envelope-from ) id 1maJss-0004mN-PB; Tue, 12 Oct 2021 17:40:06 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsd-0004Yg-AC; Tue, 12 Oct 2021 17:39:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Mark Brown , Tudor Ambarus , kernel@pengutronix.de, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH v2 13/20] mtd: dataflash: Warn about failure to unregister mtd device Date: Tue, 12 Oct 2021 17:39:38 +0200 Message-Id: <20211012153945.2651412-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=2VqFZIno/yGWsKtWn0NIvGoO0BsdZpAyUJM3JsTcgVQ=; m=aWXlVn4zGl3/VNxE8xQ1auTXzJiWk3xyQCYCHspYcNI=; p=16dswzFeECicSzBQSJ0SvtjK+opu7BN5qXI4WIJZwCw=; g=4c0006553a00ca9772c08d8155c3e429fb469b7b X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrCAACgkQwfwUeK3K7Alhzgf7Bnt 6NQEigDpsGNLR4Myl4ULhsm8W+utz3BBsS3tu1LnZ0L+/KEVHfNOrQ1S+vkblFJ6JY0R69KN47agg y59Tdik0oGDpjLURzS6MdNk+Q4/5zZo6vX82yM08oabjCPkJh/FDMxB4P7MEVE0WDgyeXdGmqJdwH KqyUh4HH8dv8ZM/ph+H0TBSnPnY//97FeHPY8hLaOac4rWkk8yusOkaS3mz+05oXoQz4k7oKKHftH q9TzY9yMqAIIHGgRPze5NgG7Q4O4QyG7h0E0Sv2b2NFMIlTw87Ky3BsxvqbVTxa/u/t66ZODGiUgc oP+AB9hEZN4JtSTDgGIGBTUa8DyJk9A== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/mtd_dataflash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 9802e265fca8..2691b6b79df8 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -919,7 +919,10 @@ static int dataflash_remove(struct spi_device *spi) status = mtd_device_unregister(&flash->mtd); if (status == 0) kfree(flash); - return status; + else + dev_warn(&spi->dev, "Failed to unregister mtd device (%pe)\n", + ERR_PTR(status)); + return 0; } static struct spi_driver dataflash_driver = { From patchwork Tue Oct 12 15:39:39 2021 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: 12552965 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03A06C433EF for ; Tue, 12 Oct 2021 15:40:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E32F16108F for ; Tue, 12 Oct 2021 15:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237609AbhJLPmP (ORCPT ); Tue, 12 Oct 2021 11:42:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237586AbhJLPmJ (ORCPT ); Tue, 12 Oct 2021 11:42:09 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190A5C06176F for ; Tue, 12 Oct 2021 08:40:05 -0700 (PDT) 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 1maJsl-0000JF-BY; Tue, 12 Oct 2021 17:39:59 +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.92) (envelope-from ) id 1maJsk-0004lk-Iw; Tue, 12 Oct 2021 17:39:58 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsd-0004Yj-Eg; Tue, 12 Oct 2021 17:39:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Mark Brown , kernel@pengutronix.de, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH v2 14/20] mtd: mchp23k256: Warn about failure to unregister mtd device Date: Tue, 12 Oct 2021 17:39:39 +0200 Message-Id: <20211012153945.2651412-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=oQ0rhox5HEbwbc0e75w1kKEc23U+uF8p5JmZ7F33OK0=; m=aWXlVn4zGl3/VNxE8xQ1auTXzJiWk3xyQCYCHspYcNI=; p=qd3VQORiTd+2PycmNSRq+P7NPYQTqLjcNuVof7YmoX0=; g=e977070b7429d85799af28daa3a1f14654179392 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrCMACgkQwfwUeK3K7AkE9wgAjcV V25oLZh1d0i5sng1FwvkK7nUZrkAggWQIZnkEIvV87joBYdT9N3wcykRaiPSqPqlfvDLpSdPbAYJV YQDkg6CmVGTDbhevroZRbc2I2mA+Nt534QSMFfI8HQbpvKDnQ5ofK5cRwSWyIUqP3iMAmYbqajPJO 2am5RkRd0bMcfqleNz3EkRZJh0VRa8+QV9RoorgZcVD9Te0P/Pc4DAIdQoYUq30/Ds+KHlygdZ8K/ Lsrvg58v220dWxA11N6s6LUgs+dxW+evdpSCf9CBWJWSF2wS26AjH7mNvbfSfUc1quNeI1y7sAmgH 4Z+KdkTnr0/E6PMEl7/F0wC+EvzJrnA== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/mchp23k256.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c index 77c872fd3d83..23213009ebf4 100644 --- a/drivers/mtd/devices/mchp23k256.c +++ b/drivers/mtd/devices/mchp23k256.c @@ -212,8 +212,15 @@ static int mchp23k256_probe(struct spi_device *spi) static int mchp23k256_remove(struct spi_device *spi) { struct mchp23k256_flash *flash = spi_get_drvdata(spi); + int ret; - return mtd_device_unregister(&flash->mtd); + ret = mtd_device_unregister(&flash->mtd); + if (ret) + /* There is nothing we can do about this ... */ + dev_warn(&spi->dev, "Failed to unregister mtd device (%pe)\n", + ERR_PTR(ret)); + + return 0; } static const struct of_device_id mchp23k256_of_table[] = { From patchwork Tue Oct 12 15:39:40 2021 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: 12552973 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31275C4332F for ; Tue, 12 Oct 2021 15:40:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A45C601FF for ; Tue, 12 Oct 2021 15:40:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237516AbhJLPmY (ORCPT ); Tue, 12 Oct 2021 11:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237554AbhJLPmQ (ORCPT ); Tue, 12 Oct 2021 11:42:16 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC583C061570 for ; Tue, 12 Oct 2021 08:40:14 -0700 (PDT) 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 1maJst-0000ht-RM; Tue, 12 Oct 2021 17:40:07 +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.92) (envelope-from ) id 1maJst-0004mQ-1I; Tue, 12 Oct 2021 17:40:07 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsd-0004Ym-Ja; Tue, 12 Oct 2021 17:39:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Colin Ian King , Dan Carpenter , Fabio Estevam , Heiko Schocher , Mark Brown , kernel@pengutronix.de, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH v2 15/20] mtd: mchp48l640: Warn about failure to unregister mtd device Date: Tue, 12 Oct 2021 17:39:40 +0200 Message-Id: <20211012153945.2651412-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=KPueYbzN9LsEzHTCniRvcOu6N1K1tzW4s5WqwnR8va8=; m=aWXlVn4zGl3/VNxE8xQ1auTXzJiWk3xyQCYCHspYcNI=; p=FVG/f8D5OMv+6zHQi0LEySf59uooBM1A6otMYWx90Jo=; g=6463cff8dfe6da637770875deae96bedaf2afd8a X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrCYACgkQwfwUeK3K7An3Nwf/WXu jfvNabwoFPSNIxb8bkOy5RAOhKb23xPLjHY4UjV+pX+ycBjJrnh4F4HTJGUCg+CVbiL6L8y9cTPS4 FmdhdkenR90XYefsNf7ZJdCfLxIWQu4A9W67wDs4VX6wU16g+D9G40Q2qQtjD4hmecoKIkvNxx9yR PrMfF++7OQQPIECqBy1mQpXvAJ+GI0qBhYnwJntJ3vjpJf4djt6wzwLM0vx1mw7SFD9E5UPAthfe+ VcB51aDJh0iehgoZ6usEprA9E9wcndz48jDsvC4DB6pYt1mAVc8/9GdAgfpk6zJHGi5Cq0EdnHwdi iqVWyiWwbXZkgjekoF7f/IRsvEuUK9Q== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/mchp48l640.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c index 99400d0fb8c1..b87f7eca3e64 100644 --- a/drivers/mtd/devices/mchp48l640.c +++ b/drivers/mtd/devices/mchp48l640.c @@ -344,8 +344,14 @@ static int mchp48l640_probe(struct spi_device *spi) static int mchp48l640_remove(struct spi_device *spi) { struct mchp48l640_flash *flash = spi_get_drvdata(spi); + int ret; + + ret = mtd_device_unregister(&flash->mtd); + if (ret) + dev_warn(&spi->dev, "Failed to unregister mtd device (%pe)\n", + ERR_PTR(ret)); - return mtd_device_unregister(&flash->mtd); + return 0; } static const struct of_device_id mchp48l640_of_table[] = { From patchwork Tue Oct 12 15:39:41 2021 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: 12552955 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FC90C43219 for ; Tue, 12 Oct 2021 15:40:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B43661076 for ; Tue, 12 Oct 2021 15:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237542AbhJLPmK (ORCPT ); Tue, 12 Oct 2021 11:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237537AbhJLPmC (ORCPT ); Tue, 12 Oct 2021 11:42:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCA44C061753 for ; Tue, 12 Oct 2021 08:40:00 -0700 (PDT) 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 1maJse-0008NW-M2; Tue, 12 Oct 2021 17:39:52 +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.92) (envelope-from ) id 1maJsd-0004in-Ps; Tue, 12 Oct 2021 17:39:51 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsd-0004Yp-Om; Tue, 12 Oct 2021 17:39:51 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: Mark Brown , kernel@pengutronix.de, linux-mtd@lists.infradead.org, linux-spi@vger.kernel.org Subject: [PATCH v2 16/20] mtd: sst25l: Warn about failure to unregister mtd device Date: Tue, 12 Oct 2021 17:39:41 +0200 Message-Id: <20211012153945.2651412-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=chTrsNwtyvGFDidu8JfqkR8D1NeBCtiv8G0Xdn/Msdg=; m=aWXlVn4zGl3/VNxE8xQ1auTXzJiWk3xyQCYCHspYcNI=; p=TyuS/iMN/2qfQLKMz56PvUq4wtcc0B7f+zs42TknICw=; g=c6b8458784ebb8ccbecde25a4af573d5e8fd863b X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrCkACgkQwfwUeK3K7AnDkQf+Nb3 3j5Jgm1majYjJ+sScbZ2HOkWGFVOQWeTvYfeytVvtxml2BbCSUhRa60oI3pnRl8KZpf1LSPtBx0Lv gw0p6PqXhs0kpkFsu1zukS4yPR4O6U+11E+3KrCQvgpXZtpIEuMYwdqirjME5jbPloH2LftzFCXeT C85UknBWop/d3AD0ivfVGL7M8x7iMrhPacg6H8/x6CoOp9UyiWor0X9qahA3FpnSQBd1SmA8HhPoO 2jnNcag0IBYeCs08IYABkj1kdMk3CFurya0dEyMO774G3TwA+fP+nWl2cZRZKf6iKGPzY98B9xCVZ sh77HoYmLIWw5+szDsL7QgTVpm7ueDA== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org When an spi driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Signed-off-by: Uwe Kleine-König --- drivers/mtd/devices/sst25l.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/sst25l.c b/drivers/mtd/devices/sst25l.c index b81c3f0b85f9..04062a1f54c1 100644 --- a/drivers/mtd/devices/sst25l.c +++ b/drivers/mtd/devices/sst25l.c @@ -401,8 +401,14 @@ static int sst25l_probe(struct spi_device *spi) static int sst25l_remove(struct spi_device *spi) { struct sst25l_flash *flash = spi_get_drvdata(spi); + int ret; + + ret = mtd_device_unregister(&flash->mtd); + if (ret) + dev_warn(&spi->dev, "Failed to unregister mtd device (%pe)\n", + ERR_PTR(ret)); - return mtd_device_unregister(&flash->mtd); + return 0; } static struct spi_driver sst25l_driver = { From patchwork Tue Oct 12 15:39:42 2021 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: 12552951 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF4C9C433EF for ; Tue, 12 Oct 2021 15:40:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A644061076 for ; Tue, 12 Oct 2021 15:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237569AbhJLPmI (ORCPT ); Tue, 12 Oct 2021 11:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237516AbhJLPmC (ORCPT ); Tue, 12 Oct 2021 11:42:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F96BC061749 for ; Tue, 12 Oct 2021 08:40:00 -0700 (PDT) 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 1maJsi-0000Af-3J; Tue, 12 Oct 2021 17:39:56 +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.92) (envelope-from ) id 1maJsh-0004jq-GW; Tue, 12 Oct 2021 17:39:55 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJse-0004Z0-EV; Tue, 12 Oct 2021 17:39:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Mark Brown , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 17/20] serial: max310x: Make max310x_remove() return void Date: Tue, 12 Oct 2021 17:39:42 +0200 Message-Id: <20211012153945.2651412-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=X+8kXHVoMLlUbvR5fe1/gT2QigYKhx+Pwe/X6mIJSOE=; m=dpk5iT4UJQeM0ZBMzrFgdHLqDzvAfkfqyfi4buOfFCI=; p=jl7BJx7UNvJ6kdZKTi6IywhHgXu7PYGvkRZwcI69alQ=; g=2d5080d5848c1455a8b7930e10f4aa7e2d5d4674 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrCwACgkQwfwUeK3K7AnvBQf/Tgu FBpEIBn09cjtcI2Mbyuj3PtePB60usUV774JUBckB/pk27+HIZnAHQeZWarD5TFcTBX4hbeIDAJlp Ck/7mokoMRtq7xGlJW87yRAcS47NQORh9EdDQNR0/CXoBHk6gcBj0Of+jEI4nxw6nRKdConVB7ovo JRnI3LG7sUD/ZakPby+W8zedld/x/46WA/6V0rjHtEdql77QsoBrIA2UW2fIwJwXz40QiHw4WxdA5 VDNZMsvzoUsksqFSDDQB1V8T2oeE77eI4TnaboNCwrG5FxKRUuw/G7ib5s0b50Z+xseWDyQgk0VCT +XVbEQUTa2EqcWeB/KyVwgt6LMSl2/A== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now max310x_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/tty/serial/max310x.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 3df0788ddeb0..dde0824b2fa5 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1426,7 +1426,7 @@ static int max310x_probe(struct device *dev, const struct max310x_devtype *devty return ret; } -static int max310x_remove(struct device *dev) +static void max310x_remove(struct device *dev) { struct max310x_port *s = dev_get_drvdata(dev); int i; @@ -1441,8 +1441,6 @@ static int max310x_remove(struct device *dev) } clk_disable_unprepare(s->clk); - - return 0; } static const struct of_device_id __maybe_unused max310x_dt_ids[] = { @@ -1491,7 +1489,8 @@ static int max310x_spi_probe(struct spi_device *spi) static int max310x_spi_remove(struct spi_device *spi) { - return max310x_remove(&spi->dev); + max310x_remove(&spi->dev); + return 0; } static const struct spi_device_id max310x_id_table[] = { From patchwork Tue Oct 12 15:39:43 2021 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: 12552967 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D613EC433F5 for ; Tue, 12 Oct 2021 15:40:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C166861076 for ; Tue, 12 Oct 2021 15:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237612AbhJLPmQ (ORCPT ); Tue, 12 Oct 2021 11:42:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237589AbhJLPmJ (ORCPT ); Tue, 12 Oct 2021 11:42:09 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9119DC061772 for ; Tue, 12 Oct 2021 08:40:05 -0700 (PDT) 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 1maJsn-0000Nb-27; Tue, 12 Oct 2021 17:40:01 +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.92) (envelope-from ) id 1maJsl-0004mD-Rx; Tue, 12 Oct 2021 17:39:59 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJse-0004Z3-JJ; Tue, 12 Oct 2021 17:39:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Mark Brown , kernel@pengutronix.de, linux-serial@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 18/20] serial: sc16is7xx: Make sc16is7xx_remove() return void Date: Tue, 12 Oct 2021 17:39:43 +0200 Message-Id: <20211012153945.2651412-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=4Pou8jXQbhOkXAt6/muRjkP0OfJUPHt75pctr7W+qqQ=; m=FIxK0yiWgNMRKKImS8BCXtEUBZW2wFh2le6TX2NO04A=; p=Y2/spG10FZuOVKKCfBzsrca0ACgAG7pF66CtGegD8JQ=; g=4125ad5aa361e24225170e3f9083b1a39652127c X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrC8ACgkQwfwUeK3K7AkSPAf+LMT SgAFO3tZNZZ1LDwGN+CELqcna7S0o6KZVS00mDiv8s1CojK3MIWyqch1Qt1dv03uGl6MUqIMNknYN CPS/0qOSDITDrdtaCQmyXaL03YjZcVdj7nH7PscGQfpvE2CgllPJZG5GJ4HRjN88uucr3iwtd6kId 4b4VXSYei502hNrn8MxaAtbyNbLEjbc6iSH+Bs6QEVHSG6a5tcwkgsH+VIuGhPXCepjei/FeW6gI/ utPuAxfrrEDaubt+MG6Go7cq34GUyVHjOLC5xSZU1sqYrP6qAMUCyJrLyfDqXXC5KSpZtrXm3ZJ2D YwkzB3dbDGyCUsp01wa3Mtbz7LNTamQ== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now sc16is7xx_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/tty/serial/sc16is7xx.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index acbb615dd28f..64e7e6c8145f 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1365,7 +1365,7 @@ static int sc16is7xx_probe(struct device *dev, return ret; } -static int sc16is7xx_remove(struct device *dev) +static void sc16is7xx_remove(struct device *dev) { struct sc16is7xx_port *s = dev_get_drvdata(dev); int i; @@ -1385,8 +1385,6 @@ static int sc16is7xx_remove(struct device *dev) kthread_stop(s->kworker_task); clk_disable_unprepare(s->clk); - - return 0; } static const struct of_device_id __maybe_unused sc16is7xx_dt_ids[] = { @@ -1444,7 +1442,9 @@ static int sc16is7xx_spi_probe(struct spi_device *spi) static int sc16is7xx_spi_remove(struct spi_device *spi) { - return sc16is7xx_remove(&spi->dev); + sc16is7xx_remove(&spi->dev); + + return 0; } static const struct spi_device_id sc16is7xx_spi_id_table[] = { @@ -1497,7 +1497,9 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c, static int sc16is7xx_i2c_remove(struct i2c_client *client) { - return sc16is7xx_remove(&client->dev); + sc16is7xx_remove(&client->dev); + + return 0; } static const struct i2c_device_id sc16is7xx_i2c_id_table[] = { From patchwork Tue Oct 12 15:39:44 2021 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: 12552963 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A9FCC433F5 for ; Tue, 12 Oct 2021 15:40:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 275EF6108F for ; Tue, 12 Oct 2021 15:40:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237562AbhJLPmO (ORCPT ); Tue, 12 Oct 2021 11:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237592AbhJLPmK (ORCPT ); Tue, 12 Oct 2021 11:42:10 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D218C061773 for ; Tue, 12 Oct 2021 08:40:06 -0700 (PDT) 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 1maJsj-0008P8-SS; Tue, 12 Oct 2021 17:39:57 +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.92) (envelope-from ) id 1maJse-0004je-Tx; Tue, 12 Oct 2021 17:39:52 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJse-0004Z6-Sr; Tue, 12 Oct 2021 17:39:52 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Greg Kroah-Hartman Cc: Andy Shevchenko , Len Baker , Mark Brown , Phil Reid , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, linux-fbdev@vger.kernel.org, linux-spi@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH v2 19/20] staging: fbtft: Make fbtft_remove_common() return void Date: Tue, 12 Oct 2021 17:39:44 +0200 Message-Id: <20211012153945.2651412-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=/RLR4bDyADQRwzANF6ER5sKrX+JFDYSh90Q0J5N84UY=; m=6FiNYI6au9uFB2IoKzr/cKU1LkGxlwoXSYCPM/+GX+Y=; p=wOY1n0CZ/7bAct64lOvb3N+O46QD12yDtQU8vjW2ZLM=; g=617a3f39318dbfdbd2bc6b4d809ee0c624c7a08a X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrDIACgkQwfwUeK3K7AlRlgf+KW+ zCwB5yRA4XahfU4N7wEcoQOaol/eZYbQB+BPqzOx3W7M/m2wfjvvQ4H2s3r9EqyqgIM+TdFj5pBGc 7DCoGIopGX9VUUf2piVRYIvFNXdr9FvJz7CZK6TfIcKQK4J6cOiRVQEba8JjlhRHw59NjDI6KlJTU jPeqHDZhY68JfSFoZjIQ6pmCNnhZ5CE6N3gqi1Ya3Gc5kyniecxUE3DLV8FDoNoOtab73ZAHG8Tn8 WPJEb6Hkvv1mbjbxu20jJu7ZWcse728icuFy6MoAq4T7D8JmOqL4YPg1uzpj2M2Jd1S5DjHnDIvCa V2qrI+mqEmgZM+9mAQmYbhCacNgrA6A== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org fbtft_remove_common() is only called with a non-NULL fb_info. (All callers are in remove callbacks and the matching probe callbacks set driver data accordingly.) So fbtft_remove_common() always returns zero. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of platform and spi remove callbacks is ignored anyway and not freeing resources in .remove() is a bad idea. Signed-off-by: Uwe Kleine-König Acked-by: Andy Shevchenko --- drivers/staging/fbtft/fbtft-core.c | 8 +------- drivers/staging/fbtft/fbtft.h | 8 +++++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index ed992ca605eb..9c9eab1182a6 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -1318,23 +1318,17 @@ EXPORT_SYMBOL(fbtft_probe_common); * @info: Framebuffer * * Unregisters and releases the framebuffer - * - * Return: 0 if successful, negative if error */ -int fbtft_remove_common(struct device *dev, struct fb_info *info) +void fbtft_remove_common(struct device *dev, struct fb_info *info) { struct fbtft_par *par; - if (!info) - return -EINVAL; par = info->par; if (par) fbtft_par_dbg(DEBUG_DRIVER_INIT_FUNCTIONS, par, "%s()\n", __func__); fbtft_unregister_framebuffer(info); fbtft_framebuffer_release(info); - - return 0; } EXPORT_SYMBOL(fbtft_remove_common); diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h index 76f8c090a837..6869f3603b0e 100644 --- a/drivers/staging/fbtft/fbtft.h +++ b/drivers/staging/fbtft/fbtft.h @@ -252,7 +252,7 @@ void fbtft_unregister_backlight(struct fbtft_par *par); int fbtft_init_display(struct fbtft_par *par); int fbtft_probe_common(struct fbtft_display *display, struct spi_device *sdev, struct platform_device *pdev); -int fbtft_remove_common(struct device *dev, struct fb_info *info); +void fbtft_remove_common(struct device *dev, struct fb_info *info); /* fbtft-io.c */ int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len); @@ -283,7 +283,8 @@ static int fbtft_driver_remove_spi(struct spi_device *spi) \ { \ struct fb_info *info = spi_get_drvdata(spi); \ \ - return fbtft_remove_common(&spi->dev, info); \ + fbtft_remove_common(&spi->dev, info); \ + return 0; \ } \ \ static int fbtft_driver_probe_pdev(struct platform_device *pdev) \ @@ -295,7 +296,8 @@ static int fbtft_driver_remove_pdev(struct platform_device *pdev) \ { \ struct fb_info *info = platform_get_drvdata(pdev); \ \ - return fbtft_remove_common(&pdev->dev, info); \ + fbtft_remove_common(&pdev->dev, info); \ + return 0; \ } \ \ static const struct of_device_id dt_ids[] = { \ From patchwork Tue Oct 12 15:39:45 2021 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: 12552953 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9064DC4332F for ; Tue, 12 Oct 2021 15:40:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 777E661076 for ; Tue, 12 Oct 2021 15:40:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237522AbhJLPmK (ORCPT ); Tue, 12 Oct 2021 11:42:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237532AbhJLPmC (ORCPT ); Tue, 12 Oct 2021 11:42:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9A0C061745 for ; Tue, 12 Oct 2021 08:40:00 -0700 (PDT) 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 1maJsi-0000GR-MA; Tue, 12 Oct 2021 17:39:56 +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.92) (envelope-from ) id 1maJsi-0004jt-3w; Tue, 12 Oct 2021 17:39:56 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1maJsf-0004ZK-1f; Tue, 12 Oct 2021 17:39:53 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jarkko Sakkinen , Jason Gunthorpe , Peter Huewe Cc: Mark Brown , kernel@pengutronix.de, linux-integrity@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH v2 20/20] tpm: st33zp24: Make st33zp24_remove() return void Date: Tue, 12 Oct 2021 17:39:45 +0200 Message-Id: <20211012153945.2651412-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> References: <20211012153945.2651412-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=2RfjlQngpYVdDmF7/sh7VSPt9aAaxh1F9oCTWbtcFaI=; m=YmvLiK47JXRlSzLFzxqwlRAcg9TrPiYd49fSIG4963c=; p=J4sUOjxlatUSZp6KZXQHP7X5Nt2PutSw8I364wwqzYo=; g=fcea7ec8c956ac6a1c9afce0aa9705bb0fa52453 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFlrDsACgkQwfwUeK3K7Al++wf/T7U BatUKSlTBuJgmVw3wJPKYATQxH2k+OkCGL8UcAuKk++dm+EX1WT6PF/3yyhszwvZmFK8NkysabDTK OKDMQ+V3fg/dlAaVYv3L8uqC/BHO9qL0lffpGhogS1uF1UMbnO0IP2k/HqRxknijkWWsN5JfjAC5M 7CiYl8yhdAaYuzXqxQSL27iV2QicbzQjZ9gSpENmnJ0gdvlge+G3FAq6Fh0DXdF+SyhtGYM2ZV+Px XWAQLPxTRP+4PrpBAuJIdmsVzUzvw/9ANbXmqxoh4Js27SZt1pYgZrcXBezQWTSNIUFb9CreIdOUG ZHiIasfdEq0A+UmpOcxU1FfA8J2DwFQ== 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-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Up to now st33zp24_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König --- drivers/char/tpm/st33zp24/i2c.c | 5 +---- drivers/char/tpm/st33zp24/spi.c | 5 +---- drivers/char/tpm/st33zp24/st33zp24.c | 3 +-- drivers/char/tpm/st33zp24/st33zp24.h | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index 7c617edff4ca..3170d59d660c 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -267,11 +267,8 @@ static int st33zp24_i2c_probe(struct i2c_client *client, static int st33zp24_i2c_remove(struct i2c_client *client) { struct tpm_chip *chip = i2c_get_clientdata(client); - int ret; - ret = st33zp24_remove(chip); - if (ret) - return ret; + st33zp24_remove(chip); return 0; } diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c index a75dafd39445..ccd9e42b8eab 100644 --- a/drivers/char/tpm/st33zp24/spi.c +++ b/drivers/char/tpm/st33zp24/spi.c @@ -384,11 +384,8 @@ static int st33zp24_spi_probe(struct spi_device *dev) static int st33zp24_spi_remove(struct spi_device *dev) { struct tpm_chip *chip = spi_get_drvdata(dev); - int ret; - ret = st33zp24_remove(chip); - if (ret) - return ret; + st33zp24_remove(chip); return 0; } diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c index 4ec10ab5e576..2b63654c38d6 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.c +++ b/drivers/char/tpm/st33zp24/st33zp24.c @@ -588,10 +588,9 @@ EXPORT_SYMBOL(st33zp24_probe); * @param: tpm_data, the tpm phy. * @return: 0 in case of success. */ -int st33zp24_remove(struct tpm_chip *chip) +void st33zp24_remove(struct tpm_chip *chip) { tpm_chip_unregister(chip); - return 0; } EXPORT_SYMBOL(st33zp24_remove); diff --git a/drivers/char/tpm/st33zp24/st33zp24.h b/drivers/char/tpm/st33zp24/st33zp24.h index 6747be1e2502..b387a476c555 100644 --- a/drivers/char/tpm/st33zp24/st33zp24.h +++ b/drivers/char/tpm/st33zp24/st33zp24.h @@ -34,5 +34,5 @@ int st33zp24_pm_resume(struct device *dev); int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops, struct device *dev, int irq, int io_lpcpd); -int st33zp24_remove(struct tpm_chip *chip); +void st33zp24_remove(struct tpm_chip *chip); #endif /* __LOCAL_ST33ZP24_H__ */