From patchwork Wed Oct 13 20:32:09 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: 12556939 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 19A2BC10F29 for ; Wed, 13 Oct 2021 20:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0499D610FE for ; Wed, 13 Oct 2021 20:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbhJMUet (ORCPT ); Wed, 13 Oct 2021 16:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 0850BC061746 for ; Wed, 13 Oct 2021 13:32:44 -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 1makvR-0007Ea-Rk; Wed, 13 Oct 2021 22:32:33 +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 1makvP-0005mP-Rd; Wed, 13 Oct 2021 22:32:31 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvP-0000PT-Qc; Wed, 13 Oct 2021 22:32:31 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dan Robertson , Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 01/15] iio: accel: bma400: Make bma400_remove() return void Date: Wed, 13 Oct 2021 22:32:09 +0200 Message-Id: <20211013203223.2694577-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=QDczYyDphxvNKuXRKH2cXRiwEymS2yx7zD2QDdltpDY=; m=EVbJFOAF9NcXAqYAleGmigQ0K+gdvn31BWzuJBFugts=; p=NmtA8Cu03zX3c9tRKfuJhxpHhzh4EPweZzxm9x9G5q4=; g=0e6f11aabf39ac1d141a3d3136583348dc3e7329 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQeMACgkQwfwUeK3K7Al58QgAjm/ +g1Nb6c3gOtnnUOCtKpbqsby7PZL9bAFA/m10afBG3DXDLzBsqPvNcUor7x1T7hqF5gQ9v9vOUGJ8 PEHxOJVotFPynnC0/GGWmW/DjoI4u/oo4lNedGI3D1oY4z8IYKCQCkP2ShB6bvjZE3ashoJLinDd8 GK1R7Co101huqd85UFbhAQx+NY1gOS0yoH4eyGLc3CmvVMGkEz86K1WvpicYfa/gzXBShOp3mbV0L sxrmbgGIPwj3eIDkdZdVXB9FVxCuQxXkdhJ/Q3W1X/gXugPGaIM0wcl0PVkoforRgMO60NuG3K5Xz kpCPSytBTd4de8cn0cNEtywWAFOQVZw== 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 i2c or 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 in the remove callbacks. As the return value of bma400_remove() is unused then, change the function to not yield a return value. Signed-off-by: Uwe Kleine-König --- drivers/iio/accel/bma400.h | 2 +- drivers/iio/accel/bma400_core.c | 7 ++++--- drivers/iio/accel/bma400_i2c.c | 4 +++- drivers/iio/accel/bma400_spi.c | 4 +++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/bma400.h b/drivers/iio/accel/bma400.h index 5ad10db9819f..c4c8d74155c2 100644 --- a/drivers/iio/accel/bma400.h +++ b/drivers/iio/accel/bma400.h @@ -94,6 +94,6 @@ extern const struct regmap_config bma400_regmap_config; int bma400_probe(struct device *dev, struct regmap *regmap, const char *name); -int bma400_remove(struct device *dev); +void bma400_remove(struct device *dev); #endif diff --git a/drivers/iio/accel/bma400_core.c b/drivers/iio/accel/bma400_core.c index 21520e022a21..fd2647b728d3 100644 --- a/drivers/iio/accel/bma400_core.c +++ b/drivers/iio/accel/bma400_core.c @@ -828,7 +828,7 @@ int bma400_probe(struct device *dev, struct regmap *regmap, const char *name) } EXPORT_SYMBOL(bma400_probe); -int bma400_remove(struct device *dev) +void bma400_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct bma400_data *data = iio_priv(indio_dev); @@ -838,12 +838,13 @@ int bma400_remove(struct device *dev) ret = bma400_set_power_mode(data, POWER_MODE_SLEEP); mutex_unlock(&data->mutex); + if (ret) + dev_warn(dev, "Failed to put device into sleep mode (%pe)\n", ERR_PTR(ret)); + regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators); iio_device_unregister(indio_dev); - - return ret; } EXPORT_SYMBOL(bma400_remove); diff --git a/drivers/iio/accel/bma400_i2c.c b/drivers/iio/accel/bma400_i2c.c index 9dcb7cc9996e..f50df5310beb 100644 --- a/drivers/iio/accel/bma400_i2c.c +++ b/drivers/iio/accel/bma400_i2c.c @@ -29,7 +29,9 @@ static int bma400_i2c_probe(struct i2c_client *client, static int bma400_i2c_remove(struct i2c_client *client) { - return bma400_remove(&client->dev); + bma400_remove(&client->dev); + + return 0; } static const struct i2c_device_id bma400_i2c_ids[] = { diff --git a/drivers/iio/accel/bma400_spi.c b/drivers/iio/accel/bma400_spi.c index 7c2825904e08..9f622e37477b 100644 --- a/drivers/iio/accel/bma400_spi.c +++ b/drivers/iio/accel/bma400_spi.c @@ -89,7 +89,9 @@ static int bma400_spi_probe(struct spi_device *spi) static int bma400_spi_remove(struct spi_device *spi) { - return bma400_remove(&spi->dev); + bma400_remove(&spi->dev); + + return 0; } static const struct spi_device_id bma400_spi_ids[] = { From patchwork Wed Oct 13 20:32:10 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: 12556933 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 A48B8C433F5 for ; Wed, 13 Oct 2021 20:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8EFC1610EA for ; Wed, 13 Oct 2021 20:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229828AbhJMUes (ORCPT ); Wed, 13 Oct 2021 16:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 D843EC06174E for ; Wed, 13 Oct 2021 13:32:43 -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 1makvR-0007Eb-Rk; Wed, 13 Oct 2021 22:32:33 +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 1makvQ-0005mS-1Q; Wed, 13 Oct 2021 22:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvQ-0000Pg-0R; Wed, 13 Oct 2021 22:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 02/15] iio: accel: bmc150: Make bmc150_accel_core_remove() return void Date: Wed, 13 Oct 2021 22:32:10 +0200 Message-Id: <20211013203223.2694577-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=NuQ/2prwJlZUSbk5YWEBdpBR2biPcMNKD5aVzW5Uvfk=; m=8dMEYFJx/Fvy0gBbjIys4WnTx/5HPUJMsgL+Jl1IE5g=; p=kVulruz0w8YQqYuVfq1BJbTfnEmyZGiiUhxrivteCT4=; g=92df2cd184b9901d6029b06ac709f84ca42396f2 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQecACgkQwfwUeK3K7AkrUQf9FFO qwGtR0o4RoiJNw4//CZQl2dDLotOVfaojxyxkfaSS1qlyMQaWeWuhzucgb49zi63dVb2dH8oo2eUT du/IYu114woI6626if2UcrZG4/YK2He7IB1yHaUvsQ+oIQlTA0KfY4qCa5I+zrg9fXTRM98X0Q5su mg4T99FoZyG7E9nrgq+S++O07kfIVOAf2/Ld7i8TFn8nDNgxGdRcSmuuWR/Jw31+mySB+YzmjUj9O Qu88wFils1IhHnwrwyhniQ9DVeVDIsTNJ/Kg3PGEUTwSsQhzWZYosBIux/OlGOM1UaEyZaz4aXJIk y4hv3nauVnXkxoJaUBpVCZaA1jJpdmA== 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 bmc150_accel_core_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/iio/accel/bmc150-accel-core.c | 4 +--- drivers/iio/accel/bmc150-accel-i2c.c | 4 +++- drivers/iio/accel/bmc150-accel-spi.c | 4 +++- drivers/iio/accel/bmc150-accel.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/bmc150-accel-core.c b/drivers/iio/accel/bmc150-accel-core.c index e8693a42ad46..590016830a6f 100644 --- a/drivers/iio/accel/bmc150-accel-core.c +++ b/drivers/iio/accel/bmc150-accel-core.c @@ -1799,7 +1799,7 @@ int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, } EXPORT_SYMBOL_GPL(bmc150_accel_core_probe); -int bmc150_accel_core_remove(struct device *dev) +void bmc150_accel_core_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct bmc150_accel_data *data = iio_priv(indio_dev); @@ -1819,8 +1819,6 @@ int bmc150_accel_core_remove(struct device *dev) regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators); - - return 0; } EXPORT_SYMBOL_GPL(bmc150_accel_core_remove); diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c index 88bd8a25f142..9e52df9a8f07 100644 --- a/drivers/iio/accel/bmc150-accel-i2c.c +++ b/drivers/iio/accel/bmc150-accel-i2c.c @@ -213,7 +213,9 @@ static int bmc150_accel_remove(struct i2c_client *client) { bmc150_acpi_dual_accel_remove(client); - return bmc150_accel_core_remove(&client->dev); + bmc150_accel_core_remove(&client->dev); + + return 0; } static const struct acpi_device_id bmc150_accel_acpi_match[] = { diff --git a/drivers/iio/accel/bmc150-accel-spi.c b/drivers/iio/accel/bmc150-accel-spi.c index 191e312dc91a..11559567cb39 100644 --- a/drivers/iio/accel/bmc150-accel-spi.c +++ b/drivers/iio/accel/bmc150-accel-spi.c @@ -37,7 +37,9 @@ static int bmc150_accel_probe(struct spi_device *spi) static int bmc150_accel_remove(struct spi_device *spi) { - return bmc150_accel_core_remove(&spi->dev); + bmc150_accel_core_remove(&spi->dev); + + return 0; } static const struct acpi_device_id bmc150_accel_acpi_match[] = { diff --git a/drivers/iio/accel/bmc150-accel.h b/drivers/iio/accel/bmc150-accel.h index 1bb5023e8ed9..7775c5edaeef 100644 --- a/drivers/iio/accel/bmc150-accel.h +++ b/drivers/iio/accel/bmc150-accel.h @@ -88,7 +88,7 @@ struct bmc150_accel_data { int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, enum bmc150_type type, const char *name, bool block_supported); -int bmc150_accel_core_remove(struct device *dev); +void bmc150_accel_core_remove(struct device *dev); extern const struct dev_pm_ops bmc150_accel_pm_ops; extern const struct regmap_config bmc150_regmap_conf; From patchwork Wed Oct 13 20:32:11 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: 12556931 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 7C5CCC433F5 for ; Wed, 13 Oct 2021 20:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6039C6101E for ; Wed, 13 Oct 2021 20:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229770AbhJMUeq (ORCPT ); Wed, 13 Oct 2021 16:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229726AbhJMUep (ORCPT ); Wed, 13 Oct 2021 16:34:45 -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 147AEC061749 for ; Wed, 13 Oct 2021 13:32:42 -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 1makvR-0007Ec-Rk; Wed, 13 Oct 2021 22:32:33 +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 1makvQ-0005mV-Fl; Wed, 13 Oct 2021 22:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvQ-0000Ps-Es; Wed, 13 Oct 2021 22:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , kernel@pengutronix.de, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 03/15] iio: accel: bmi088: Make bmi088_accel_core_remove() return void Date: Wed, 13 Oct 2021 22:32:11 +0200 Message-Id: <20211013203223.2694577-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=47b07Tl6Kkb0cBFoLDA3POhzluluk58LiCtxdyy8nM0=; m=MHX9YV6gq1NLCJ2dPZ71KGY8ElRJr9RbowJQ7VgmlTw=; p=cWMbetov6SRlF4mtcqhmc7uOUmFm3pucHYE0XYh2WMI=; g=0d4cb60fa1fdfd38c668842f931ab30f626a9912 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQeoACgkQwfwUeK3K7Al99Qf/c9n XdRfOoXMzYI3jxyObbVkKKUdnzb0qvMbiH0j4eMuIupyxmh7lWIYRZxS0mf7NTRUQHzqWNA1z1g0o Sj7pKarAP9T+VdiIDru9prQanLIEZrzaL03tsCk7Hx4YPcnxljLosEu5ZahhqfCG6TwfEwOTiXFwD htuU1GWsPt1ZFmyLwA8k+7eizBBy0ccIxbqQ8sJsEuCAzKWLjOkFjBrMw27+mCMoaUr6WaYhhqEF8 K7DrxDKioKCsCvBzm2npg4j5xyuHOFQKLSufy3/ldHKcNiM/BY7vuKq1XtRemC6/vRnzFBbLOVxIc mh+sG+/BLFa+9obJxvJ8WoYXZCv973w== 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 bmi088_accel_core_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/iio/accel/bmi088-accel-core.c | 4 +--- drivers/iio/accel/bmi088-accel-spi.c | 4 +++- drivers/iio/accel/bmi088-accel.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/accel/bmi088-accel-core.c b/drivers/iio/accel/bmi088-accel-core.c index a06dae5c971d..d74465214feb 100644 --- a/drivers/iio/accel/bmi088-accel-core.c +++ b/drivers/iio/accel/bmi088-accel-core.c @@ -536,7 +536,7 @@ int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, EXPORT_SYMBOL_GPL(bmi088_accel_core_probe); -int bmi088_accel_core_remove(struct device *dev) +void bmi088_accel_core_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct bmi088_accel_data *data = iio_priv(indio_dev); @@ -546,8 +546,6 @@ int bmi088_accel_core_remove(struct device *dev) pm_runtime_disable(dev); pm_runtime_set_suspended(dev); bmi088_accel_power_down(data); - - return 0; } EXPORT_SYMBOL_GPL(bmi088_accel_core_remove); diff --git a/drivers/iio/accel/bmi088-accel-spi.c b/drivers/iio/accel/bmi088-accel-spi.c index dd1e3f6cf211..758ad2f12896 100644 --- a/drivers/iio/accel/bmi088-accel-spi.c +++ b/drivers/iio/accel/bmi088-accel-spi.c @@ -58,7 +58,9 @@ static int bmi088_accel_probe(struct spi_device *spi) static int bmi088_accel_remove(struct spi_device *spi) { - return bmi088_accel_core_remove(&spi->dev); + bmi088_accel_core_remove(&spi->dev); + + return 0; } static const struct spi_device_id bmi088_accel_id[] = { diff --git a/drivers/iio/accel/bmi088-accel.h b/drivers/iio/accel/bmi088-accel.h index 5c25f16b672c..5d40c7cf1cbc 100644 --- a/drivers/iio/accel/bmi088-accel.h +++ b/drivers/iio/accel/bmi088-accel.h @@ -13,6 +13,6 @@ extern const struct dev_pm_ops bmi088_accel_pm_ops; int bmi088_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, const char *name, bool block_supported); -int bmi088_accel_core_remove(struct device *dev); +void bmi088_accel_core_remove(struct device *dev); #endif /* BMI088_ACCEL_H */ From patchwork Wed Oct 13 20:32:12 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: 12556937 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 4591AC10F13 for ; Wed, 13 Oct 2021 20:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F4A0610CF for ; Wed, 13 Oct 2021 20:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbhJMUet (ORCPT ); Wed, 13 Oct 2021 16:34:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229798AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 E2944C061753 for ; Wed, 13 Oct 2021 13:32:43 -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 1makvR-0007Ed-Rk; Wed, 13 Oct 2021 22:32:33 +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 1makvQ-0005mY-KQ; Wed, 13 Oct 2021 22:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvQ-0000Q2-JR; Wed, 13 Oct 2021 22:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 04/15] iio: accel: kxsd9: Make kxsd9_common_remove() return void Date: Wed, 13 Oct 2021 22:32:12 +0200 Message-Id: <20211013203223.2694577-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=h76q3cLCdrlpBZzubcejFNmAN+YxeIevTTFn3m/6Iu4=; m=HXOeAuGEz3UmuRmcI6USXlUHzFnswGV/iLrDmebvpqw=; p=C2975iDAPM5S4ZU15ygYhTAmxjGWjEfdkzsUJijEx+8=; g=a31e9c62397b8fd3b0f84d26651bf3370a81cdb8 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQe0ACgkQwfwUeK3K7Akq0wf/fPU oiHD+U/lT7FXjKUpXS4VOhtuEmwLM36vR32DsVPH0iRB4K0Y73LqZHbrZtNqlR+MRP0j9WO8qsGQY x3eV7aVQ6CQKBEnLTtECSCWgHlsvt+SJ0+rb1ZRi2u4kyiAxQ9gfaCXIKn7aCTiLVTb5eOmJCIMno T6O8DmrySns59vBDgY+SzS93sdOhdkyRFi8nSDt+v/h9HbcDuDpJxx14TL4mQ76Ftl/A+efjpI6r6 I3zW/gSB6NQnw8MUOToIH0ejwMAwEWDxeTGwd9QP8ovE1yafOSN4qHQNzVTb0Aw/waOxnyx79oPAJ L7hdreDkZoEsgZfAWccEutxxYLdTZXg== 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 kxsd9_common_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/iio/accel/kxsd9-i2c.c | 4 +++- drivers/iio/accel/kxsd9-spi.c | 4 +++- drivers/iio/accel/kxsd9.c | 4 +--- drivers/iio/accel/kxsd9.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/kxsd9-i2c.c b/drivers/iio/accel/kxsd9-i2c.c index b580d605f848..274b41a6e603 100644 --- a/drivers/iio/accel/kxsd9-i2c.c +++ b/drivers/iio/accel/kxsd9-i2c.c @@ -34,7 +34,9 @@ static int kxsd9_i2c_probe(struct i2c_client *i2c, static int kxsd9_i2c_remove(struct i2c_client *client) { - return kxsd9_common_remove(&client->dev); + kxsd9_common_remove(&client->dev); + + return 0; } static const struct of_device_id kxsd9_of_match[] = { diff --git a/drivers/iio/accel/kxsd9-spi.c b/drivers/iio/accel/kxsd9-spi.c index 7971ec1eeb7e..441e6b764281 100644 --- a/drivers/iio/accel/kxsd9-spi.c +++ b/drivers/iio/accel/kxsd9-spi.c @@ -34,7 +34,9 @@ static int kxsd9_spi_probe(struct spi_device *spi) static int kxsd9_spi_remove(struct spi_device *spi) { - return kxsd9_common_remove(&spi->dev); + kxsd9_common_remove(&spi->dev); + + return 0; } static const struct spi_device_id kxsd9_spi_id[] = { diff --git a/drivers/iio/accel/kxsd9.c b/drivers/iio/accel/kxsd9.c index bf7ed9e7d00f..2faf85ca996e 100644 --- a/drivers/iio/accel/kxsd9.c +++ b/drivers/iio/accel/kxsd9.c @@ -478,7 +478,7 @@ int kxsd9_common_probe(struct device *dev, } EXPORT_SYMBOL(kxsd9_common_probe); -int kxsd9_common_remove(struct device *dev) +void kxsd9_common_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct kxsd9_state *st = iio_priv(indio_dev); @@ -489,8 +489,6 @@ int kxsd9_common_remove(struct device *dev) pm_runtime_put_noidle(dev); pm_runtime_disable(dev); kxsd9_power_down(st); - - return 0; } EXPORT_SYMBOL(kxsd9_common_remove); diff --git a/drivers/iio/accel/kxsd9.h b/drivers/iio/accel/kxsd9.h index 5e3ca212f5be..c04dbfa4e0d0 100644 --- a/drivers/iio/accel/kxsd9.h +++ b/drivers/iio/accel/kxsd9.h @@ -8,6 +8,6 @@ int kxsd9_common_probe(struct device *dev, struct regmap *map, const char *name); -int kxsd9_common_remove(struct device *dev); +void kxsd9_common_remove(struct device *dev); extern const struct dev_pm_ops kxsd9_dev_pm_ops; From patchwork Wed Oct 13 20:32:13 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: 12556951 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 A88D3C15504 for ; Wed, 13 Oct 2021 20:32:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9488261130 for ; Wed, 13 Oct 2021 20:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbhJMUev (ORCPT ); Wed, 13 Oct 2021 16:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhJMUeu (ORCPT ); Wed, 13 Oct 2021 16:34:50 -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 4FF81C061746 for ; Wed, 13 Oct 2021 13:32:46 -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 1makvR-0007Ee-Rj; Wed, 13 Oct 2021 22:32:33 +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 1makvQ-0005mb-QR; Wed, 13 Oct 2021 22:32:32 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvQ-0000QE-PO; Wed, 13 Oct 2021 22:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 05/15] iio: accel: mma7455: Make mma7455_core_remove() return void Date: Wed, 13 Oct 2021 22:32:13 +0200 Message-Id: <20211013203223.2694577-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=rKvC/oSOVZDlFv+j5wQ6EUNPIn+fpEaHiBQX2eeTwuI=; m=lDgVw75eMVw1gNlXDgV2kUOPbyow2s75r/9Xta213hI=; p=EMBM9Ru9ktBC7jMq8LrhOhHLTsd0fTxAUK0l7gw0BMQ=; g=613b4d7ed135e778d967c832af862554e87d651c X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQfEACgkQwfwUeK3K7Antbgf/Rvc Iz2c5KWVk4Lfxct5/hbL/xxtVkxdgwxSiwN9Sfjdrg7UEX/6Z5GsbFteKwIAVksadvh5jHGvBNGi7 rqGamZEUoJPqRTiUkpMJyXYLbb8lnYa8S9OHQzqTzb0jBCNIiBy0NlmtlWp0ia7Jco6LSfHfa0fNq nGkRuzorbgVpcs65QlCdhhkafN7XIoKdWwqwL4ydWqyGE23SRGtscIoXNJGb4WHhsySIQCvMmbID5 KhacLPZO0j2xoYDELupLrWgMk9FgO8WJOX9menYGjPVx/u9LoU3lWs9iqSCIwIvYSnQBBztFAwHwP 6vW3AFCtBtIpfexABsSafXGDazq+2TQ== 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 mma7455_core_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/iio/accel/mma7455.h | 2 +- drivers/iio/accel/mma7455_core.c | 4 +--- drivers/iio/accel/mma7455_i2c.c | 4 +++- drivers/iio/accel/mma7455_spi.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/accel/mma7455.h b/drivers/iio/accel/mma7455.h index 4e3fa988f690..1fcc4b64b3af 100644 --- a/drivers/iio/accel/mma7455.h +++ b/drivers/iio/accel/mma7455.h @@ -11,6 +11,6 @@ extern const struct regmap_config mma7455_core_regmap; int mma7455_core_probe(struct device *dev, struct regmap *regmap, const char *name); -int mma7455_core_remove(struct device *dev); +void mma7455_core_remove(struct device *dev); #endif diff --git a/drivers/iio/accel/mma7455_core.c b/drivers/iio/accel/mma7455_core.c index 922bd38ff6ea..777c6c384b09 100644 --- a/drivers/iio/accel/mma7455_core.c +++ b/drivers/iio/accel/mma7455_core.c @@ -294,7 +294,7 @@ int mma7455_core_probe(struct device *dev, struct regmap *regmap, } EXPORT_SYMBOL_GPL(mma7455_core_probe); -int mma7455_core_remove(struct device *dev) +void mma7455_core_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct mma7455_data *mma7455 = iio_priv(indio_dev); @@ -304,8 +304,6 @@ int mma7455_core_remove(struct device *dev) regmap_write(mma7455->regmap, MMA7455_REG_MCTL, MMA7455_MCTL_MODE_STANDBY); - - return 0; } EXPORT_SYMBOL_GPL(mma7455_core_remove); diff --git a/drivers/iio/accel/mma7455_i2c.c b/drivers/iio/accel/mma7455_i2c.c index cddeaa9e230a..8a5256516f9f 100644 --- a/drivers/iio/accel/mma7455_i2c.c +++ b/drivers/iio/accel/mma7455_i2c.c @@ -28,7 +28,9 @@ static int mma7455_i2c_probe(struct i2c_client *i2c, static int mma7455_i2c_remove(struct i2c_client *i2c) { - return mma7455_core_remove(&i2c->dev); + mma7455_core_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id mma7455_i2c_ids[] = { diff --git a/drivers/iio/accel/mma7455_spi.c b/drivers/iio/accel/mma7455_spi.c index eb82cdfa8abc..ecf690692dcc 100644 --- a/drivers/iio/accel/mma7455_spi.c +++ b/drivers/iio/accel/mma7455_spi.c @@ -24,7 +24,9 @@ static int mma7455_spi_probe(struct spi_device *spi) static int mma7455_spi_remove(struct spi_device *spi) { - return mma7455_core_remove(&spi->dev); + mma7455_core_remove(&spi->dev); + + return 0; } static const struct spi_device_id mma7455_spi_ids[] = { From patchwork Wed Oct 13 20:32:14 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: 12556945 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 2AE9DC43217 for ; Wed, 13 Oct 2021 20:32:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 105B4610D0 for ; Wed, 13 Oct 2021 20:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229841AbhJMUev (ORCPT ); Wed, 13 Oct 2021 16:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbhJMUet (ORCPT ); Wed, 13 Oct 2021 16:34:49 -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 E3AC7C061570 for ; Wed, 13 Oct 2021 13:32:45 -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 1makvU-0007IC-Qf; Wed, 13 Oct 2021 22:32:36 +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 1makvU-0005nw-0y; Wed, 13 Oct 2021 22:32:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvQ-0000QQ-VO; Wed, 13 Oct 2021 22:32:32 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Cc: Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 06/15] iio: accel: ad5064: Make ad5064_core_remove() return void Date: Wed, 13 Oct 2021 22:32:14 +0200 Message-Id: <20211013203223.2694577-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=wALG4gz7iqyUvwiTn3Je59AipFj3jq2HLGDkJBMKnos=; m=h1tkDeOfl4YaLT3aOB/5yD/xhKvZDwH7eKg7/DHHYwM=; p=e74TrROuU6T6V9lnkyiudHD8P8opoQJc7TvaaUz2mxw=; g=0f6a0b9c50fa16e50189537d670916018d7daa2c X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQfQACgkQwfwUeK3K7Altgwf/XJw GVG0dOpYsB/nTd4t7baFIotjtNKa2sGk6lTJkdROyWkKSRtKaE0b4Lqv2AROxDZMfTqT/XJfcGrRU 21u7A+eVM8tZVHYOa6AS00aNIMW37HlN6K+ik8yT4uSzg3rgzN0f6S+Zxx5uOIRmrZNLzwpqieNT3 /qQYbBnzykQhoPfXGiyW1GktyOeWwV1xppLMj3S+4hYq2UOiY5e72kJjT33er5fzJMsrQEyKqY7vw xehLNjuRUbB9v0kuH9AogppdnR0WmA2hsxRrwkY2dhCNnGFjWMmD30rtR0MufKuyBCAvriTWSpIm5 nriFPK2yMfOFIRtbKgsszR4R6jxbh5Q== 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 ad5064_core_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/iio/dac/ad5064.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iio/dac/ad5064.c b/drivers/iio/dac/ad5064.c index dff623b65e4f..6f66796942c0 100644 --- a/drivers/iio/dac/ad5064.c +++ b/drivers/iio/dac/ad5064.c @@ -900,7 +900,7 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type, return ret; } -static int ad5064_remove(struct device *dev) +static void ad5064_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct ad5064_state *st = iio_priv(indio_dev); @@ -909,8 +909,6 @@ static int ad5064_remove(struct device *dev) if (!st->use_internal_vref) regulator_bulk_disable(ad5064_num_vref(st), st->vref_reg); - - return 0; } #if IS_ENABLED(CONFIG_SPI_MASTER) @@ -934,7 +932,9 @@ static int ad5064_spi_probe(struct spi_device *spi) static int ad5064_spi_remove(struct spi_device *spi) { - return ad5064_remove(&spi->dev); + ad5064_remove(&spi->dev); + + return 0; } static const struct spi_device_id ad5064_spi_ids[] = { @@ -1021,7 +1021,9 @@ static int ad5064_i2c_probe(struct i2c_client *i2c, static int ad5064_i2c_remove(struct i2c_client *i2c) { - return ad5064_remove(&i2c->dev); + ad5064_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id ad5064_i2c_ids[] = { From patchwork Wed Oct 13 20:32:15 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: 12556957 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 3F124C16AB3 for ; Wed, 13 Oct 2021 20:32:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EEE36101E for ; Wed, 13 Oct 2021 20:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbhJMUey (ORCPT ); Wed, 13 Oct 2021 16:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhJMUex (ORCPT ); Wed, 13 Oct 2021 16:34:53 -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 D3190C061570 for ; Wed, 13 Oct 2021 13:32:49 -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 1makvY-0007UL-VX; Wed, 13 Oct 2021 22:32:41 +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 1makvY-0005oJ-EQ; Wed, 13 Oct 2021 22:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvR-0000QT-50; Wed, 13 Oct 2021 22:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Cc: Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 07/15] iio: dac: ad5380: Make ad5380_remove() return void Date: Wed, 13 Oct 2021 22:32:15 +0200 Message-Id: <20211013203223.2694577-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=VdvWRnw9Zw90iHMeybC2OfejXduindsyC/oofVwEL78=; m=+pV6pNJ6/hCsJwA6Mq9Vw398k64WmZ7f24+71DBiPU4=; p=3EMNXr0o8SsefTlNGeAQHMqEVQqQzlOwTDN7uNTjLSo=; g=cd2c65a0425f1cbc1daedf5e37369fc9a05bfe22 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQfgACgkQwfwUeK3K7An3twf+KnY OfHW1ym6MGJVj1Zajqg9KJffb9wJBLVfxcxvZZipnvhHJe8z+tflvhMYiYktWDeNjGodKZ4i4JRv1 Hx54ijvbbr7Hz4PxFB08lAUWtj2puDC6fvqCaoWTOgd5P0LdWPIFe+Q8PvzPNkQT4rDlw71eoFio0 C4fB2wt4VTgTXP8w+L+jNE1snCWzT38tvpgy7wlTGkpCMFlgVbFKUw6b+HusR+YSuoBzvEYScgIgI 4EQol22v9M1UPGwpoi03Z9Fj7vZMjJ0rbASzinVpOSS7w1CnvKl0brQULs42g1/p/IgBV+9msIzxh 7BXTDDTgixalFNkXfnPWZmEP7zkgVbA== 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 ad5380_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/iio/dac/ad5380.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index 53db5b4e4c53..8ca26bb4b62f 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -444,7 +444,7 @@ static int ad5380_probe(struct device *dev, struct regmap *regmap, return ret; } -static int ad5380_remove(struct device *dev) +static void ad5380_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct ad5380_state *st = iio_priv(indio_dev); @@ -453,11 +453,8 @@ static int ad5380_remove(struct device *dev) kfree(indio_dev->channels); - if (!IS_ERR(st->vref_reg)) { + if (!IS_ERR(st->vref_reg)) regulator_disable(st->vref_reg); - } - - return 0; } static bool ad5380_reg_false(struct device *dev, unsigned int reg) @@ -493,7 +490,9 @@ static int ad5380_spi_probe(struct spi_device *spi) static int ad5380_spi_remove(struct spi_device *spi) { - return ad5380_remove(&spi->dev); + ad5380_remove(&spi->dev); + + return 0; } static const struct spi_device_id ad5380_spi_ids[] = { @@ -566,7 +565,9 @@ static int ad5380_i2c_probe(struct i2c_client *i2c, static int ad5380_i2c_remove(struct i2c_client *i2c) { - return ad5380_remove(&i2c->dev); + ad5380_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id ad5380_i2c_ids[] = { From patchwork Wed Oct 13 20:32:16 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: 12556961 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 CC311C10F13 for ; Wed, 13 Oct 2021 20:32:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AED936109E for ; Wed, 13 Oct 2021 20:32:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbhJMUez (ORCPT ); Wed, 13 Oct 2021 16:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhJMUez (ORCPT ); Wed, 13 Oct 2021 16:34:55 -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 72126C061570 for ; Wed, 13 Oct 2021 13:32:51 -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 1makvZ-0007UN-03; Wed, 13 Oct 2021 22:32:41 +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 1makvY-0005oK-ER; Wed, 13 Oct 2021 22:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvR-0000QW-B2; Wed, 13 Oct 2021 22:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Cc: Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 08/15] iio: dac: ad5446: Make ad5446_remove() return void Date: Wed, 13 Oct 2021 22:32:16 +0200 Message-Id: <20211013203223.2694577-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=dEbl89T9tuVzitmq3oJc+HZp5pSLSQ32W6DCEWmPSbs=; m=eTQC1eHegUvKvX7TuWiKAWSE8IEgS+7QY24Wg6jNSyk=; p=IhvynkxE5az3IgQxdRNlTARa+0WYtIT6kWj3q7lsxN0=; g=63e4cbdc4d1fe92a9e4b22833f3b90276ae18d35 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQfwACgkQwfwUeK3K7AlPjgf8D1H X6fiZIwm175kabkjiOJQapJm9uAs/PeJy/Id0vWzd0qlBdOhgYjMhZlWHWVGQhdk1eNKMBML7zftQ M3tMFW8moX8NsqJ+4DwhDV2uNhAbM8QdMvTTjllxvKOPt2gIKvriJOIsVpiwL6bb0dDXE4iIm7ebh jFgAFtNtUKxkRJOIewSwQbB2cu+km13U8U/1P8sfgmxpHhr/I1fHPWf4smdxc1JpUbyqa6e1gsB4D wBTIHKOGRU4WbQcV6paqIgMifEwXScigeFrLdEpt0YC7b0nzZ+uhC63VCkP/pYyoVFv02czu1/xSv r56JBqOHveeH2grEOVk8HVjrnCeMUqA== 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 ad5446_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/iio/dac/ad5446.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c index 488ec69967d6..0ef761521e87 100644 --- a/drivers/iio/dac/ad5446.c +++ b/drivers/iio/dac/ad5446.c @@ -283,7 +283,7 @@ static int ad5446_probe(struct device *dev, const char *name, return ret; } -static int ad5446_remove(struct device *dev) +static void ad5446_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct ad5446_state *st = iio_priv(indio_dev); @@ -291,8 +291,6 @@ static int ad5446_remove(struct device *dev) iio_device_unregister(indio_dev); if (!IS_ERR(st->reg)) regulator_disable(st->reg); - - return 0; } #if IS_ENABLED(CONFIG_SPI_MASTER) @@ -495,7 +493,9 @@ static int ad5446_spi_probe(struct spi_device *spi) static int ad5446_spi_remove(struct spi_device *spi) { - return ad5446_remove(&spi->dev); + ad5446_remove(&spi->dev); + + return 0; } static struct spi_driver ad5446_spi_driver = { @@ -572,7 +572,9 @@ static int ad5446_i2c_probe(struct i2c_client *i2c, static int ad5446_i2c_remove(struct i2c_client *i2c) { - return ad5446_remove(&i2c->dev); + ad5446_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id ad5446_i2c_ids[] = { From patchwork Wed Oct 13 20:32:17 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: 12556959 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 8E4D8C10F14 for ; Wed, 13 Oct 2021 20:32:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E65D6101E for ; Wed, 13 Oct 2021 20:32:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229882AbhJMUey (ORCPT ); Wed, 13 Oct 2021 16:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229852AbhJMUey (ORCPT ); Wed, 13 Oct 2021 16:34:54 -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 58115C061746 for ; Wed, 13 Oct 2021 13:32:50 -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 1makvZ-0007US-8H; Wed, 13 Oct 2021 22:32:41 +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 1makvY-0005oP-Md; Wed, 13 Oct 2021 22:32:40 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvR-0000QZ-HT; Wed, 13 Oct 2021 22:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Cc: Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 09/15] iio: dac: ad5592r: Make ad5592r_remove() return void Date: Wed, 13 Oct 2021 22:32:17 +0200 Message-Id: <20211013203223.2694577-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=Tc0S2KgSSkaHRAcszXJfnWtq65U89mWihJ1mue6Poe0=; m=LLhHna2OrOwN99U0Ikry2eSET5FRcHGecp02QdELNCU=; p=eYtBPEKNDkicMqJXP7QUINA5rBoAh8d1+wNf4qokILE=; g=80b9323d3cfccbff2624264d0a2490ca703ddf1b X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQgEACgkQwfwUeK3K7AmX+Qf/ZmK 9Ho+m5e1geUguqTp1/j13w0I3yIDo2ir6PbAwETrNek7gr7SywKfK4FWuHtuUZgjtOAFQ0Qncg1Zk nD7fGjT8iArfkg2k5OHI4p38TpGRTq8xz7nqeZuLSDJt0lKfBOUrlkgwK+H2CU7mPdLthBOPSuEda kMuWEcVaG4cBHmdBYRRzaaJkE7GhhxwGRlDza6Nl8OsOgF8fqrSYvQB4lufQ9pNNrI411vqtz0M9H +3bDM3W87HKWhOIUch+XAnJxmohDZWLxLxlhZN58AEpMdaQ8Fk8dQd/+3RPp7wvCXj9C6xC3mpMvH Y9p+RXPjaTmE1XGtW7LSJnavk57OUlQ== 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 ad5592r_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/iio/dac/ad5592r-base.c | 4 +--- drivers/iio/dac/ad5592r-base.h | 2 +- drivers/iio/dac/ad5592r.c | 4 +++- drivers/iio/dac/ad5593r.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c index 0405e92b9e8c..2fcc59728fd6 100644 --- a/drivers/iio/dac/ad5592r-base.c +++ b/drivers/iio/dac/ad5592r-base.c @@ -663,7 +663,7 @@ int ad5592r_probe(struct device *dev, const char *name, } EXPORT_SYMBOL_GPL(ad5592r_probe); -int ad5592r_remove(struct device *dev) +void ad5592r_remove(struct device *dev) { struct iio_dev *iio_dev = dev_get_drvdata(dev); struct ad5592r_state *st = iio_priv(iio_dev); @@ -674,8 +674,6 @@ int ad5592r_remove(struct device *dev) if (st->reg) regulator_disable(st->reg); - - return 0; } EXPORT_SYMBOL_GPL(ad5592r_remove); diff --git a/drivers/iio/dac/ad5592r-base.h b/drivers/iio/dac/ad5592r-base.h index 23dac2f1ff8a..2a22ef691996 100644 --- a/drivers/iio/dac/ad5592r-base.h +++ b/drivers/iio/dac/ad5592r-base.h @@ -71,6 +71,6 @@ struct ad5592r_state { int ad5592r_probe(struct device *dev, const char *name, const struct ad5592r_rw_ops *ops); -int ad5592r_remove(struct device *dev); +void ad5592r_remove(struct device *dev); #endif /* __DRIVERS_IIO_DAC_AD5592R_BASE_H__ */ diff --git a/drivers/iio/dac/ad5592r.c b/drivers/iio/dac/ad5592r.c index 41f651500668..6bfd7951e18c 100644 --- a/drivers/iio/dac/ad5592r.c +++ b/drivers/iio/dac/ad5592r.c @@ -132,7 +132,9 @@ static int ad5592r_spi_probe(struct spi_device *spi) static int ad5592r_spi_remove(struct spi_device *spi) { - return ad5592r_remove(&spi->dev); + ad5592r_remove(&spi->dev); + + return 0; } static const struct spi_device_id ad5592r_spi_ids[] = { diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c index 5b4df36fdc2a..64dd7a0bddf7 100644 --- a/drivers/iio/dac/ad5593r.c +++ b/drivers/iio/dac/ad5593r.c @@ -99,7 +99,9 @@ static int ad5593r_i2c_probe(struct i2c_client *i2c, static int ad5593r_i2c_remove(struct i2c_client *i2c) { - return ad5592r_remove(&i2c->dev); + ad5592r_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id ad5593r_i2c_ids[] = { From patchwork Wed Oct 13 20:32:18 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: 12556943 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 B35EBC47080 for ; Wed, 13 Oct 2021 20:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A5EE9610D0 for ; Wed, 13 Oct 2021 20:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229795AbhJMUeu (ORCPT ); Wed, 13 Oct 2021 16:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 20318C061762 for ; Wed, 13 Oct 2021 13:32:44 -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 1makvS-0007Ef-H9; Wed, 13 Oct 2021 22:32:34 +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 1makvR-0005me-PV; Wed, 13 Oct 2021 22:32:33 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvR-0000Qc-OH; Wed, 13 Oct 2021 22:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich Cc: Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 10/15] iio: dac: ad5686: Make ad5686_remove() return void Date: Wed, 13 Oct 2021 22:32:18 +0200 Message-Id: <20211013203223.2694577-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=QMuejyC7ti9iGWS4aq/Mg0auEumbcjLiUXg/6aTZyBQ=; m=18nqVQag2sEsyeOjvHnHOLnTqoP0ugWwZtchoOSDR3k=; p=FQEaBCbRRXyB/WZS/lmheIp7jSbyhBnXSI6quIwXiRI=; g=630156e673f7eef71dec8aae3b38e903b2786a9f X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQgUACgkQwfwUeK3K7AllSAf/axM 0Cnkf6812caWnaHugOJkOGsnpP6O0D1tzoTc48ZIrn6/mWmCD0e3idtA/gHfc0ECqcwYSthl+sHxB UulHOXvkmelkDVG5CNSuJ3hCPo8MRoLGxAd62VF9cDavkq4ipdKdA2M52vAUq//pH7wjKCZhkOPE7 McihWXbd90DERLNcIIXyliYHsCnLkMLxsmRNL27sjGpb0saa9DM69efe+NJ/RoEK51h3/mXTg4jpq tju3FclQk62HiunfEh5F6TFn3koVMWnU1ZV8q4PHKIBY4ivFgR9NaSyEW5Fgota5wVmNrKEE8TqEe HPhFma58kuTC3Jgi3ZCdua0Wbiy3ODQ== 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 ad5686_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/iio/dac/ad5686-spi.c | 4 +++- drivers/iio/dac/ad5686.c | 4 +--- drivers/iio/dac/ad5686.h | 2 +- drivers/iio/dac/ad5696-i2c.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/dac/ad5686-spi.c b/drivers/iio/dac/ad5686-spi.c index 0188ded5137c..2628810fdbb1 100644 --- a/drivers/iio/dac/ad5686-spi.c +++ b/drivers/iio/dac/ad5686-spi.c @@ -97,7 +97,9 @@ static int ad5686_spi_probe(struct spi_device *spi) static int ad5686_spi_remove(struct spi_device *spi) { - return ad5686_remove(&spi->dev); + ad5686_remove(&spi->dev); + + return 0; } static const struct spi_device_id ad5686_spi_id[] = { diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index fcb64f20ff64..8f001db775f4 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -538,7 +538,7 @@ int ad5686_probe(struct device *dev, } EXPORT_SYMBOL_GPL(ad5686_probe); -int ad5686_remove(struct device *dev) +void ad5686_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct ad5686_state *st = iio_priv(indio_dev); @@ -546,8 +546,6 @@ int ad5686_remove(struct device *dev) iio_device_unregister(indio_dev); if (!IS_ERR(st->reg)) regulator_disable(st->reg); - - return 0; } EXPORT_SYMBOL_GPL(ad5686_remove); diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index f89a6f92b427..cd5fff9e9d53 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -154,7 +154,7 @@ int ad5686_probe(struct device *dev, const char *name, ad5686_write_func write, ad5686_read_func read); -int ad5686_remove(struct device *dev); +void ad5686_remove(struct device *dev); #endif /* __DRIVERS_IIO_DAC_AD5686_H__ */ diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c index 24a6a4a5a2e0..93f0e0e66c22 100644 --- a/drivers/iio/dac/ad5696-i2c.c +++ b/drivers/iio/dac/ad5696-i2c.c @@ -67,7 +67,9 @@ static int ad5686_i2c_probe(struct i2c_client *i2c, static int ad5686_i2c_remove(struct i2c_client *i2c) { - return ad5686_remove(&i2c->dev); + ad5686_remove(&i2c->dev); + + return 0; } static const struct i2c_device_id ad5686_i2c_id[] = { From patchwork Wed Oct 13 20:32:19 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: 12556935 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 15855C10F14 for ; Wed, 13 Oct 2021 20:32:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03174610D0 for ; Wed, 13 Oct 2021 20:32:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbhJMUes (ORCPT ); Wed, 13 Oct 2021 16:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229794AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 D0A68C061749 for ; Wed, 13 Oct 2021 13:32:43 -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 1makvV-0007O8-Ry; Wed, 13 Oct 2021 22:32:37 +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 1makvV-0005o9-1c; Wed, 13 Oct 2021 22:32:37 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvR-0000Qp-Vu; Wed, 13 Oct 2021 22:32:33 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , kernel@pengutronix.de, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 11/15] iio: health: afe4403: Don't return an error in .remove() Date: Wed, 13 Oct 2021 22:32:19 +0200 Message-Id: <20211013203223.2694577-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=b1eSHdLXQo0fr8mn+X+4KScPcaHCO4/keggIi/1q4Ic=; m=AV9d33ugZ5xjfzJFnF52UDd172Pe7zg8wyV68iU6wAc=; p=b5y9nraNfWt6DVEWlyuPTWBy1gSmD0ltzSuPxuPfHRM=; g=08921c495ce67902629f6f91e3b0cfe0c908006a X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQgkACgkQwfwUeK3K7AnJ/wgAg8d i5wKOlUDgtEIfp2UcvRSsPKWNhz9w+ZOHo5eqXGg0Ruhp21Sy0y/H4V/ajFdttDhd1uMbjdPH9Xkk EeSbA8Zx2tc0qE1EyMEe4ykabQxtFTGJcEaHLkWQDGqIA+7/0pWA3uhAYjgik7I30QHbn7e0gGR47 Xgkp1y7IC63/WYznOJl6YTYzC3/fwvgcBYhAVb2KZox0RufBEAypfFxOhMJPhJxjxLtCJpq/+dcO0 WvG2QuHcRvTUUugBBUBOKmKb/wOxBusAzeh0Jd00XgvYzCFKacSYqojwGcLlhCq7VomhwGDFaCydX F7e+jmoFYi1w4iFeGySq1fDPW/fuAlw== 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 The only effect of returning an error in an spi .remove() callback is that the spi core issues another warning message. Don't report the same problem twice and return 0 unconditionally instead. Also degrade the log level to warning, as nothing really bad is expected from a failure to put the device in suspend mode. Signed-off-by: Uwe Kleine-König --- drivers/iio/health/afe4403.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/health/afe4403.c b/drivers/iio/health/afe4403.c index d4921385aaf7..0c355063072c 100644 --- a/drivers/iio/health/afe4403.c +++ b/drivers/iio/health/afe4403.c @@ -589,10 +589,8 @@ static int afe4403_remove(struct spi_device *spi) iio_trigger_unregister(afe->trig); ret = regulator_disable(afe->regulator); - if (ret) { - dev_err(afe->dev, "Unable to disable regulator\n"); - return ret; - } + if (ret) + dev_warn(afe->dev, "Unable to disable regulator\n"); return 0; } From patchwork Wed Oct 13 20:32:20 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: 12556955 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 DDE4AC433EF for ; Wed, 13 Oct 2021 20:32:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C93C36101E for ; Wed, 13 Oct 2021 20:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbhJMUex (ORCPT ); Wed, 13 Oct 2021 16:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbhJMUew (ORCPT ); Wed, 13 Oct 2021 16:34:52 -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 00D8EC061764 for ; Wed, 13 Oct 2021 13:32:48 -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 1makva-0007V8-0v; Wed, 13 Oct 2021 22:32:42 +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 1makvZ-0005ox-F7; Wed, 13 Oct 2021 22:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvS-0000Qs-4s; Wed, 13 Oct 2021 22:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 12/15] iio: imu: st_lsm9ds0: Make st_lsm9ds0_remove() return void Date: Wed, 13 Oct 2021 22:32:20 +0200 Message-Id: <20211013203223.2694577-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=AGeN3Q/SspEn2MoM/pWPCj1QKilHWunS/AuwB8lHJUE=; m=aQQgov2727+jJMLIbWugt+5xwUaxNmBWU2qYBWe9g+0=; p=AVhk4TcHWG+9E/lZnoFWx7WiTReT8KYIL5KdOOGD1rU=; g=2c065251b9b68312a8f2195153169eb00a8981c5 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQgwACgkQwfwUeK3K7Am6UQf/XFw tkypXhwx/2T/31kWq/aroNGe1prZwozqMwxHS05Medkd742cdBHgkQNrOpLJrAYfLxmRfKcOi5lxM LaRXDAcLDZ3ClUKbLK3jDr+7Q2ZV6RQEhBNPxFzkpCpbH6Z2PtB+e4J814yhgK755E0rghMuPU9xx KrnYAeNyFlmn20pztgQde3i4RGLp50lq3csFT7f8+48gbX4vgpcipfDghyjtjRIRRuDY8td3mpyLQ /MzEDEWlil/NmX8uHQrvO0plma58eUPFdDpG6Jflzg3fyibAg4yuRx4zkBuuCtPvbEOM/fYNlsuWf IByyWVUbBkWp3DVBfK32b/U8t3ZL4BQ== 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 st_lsm9ds0_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/iio/imu/st_lsm9ds0/st_lsm9ds0.h | 2 +- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 4 +--- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c | 4 +++- drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h index 146393afd9a7..3f0b24e9eeea 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h @@ -18,6 +18,6 @@ struct st_lsm9ds0 { }; int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap); -int st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0); +void st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0); #endif /* ST_LSM9DS0_H */ diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c index 5e6625140db7..bfd7da4353a8 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c @@ -150,12 +150,10 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap) } EXPORT_SYMBOL_GPL(st_lsm9ds0_probe); -int st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0) +void st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0) { st_magn_common_remove(lsm9ds0->magn); st_accel_common_remove(lsm9ds0->accel); - - return 0; } EXPORT_SYMBOL_GPL(st_lsm9ds0_remove); diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c index 78bede358747..e9205b46a4e6 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c @@ -66,7 +66,9 @@ static int st_lsm9ds0_i2c_probe(struct i2c_client *client) static int st_lsm9ds0_i2c_remove(struct i2c_client *client) { - return st_lsm9ds0_remove(i2c_get_clientdata(client)); + st_lsm9ds0_remove(i2c_get_clientdata(client)); + + return 0; } static struct i2c_driver st_lsm9ds0_driver = { diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c index 180b54e66438..c51164c9f151 100644 --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c @@ -65,7 +65,9 @@ static int st_lsm9ds0_spi_probe(struct spi_device *spi) static int st_lsm9ds0_spi_remove(struct spi_device *spi) { - return st_lsm9ds0_remove(spi_get_drvdata(spi)); + st_lsm9ds0_remove(spi_get_drvdata(spi)); + + return 0; } static struct spi_driver st_lsm9ds0_driver = { From patchwork Wed Oct 13 20:32:21 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: 12556953 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 7BB65C4167E for ; Wed, 13 Oct 2021 20:32:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 61A766101E for ; Wed, 13 Oct 2021 20:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbhJMUex (ORCPT ); Wed, 13 Oct 2021 16:34:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229821AbhJMUew (ORCPT ); Wed, 13 Oct 2021 16:34:52 -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 EBAA0C061762 for ; Wed, 13 Oct 2021 13:32:48 -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 1makva-0007V7-18; Wed, 13 Oct 2021 22:32:42 +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 1makvZ-0005ow-F7; Wed, 13 Oct 2021 22:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvS-0000Qv-A6; Wed, 13 Oct 2021 22:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 13/15] iio: magn: hmc5843: Make hmc5843_common_remove() return void Date: Wed, 13 Oct 2021 22:32:21 +0200 Message-Id: <20211013203223.2694577-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=paU/w1QXIpfyZf5iT4fUwKWcGWmU2R37xBPi6s/awJc=; m=2RHLehit8bD6KauKwTKxVg4+SWlEmso2JOfDvmhRDNU=; p=Ne4EHfhx5H9IDKJlpD2Q14+cYTs1aWd6MRJ9wLSwHGs=; g=2cd00c7ca4a0bb52b217151104e80e4060fda355 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQhAACgkQwfwUeK3K7AlmJgf+Ovc jMf0cNW7YW32p/7nCZR5omrG47EbB9UFm/LzVkgP0vW7KQDbQbAvVZC4S50QFGgNjprNOP5lpW3SP 2wOEAi3berMwEf9XoFTDMpI5Jp+//ba3gq6/arELIDmYjMBOjFW1/Kw+6y5n6k0xEJliDQR9x8/FO KiD3D1bmhK9Gk3r9II90gCRcWOhmIlY4F8sB+4wnvGhbUjencN8T+f0IoPLiG3AP4IFw/FjHvZegE Ejc0HV5ngPUh8IMb+0gCtbDuChJnbseq0y496M+3SNp9dZfP4AkjgjK1yscixOADNlkXCmLyZLi1i rnMcUKmePLBFkhZXjDMcfr/i731V4YA== 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 hmc5843_common_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/iio/magnetometer/hmc5843.h | 2 +- drivers/iio/magnetometer/hmc5843_core.c | 4 +--- drivers/iio/magnetometer/hmc5843_i2c.c | 4 +++- drivers/iio/magnetometer/hmc5843_spi.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/magnetometer/hmc5843.h b/drivers/iio/magnetometer/hmc5843.h index 242f742f2643..9120c8bbf3dd 100644 --- a/drivers/iio/magnetometer/hmc5843.h +++ b/drivers/iio/magnetometer/hmc5843.h @@ -50,7 +50,7 @@ struct hmc5843_data { int hmc5843_common_probe(struct device *dev, struct regmap *regmap, enum hmc5843_ids id, const char *name); -int hmc5843_common_remove(struct device *dev); +void hmc5843_common_remove(struct device *dev); int hmc5843_common_suspend(struct device *dev); int hmc5843_common_resume(struct device *dev); diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c index cf62057480cf..f08726bf5ec3 100644 --- a/drivers/iio/magnetometer/hmc5843_core.c +++ b/drivers/iio/magnetometer/hmc5843_core.c @@ -671,7 +671,7 @@ int hmc5843_common_probe(struct device *dev, struct regmap *regmap, } EXPORT_SYMBOL(hmc5843_common_probe); -int hmc5843_common_remove(struct device *dev) +void hmc5843_common_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); @@ -680,8 +680,6 @@ int hmc5843_common_remove(struct device *dev) /* sleep mode to save power */ hmc5843_set_mode(iio_priv(indio_dev), HMC5843_MODE_SLEEP); - - return 0; } EXPORT_SYMBOL(hmc5843_common_remove); diff --git a/drivers/iio/magnetometer/hmc5843_i2c.c b/drivers/iio/magnetometer/hmc5843_i2c.c index 67fe657fdb3e..bc6e12f1d521 100644 --- a/drivers/iio/magnetometer/hmc5843_i2c.c +++ b/drivers/iio/magnetometer/hmc5843_i2c.c @@ -67,7 +67,9 @@ static int hmc5843_i2c_probe(struct i2c_client *cli, static int hmc5843_i2c_remove(struct i2c_client *client) { - return hmc5843_common_remove(&client->dev); + hmc5843_common_remove(&client->dev); + + return 0; } static const struct i2c_device_id hmc5843_id[] = { diff --git a/drivers/iio/magnetometer/hmc5843_spi.c b/drivers/iio/magnetometer/hmc5843_spi.c index d827554c346e..89cf59a62c28 100644 --- a/drivers/iio/magnetometer/hmc5843_spi.c +++ b/drivers/iio/magnetometer/hmc5843_spi.c @@ -76,7 +76,9 @@ static int hmc5843_spi_probe(struct spi_device *spi) static int hmc5843_spi_remove(struct spi_device *spi) { - return hmc5843_common_remove(&spi->dev); + hmc5843_common_remove(&spi->dev); + + return 0; } static const struct spi_device_id hmc5843_id[] = { From patchwork Wed Oct 13 20:32:22 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: 12556947 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 8DD64C169C3 for ; Wed, 13 Oct 2021 20:32:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64AFC610E5 for ; Wed, 13 Oct 2021 20:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbhJMUew (ORCPT ); Wed, 13 Oct 2021 16:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbhJMUev (ORCPT ); Wed, 13 Oct 2021 16:34:51 -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 5FC7EC06174E for ; Wed, 13 Oct 2021 13:32:47 -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 1makva-0007VD-8M; Wed, 13 Oct 2021 22:32:42 +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 1makvZ-0005p2-ND; Wed, 13 Oct 2021 22:32:41 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvS-0000Qy-J1; Wed, 13 Oct 2021 22:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , kernel@pengutronix.de, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 14/15] iio: potentiometer: max5487: Don't return an error in .remove() Date: Wed, 13 Oct 2021 22:32:22 +0200 Message-Id: <20211013203223.2694577-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=jVPTKwSeclxrMyKXVeMZkRtIkFfWUw7Cm5R85mYX66M=; m=Ny4oct9Jf0z6n4JOPr7OcxYVZiseb8hsZZJoorD1Eu4=; p=/kUxKTIpI1L/SWkpKRbIg3ubFOqQ+I22vGlaTfGNA1k=; g=abfe398bfb2ba7166fc6ee6ef91c0c08715fa870 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQhMACgkQwfwUeK3K7AmUBwf+PdU x0kpDjADPeA7Y68U6Gy2bApY1hOcgMp91lYji/AJJpFfBv+CBsIM7alBhW/Dleq0IuSYgV0ips4LW DNqiaaE1iEvYiO4UHvDNk5pM3OnXnfm6GTMeV7g2HFPzUIME1qGY5xMK+dvL8oKkkGE4q9U/dpufK T+ZTRrfYi9NWyI+TniMuDVvQuuCdo6IraM2w7qm7AGaRQXpqesIoVcisxBhdnJerHIMcPyI1/2z2q uT/jFQbrnpsgbEIcrE3k5lKi5zB8EOxWtfsWj+FT6YL+l35caUVjWJKmq0+AfexW51+tWvaq9kp5i LTI95+U8x3M4ShDrMpdsFSoJfz2wFhA== 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 The only effect of returning an error in an spi .remove() callback is that the spi core issues a generic warning message. Instead emit a more specific error message and return 0 to not report the same issue twice. Signed-off-by: Uwe Kleine-König --- drivers/iio/potentiometer/max5487.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iio/potentiometer/max5487.c b/drivers/iio/potentiometer/max5487.c index 1c0d46a96200..007c2bd324cb 100644 --- a/drivers/iio/potentiometer/max5487.c +++ b/drivers/iio/potentiometer/max5487.c @@ -115,11 +115,16 @@ static int max5487_spi_probe(struct spi_device *spi) static int max5487_spi_remove(struct spi_device *spi) { struct iio_dev *indio_dev = spi_get_drvdata(spi); + int ret; iio_device_unregister(indio_dev); /* save both wiper regs to NV regs */ - return max5487_write_cmd(spi, MAX5487_COPY_AB_TO_NV); + ret = max5487_write_cmd(spi, MAX5487_COPY_AB_TO_NV); + if (ret) + dev_warn(&spi->dev, "Failed to save wiper regs to NV regs\n"); + + return 0; } static const struct spi_device_id max5487_id[] = { From patchwork Wed Oct 13 20:32:23 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: 12556941 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 75232C43219 for ; Wed, 13 Oct 2021 20:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59048610D0 for ; Wed, 13 Oct 2021 20:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbhJMUeu (ORCPT ); Wed, 13 Oct 2021 16:34:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbhJMUer (ORCPT ); Wed, 13 Oct 2021 16:34:47 -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 E5D7DC061760 for ; Wed, 13 Oct 2021 13:32:43 -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 1makvT-0007Fh-C2; Wed, 13 Oct 2021 22:32:35 +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 1makvS-0005nk-Qg; Wed, 13 Oct 2021 22:32:34 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1makvS-0000R1-Pi; Wed, 13 Oct 2021 22:32:34 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mark Brown , Wolfram Sang , kernel@pengutronix.de, linux-i2c@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org Subject: [PATCH 15/15] iio: pressure: ms5611: Make ms5611_remove() return void Date: Wed, 13 Oct 2021 22:32:23 +0200 Message-Id: <20211013203223.2694577-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> References: <20211013203223.2694577-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; i=/VRI7wZRmFcSbOjCVUYLGjkMVb4qhYVytXhgnxhlT8M=; m=lxKoKlZVQowk7xdd1hVtcDO/bwfnAO7kAD40An36nNI=; p=ju0qK/fA1FRs/jFLg2Wz1o5GOd25Mp81ZaVaWpejtdo=; g=cc7f8a2b89009abb1f248faa74e93d27afb4a720 X-Patch-Sig: m=pgp; i=u.kleine-koenig@pengutronix.de; s=0x0D2511F322BFAB1C1580266BE2DCDD9132669BD6; b=iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmFnQhcACgkQwfwUeK3K7AkB0Qf/Qnu zJOfEoVx0mmr8M5D+IKq90Afb8WftaM2TnvMcCq0DP1+mV31i8ctCJxCHUTV1csXD49ykUl9M1DLa 0qJLRJuKYpbv01y5ST+i5eG1sdgd93qw01tUSM5L1GTYWkOMN2ZIcF77asKFlJdg3XnOj+qjW8K7z DZyxLyxJr4coCbhkGsK/OiCCBwN5LqXK0cAU3mOu+V6214WjyCHBke0eoNpD8gI7Czgv8lKqbfMik HW9kimL/VCYmS6P6GI+B4qQWDKZe4oA4Av1Sn4C36DMn5lQ3nXW32Ta1UfkxS53P0prdE10TT8yi4 nd43pzSCzoSGcVJ+/f5D3B69RGykE4Q== 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 ms5611_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/iio/pressure/ms5611.h | 2 +- drivers/iio/pressure/ms5611_core.c | 4 +--- drivers/iio/pressure/ms5611_i2c.c | 4 +++- drivers/iio/pressure/ms5611_spi.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/iio/pressure/ms5611.h b/drivers/iio/pressure/ms5611.h index bc06271fa38b..86b1c4b1820d 100644 --- a/drivers/iio/pressure/ms5611.h +++ b/drivers/iio/pressure/ms5611.h @@ -61,6 +61,6 @@ struct ms5611_state { int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, const char *name, int type); -int ms5611_remove(struct iio_dev *indio_dev); +void ms5611_remove(struct iio_dev *indio_dev); #endif /* _MS5611_H */ diff --git a/drivers/iio/pressure/ms5611_core.c b/drivers/iio/pressure/ms5611_core.c index 214b0d25f598..ee75f08655c9 100644 --- a/drivers/iio/pressure/ms5611_core.c +++ b/drivers/iio/pressure/ms5611_core.c @@ -474,13 +474,11 @@ int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, } EXPORT_SYMBOL(ms5611_probe); -int ms5611_remove(struct iio_dev *indio_dev) +void ms5611_remove(struct iio_dev *indio_dev) { iio_device_unregister(indio_dev); iio_triggered_buffer_cleanup(indio_dev); ms5611_fini(indio_dev); - - return 0; } EXPORT_SYMBOL(ms5611_remove); diff --git a/drivers/iio/pressure/ms5611_i2c.c b/drivers/iio/pressure/ms5611_i2c.c index 7c04f730430c..5c82d80f85b6 100644 --- a/drivers/iio/pressure/ms5611_i2c.c +++ b/drivers/iio/pressure/ms5611_i2c.c @@ -110,7 +110,9 @@ static int ms5611_i2c_probe(struct i2c_client *client, static int ms5611_i2c_remove(struct i2c_client *client) { - return ms5611_remove(i2c_get_clientdata(client)); + ms5611_remove(i2c_get_clientdata(client)); + + return 0; } static const struct of_device_id ms5611_i2c_matches[] = { diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c index 45d3a7d5be8e..79bed64c9b68 100644 --- a/drivers/iio/pressure/ms5611_spi.c +++ b/drivers/iio/pressure/ms5611_spi.c @@ -112,7 +112,9 @@ static int ms5611_spi_probe(struct spi_device *spi) static int ms5611_spi_remove(struct spi_device *spi) { - return ms5611_remove(spi_get_drvdata(spi)); + ms5611_remove(spi_get_drvdata(spi)); + + return 0; } static const struct of_device_id ms5611_spi_matches[] = {