From patchwork Sat Apr 30 08:15:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833079 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2805C433F5 for ; Sat, 30 Apr 2022 08:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231488AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235921AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -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 C854F69CD1 for ; Sat, 30 Apr 2022 01:16:21 -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 1nkiH0-0001IK-45; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH0-0066Xz-Gc; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGy-006aye-Bu; Sat, 30 Apr 2022 10:16:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Paul Cercueil , Hans de Goede , linux-iio@vger.kernel.org Subject: [PATCH 1/9] iio:accel:mc3230: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:15:59 +0200 Message-Id: <20220430081607.15078-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1195; h=from:subject; bh=LJoCLmxjL4bK/cGKmO7RRF+EN+0cBPKoNge1ip1xHJc=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPAkxD5Hi/0nuR6hBZwLN48uys859V7M4EXKOi3h DK2YXZ6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwJAAKCRDB/BR4rcrsCQ5NB/ 93n9cy6Gb5pq69L70Yr2esmU8m336amr3Qw69TLEdUJg+xeod4KRe52PXaOb8k4uNsN59MP7DQEbmI jgGVH2S+bEqcU1wiJ01L7aLPLgUug+6fKtbQl1KMbtlCYSVUIMtS2WvhE82/Zp4PViWzxAMb2Ko9O1 67t0EHIzGvzVquFD8jDB5Ni2r+/zFdanGB1NpO/3vBsCMXYUXaqL9g1RDKjw1mPhcHTIQmQXhRRWRR uYPoTwKuHItGrbsx5YIkHpjAlilcXD8bkpDvaZlcK9aUdcwiUPNdGNXFyRlPxuVDQLjx85P05FmdTY cPCPLDT88kYooUy/Qml1azGqEUvBTY X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As mc3230_set_opcon() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/accel/mc3230.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/mc3230.c b/drivers/iio/accel/mc3230.c index 679e69cd7657..c15d16e7f1da 100644 --- a/drivers/iio/accel/mc3230.c +++ b/drivers/iio/accel/mc3230.c @@ -157,7 +157,9 @@ static int mc3230_remove(struct i2c_client *client) iio_device_unregister(indio_dev); - return mc3230_set_opcon(iio_priv(indio_dev), MC3230_MODE_OPCON_STANDBY); + mc3230_set_opcon(iio_priv(indio_dev), MC3230_MODE_OPCON_STANDBY); + + return 0; } static int mc3230_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833087 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5E6EC433FE for ; Sat, 30 Apr 2022 08:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241051AbiD3ITv (ORCPT ); Sat, 30 Apr 2022 04:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241524AbiD3ITt (ORCPT ); Sat, 30 Apr 2022 04:19: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 D76DA69CD2 for ; Sat, 30 Apr 2022 01:16:28 -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 1nkiH0-0001IN-Ug; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH0-0066YB-Uk; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGy-006ayh-IG; Sat, 30 Apr 2022 10:16:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Andy Shevchenko , Paul Cercueil , Hans de Goede , Alexandru Ardelean , Gwendal Grignou , Guenter Roeck , linux-iio@vger.kernel.org Subject: [PATCH 2/9] iio:accel:stk8312: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:00 +0200 Message-Id: <20220430081607.15078-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1195; h=from:subject; bh=bW/IWm/Go9akrShI8qMcvMWgYEQvG6hbWmEW8JWQToo=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPAnTeir000FC/XV9Yn/jdFUHD3D/C9Y1P+0SVN2 If4EB46JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwJwAKCRDB/BR4rcrsCSl6CA CZ0lFFqj/zomXAvT8gFpQqrnnIZyrChXq+GJVN3eK5Qt/wucrTdOztlvzT3wCd3pbr9CDvMxnCpyYP 0lA791aEaAJPZjWkI2E9BWivS4Gsnt3bIltYFBaOcxtrMm2G6SapGDvQ2P/Uher9fW4GMEFVfowAwo Vvv+RHFldPtaxEP7Q+IeNzoOY5kqrPDRN+78w+y2GiU1dqRDBZE6SBxBu5J4c7bF99rmtT6+KIImI6 aCG6lWmyNbp0IIcLFgNtQcGMt+znciD9ByO1yp9+/xPsWs98kYpJjMo50x2rtMKMztbCGFVd4c6u11 FZyC1+4C36GluobPy5100dvjzfnhGv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As stk8312_set_mode() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/accel/stk8312.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/stk8312.c b/drivers/iio/accel/stk8312.c index a71dfff3ca4a..ceca28913355 100644 --- a/drivers/iio/accel/stk8312.c +++ b/drivers/iio/accel/stk8312.c @@ -608,7 +608,9 @@ static int stk8312_remove(struct i2c_client *client) if (data->dready_trig) iio_trigger_unregister(data->dready_trig); - return stk8312_set_mode(data, STK8312_MODE_STANDBY); + stk8312_set_mode(data, STK8312_MODE_STANDBY); + + return 0; } static int stk8312_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833085 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A161C433F5 for ; Sat, 30 Apr 2022 08:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241501AbiD3ITr (ORCPT ); Sat, 30 Apr 2022 04:19:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234834AbiD3ITp (ORCPT ); Sat, 30 Apr 2022 04:19: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 16F8369CD1 for ; Sat, 30 Apr 2022 01:16:24 -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 1nkiH0-0001IM-Is; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH0-0066Y7-On; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGy-006ayk-NQ; Sat, 30 Apr 2022 10:16:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Andy Shevchenko , Paul Cercueil , Gwendal Grignou , linux-iio@vger.kernel.org Subject: [PATCH 3/9] iio:accel:stk8ba50: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:01 +0200 Message-Id: <20220430081607.15078-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1209; h=from:subject; bh=Ek48z4TMAclDv0XMQ3lqjoa1O7GUUH+sC06Xit9z5Mw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPAqDUb26gNoWLx2CLATlpwOiwuprhXcOvKCf1yC t6ABJWiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwKgAKCRDB/BR4rcrsCadyB/ sFkCrRfNTqj1pD8g4uqaTcyJQ6mvdRskktimz5FFGmo57/rZTomuYzj2kMBS36852e/sPUZdsj+whj KudoH5MKMDhFd2TRHzuNYkJm9yN8JXn46rCIcuuTNxEjFrzt16m6pLYiRSlwheOnh0eLfQjHDRuQS8 FoOmmp7IJRAxDN11XfkVXNkhIbWNBv0CJ/xrrpJ8TvdlDTuWpeHimDmrszGsMpKXA5Nxj6iTpld6uQ osi0dcBVadVha+Y96xbfPB+owX0M0e9qQA1AgTbZ0gj1RTGWciZmB0zcL54oKCmSdMdmB/5pEF1xIp 34CLqu2fJy6RoklvRwGT8cbQ6a3Tjo X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As stk8ba50_set_mode() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/accel/stk8ba50.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/accel/stk8ba50.c b/drivers/iio/accel/stk8ba50.c index 0067ec5cbae8..7d59efb41e22 100644 --- a/drivers/iio/accel/stk8ba50.c +++ b/drivers/iio/accel/stk8ba50.c @@ -501,7 +501,9 @@ static int stk8ba50_remove(struct i2c_client *client) if (data->dready_trig) iio_trigger_unregister(data->dready_trig); - return stk8ba50_set_power(data, STK8BA50_MODE_SUSPEND); + stk8ba50_set_power(data, STK8BA50_MODE_SUSPEND); + + return 0; } static int stk8ba50_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833084 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 142DEC433EF for ; Sat, 30 Apr 2022 08:16:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240596AbiD3ITq (ORCPT ); Sat, 30 Apr 2022 04:19:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241051AbiD3ITo (ORCPT ); Sat, 30 Apr 2022 04:19:44 -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 D893169CCD for ; Sat, 30 Apr 2022 01:16:23 -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 1nkiH0-0001IO-Iu; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH1-0066YF-62; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGy-006ayn-Sr; Sat, 30 Apr 2022 10:16:12 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Paul Cercueil , Linus Walleij , linux-iio@vger.kernel.org Subject: [PATCH 4/9] iio:light:bh1780: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:02 +0200 Message-Id: <20220430081607.15078-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1348; h=from:subject; bh=pmZI+SKvg18J6ZIUxTXLriEEylgoCbEw4pJUSaBp42g=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPAu9CFP8UYkDGdbT7chw+zqiuCalplcjmty+fAg mWcg8SGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwLgAKCRDB/BR4rcrsCWBfB/ wMXoVKCIQ5gcDWnCjw2wdyXl0ZtR5gHJXjezGw8PrWb2bIiNuAuqr71dTy0YgZHs9aqwd8cmfwylBw ZbS+Nn159F4R4OfSrjJFiM4r0R8E0VDca9L8Am+duzYAbcjp0InYhM1aAqwqwXDvcUrXkmOk2ItaRK yDOkVPlPpalVYWg4BzuWCosqNp5XLrrupt0EZ5uGMtBS7IN89a1fAG4vv5UpTdbsCxzNcdADdrapKj MB0suR85y7Ft6tfv2ShmFRLanA/N/626mOsU8KtdxpGwEuD8Jm4J1jfxVR7ZxXACKWM2/aY+eRcBHo bDhch1YJ9IBU7r9an20aBImDiFR+wU X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As bh1780_remove() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. While at it, add the error code to the remaining error message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König Reviewed-by: Linus Walleij --- drivers/iio/light/bh1780.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/light/bh1780.c b/drivers/iio/light/bh1780.c index 790d3d613979..fc7141390117 100644 --- a/drivers/iio/light/bh1780.c +++ b/drivers/iio/light/bh1780.c @@ -213,10 +213,9 @@ static int bh1780_remove(struct i2c_client *client) pm_runtime_put_noidle(&client->dev); pm_runtime_disable(&client->dev); ret = bh1780_write(bh1780, BH1780_REG_CONTROL, BH1780_POFF); - if (ret < 0) { - dev_err(&client->dev, "failed to power off\n"); - return ret; - } + if (ret < 0) + dev_err(&client->dev, "failed to power off (%pe)\n", + ERR_PTR(ret)); return 0; } From patchwork Sat Apr 30 08:16:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833081 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6709C433FE for ; Sat, 30 Apr 2022 08:16:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239028AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbiD3ITm (ORCPT ); Sat, 30 Apr 2022 04:19:42 -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 3984F69CC4 for ; Sat, 30 Apr 2022 01:16:21 -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 1nkiH0-0001IR-L7; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH1-0066YK-BK; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGz-006ayq-2U; Sat, 30 Apr 2022 10:16:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mauro Carvalho Chehab , linux-iio@vger.kernel.org Subject: [PATCH 5/9] iio:light:isl29028: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:03 +0200 Message-Id: <20220430081607.15078-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1217; h=from:subject; bh=ledxJqETrx+gIzE0JloH+QkMnJ1iTPyNpj82jtf8+/o=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPAxBDQg/jCs0qzucfGYzTI+H58+5SpbF+FKB50F 4/20VMuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwMQAKCRDB/BR4rcrsCQjCB/ 9SiZiawoDWSqz7355F2+oJot6BIhmPSHXWVw7t93eVTWuSxSRiwu2H0Uin9xrzv0c/F9K8dGp/WRvP 0ekX2SVaASKEmibNsqqCKwTSREJpFBshs5p/9frIQyl+ZPW02yTfc/8KaNJQQW3DW+sfM1QvB7YYUR lHbsAEAr4moInXQCh5KIntI42BmZmaIdMjjuKPPYtvVSzav+l+iRhlv7a0nLUUkqqhWSzn7FzFqV4x 427CO6AoNC1WAb+hLuSJ0/o0yJ3vVXAaY2BiEueGtRpZK+AbqXVBDPwncbkvUXd7lCwTYsrpglQzgZ I1uw3g588iXAsuivVB+IK8VoLq1f1R X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As isl29028_clear_configure_ret() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/light/isl29028.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c index 9de3262aa688..720fa83d44e0 100644 --- a/drivers/iio/light/isl29028.c +++ b/drivers/iio/light/isl29028.c @@ -646,7 +646,9 @@ static int isl29028_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - return isl29028_clear_configure_reg(chip); + isl29028_clear_configure_reg(chip); + + return 0; } static int __maybe_unused isl29028_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833080 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4877BC4332F for ; Sat, 30 Apr 2022 08:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235921AbiD3ITo (ORCPT ); Sat, 30 Apr 2022 04:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -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 D782C69CD2 for ; Sat, 30 Apr 2022 01:16:21 -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 1nkiH0-0001IS-LA; Sat, 30 Apr 2022 10:16:14 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH1-0066YJ-BK; Sat, 30 Apr 2022 10:16:13 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGz-006ayv-8A; Sat, 30 Apr 2022 10:16:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Paul Cercueil , linux-iio@vger.kernel.org Subject: [PATCH 6/9] iio:light:jsa1212: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:04 +0200 Message-Id: <20220430081607.15078-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1121; h=from:subject; bh=HIuLBqPE2iMXhOww4himHujsKZ+wU0j6R0Y5bQS/8AY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPA0eLU9Cn5miYwAGqDxAx43XDB7d/VQuGF1AomE 6TQYJKmJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwNAAKCRDB/BR4rcrsCa7vB/ 4ugCTCV9PDk8h8D5pi0gG9FkOT151/W6/TixzNiJ8XQhimHxdBqr/wXOSBSSecvKPqGETVeDlz1i5C Z4+dgVeFWAWpeIyJqFSJ/T1kUcHC2jCluPdF504IYxmC9ahgzOIBfMblVHOC/rcq4VBxo60UhPoK7N 0l+h1E3TSIMfegY5kpWDNjqJcHwJJq+O3r5I5tNbTJovl/99Gmc4PznemZAsTSNi+Lvmoqd4fDquXD 5XmwfJLbiTewdh6og+8mT8DkmG4Ll05JCwO8LRS74OGguAusaRgYpJS2pBPR1QNHfLkVzKiyi8FtbD Y5VGdYMQqfF9FC5HMu5ODZjNbgONW0 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As jsa1212_power_off() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/light/jsa1212.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/jsa1212.c b/drivers/iio/light/jsa1212.c index a55194263d23..5387c12231cf 100644 --- a/drivers/iio/light/jsa1212.c +++ b/drivers/iio/light/jsa1212.c @@ -380,7 +380,9 @@ static int jsa1212_remove(struct i2c_client *client) iio_device_unregister(indio_dev); - return jsa1212_power_off(data); + jsa1212_power_off(data); + + return 0; } static int jsa1212_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833082 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07238C433EF for ; Sat, 30 Apr 2022 08:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbiD3ITo (ORCPT ); Sat, 30 Apr 2022 04:19:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234834AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -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 48E1A69CD4 for ; Sat, 30 Apr 2022 01:16:22 -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 1nkiH2-0001IW-5b; Sat, 30 Apr 2022 10:16:16 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH1-0066YQ-I8; Sat, 30 Apr 2022 10:16:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGz-006ayz-DE; Sat, 30 Apr 2022 10:16:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Jiri Valek - 2N , linux-iio@vger.kernel.org Subject: [PATCH 7/9] iio:light:opt3001: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:05 +0200 Message-Id: <20220430081607.15078-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1311; h=from:subject; bh=jp68kHvZVFA2TNSPUEwZBFrkdizumMvUxTX4vs3LMPY=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPA3XEYgcEdOH3hFJPfhziFE9ibHXhrBoplB/B62 UnpAw9mJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwNwAKCRDB/BR4rcrsCbzAB/ oCBVUfuGx1AGLQe/VaFs/eqyOecr+Q+5F13WGkhCUk4yVp1ePMGuqSBKirbQ7eXMJxuifuDEZLOJy4 l1WgwogNUS2FMLHnoMl1oPxNuA1TzKZcZ+vDVyuyeN+5Zr6cmp0moDV97n9F+Nhz6SUmRSolgyjDqT 4HiJNilR5hayIwFMTNwOjYuZ0KgZvC/XmLJB584xUCCeF6BjPh+rs5TNSlEireteX15Ay5C6fj8QY3 wNJ1JNSF0Q5gNUeVgqTbOcz3f+kTBX8dtedLn7IgxxJm7kACi1JL0t96B63rKLodkZH/w4yXGnH18z 5O34wcTLd+2lVgqjRtT8Kw5EZ5IaDG X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As opt3001_remove() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/light/opt3001.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c index 1880bd5bb258..a326d47afc9b 100644 --- a/drivers/iio/light/opt3001.c +++ b/drivers/iio/light/opt3001.c @@ -808,7 +808,7 @@ static int opt3001_remove(struct i2c_client *client) if (ret < 0) { dev_err(opt->dev, "failed to read register %02x\n", OPT3001_CONFIGURATION); - return ret; + return 0; } reg = ret; @@ -819,7 +819,6 @@ static int opt3001_remove(struct i2c_client *client) if (ret < 0) { dev_err(opt->dev, "failed to write register %02x\n", OPT3001_CONFIGURATION); - return ret; } return 0; From patchwork Sat Apr 30 08:16:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833078 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8EE2C433EF for ; Sat, 30 Apr 2022 08:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236188AbiD3ITn (ORCPT ); Sat, 30 Apr 2022 04:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234834AbiD3ITm (ORCPT ); Sat, 30 Apr 2022 04:19:42 -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 3FED569CCD for ; Sat, 30 Apr 2022 01:16:21 -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 1nkiH1-0001Io-Aq; Sat, 30 Apr 2022 10:16:15 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH2-0066YU-2i; Sat, 30 Apr 2022 10:16:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGz-006az3-JO; Sat, 30 Apr 2022 10:16:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Paul Cercueil , linux-iio@vger.kernel.org Subject: [PATCH 8/9] iio:light:stk3310: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:06 +0200 Message-Id: <20220430081607.15078-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1325; h=from:subject; bh=jeBOu6GxzNpAZs1ilUmEmXXaU0A76NBDF02smFwACRA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPA75A9akx37Wc+zB3SKp1lYFAp8xs5vXqMygzlk pWTXHbOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwOwAKCRDB/BR4rcrsCfGZB/ wI60WGRkvHSINnWlN32hfNPkEVo7V6ZIE3JP6Xrd+Cq4MSrdWTYTrYXl1KvO8VEMtdHZHgz9YGfgMd l2WKvPAZ0usnGJvTPMGVfy9cI8drffQZbRAkhbg9c8zWEl3z7voRiDFpqUROGvT21EtpI16iJxw1F4 S3PZ3BYnW58OYbnotlv8gcSNilgAdWNRqM71Ehg+m1aAOkqRUn1j0z6iYIN6iN6pOhUs2i3InS/cJi iI6EszISVMccRbd89GJGTMM+hV+jRu/UqghrwKCD23H/7yRMGKiP2gyRKGlLXphVaYRZtaj8rR6wlI /Ur/YGozurSDvhm+92r+C7EevQ6eDI X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As stk3310_set_state() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/light/stk3310.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 1d02dfbc29d1..95a98af08b8a 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -627,9 +627,12 @@ static int stk3310_probe(struct i2c_client *client, static int stk3310_remove(struct i2c_client *client) { struct iio_dev *indio_dev = i2c_get_clientdata(client); + int ret; iio_device_unregister(indio_dev); - return stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); + stk3310_set_state(iio_priv(indio_dev), STK3310_STATE_STANDBY); + + return 0; } static int stk3310_suspend(struct device *dev) From patchwork Sat Apr 30 08:16:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 12833086 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1A8EC433EF for ; Sat, 30 Apr 2022 08:16:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234834AbiD3ITs (ORCPT ); Sat, 30 Apr 2022 04:19:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241469AbiD3ITq (ORCPT ); Sat, 30 Apr 2022 04:19:46 -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 78C3D69CCD for ; Sat, 30 Apr 2022 01:16:25 -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 1nkiH3-0001Iw-1l; Sat, 30 Apr 2022 10:16:17 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nkiH2-0066YY-5d; Sat, 30 Apr 2022 10:16:14 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nkiGz-006az6-Oy; Sat, 30 Apr 2022 10:16:13 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jonathan Cameron Cc: Lars-Peter Clausen , Mauro Carvalho Chehab , Colin Ian King , Brian Masney , linux-iio@vger.kernel.org Subject: [PATCH 9/9] iio:light:tsl2583: Remove duplicated error reporting in .remove() Date: Sat, 30 Apr 2022 10:16:07 +0200 Message-Id: <20220430081607.15078-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> References: <20220430081607.15078-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1238; h=from:subject; bh=SOQeCVCK05+5ktyNKo67KJfuK9AYd8RWaj5Y3wRiGp8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBibPA+IJ0luLCvhor20larPoZEpXsXnl8qbhuDbPuH +NPBKvGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCYmzwPgAKCRDB/BR4rcrsCXbYB/ 97RyI0+xF79G99uzLSJAWzajxQabHVNlGGZ9OYWqtUrV+9rIkv8cm2uK5iULaGLCEbpLzj8w8X0o3p wXq2uv7K+hEgvzZlD+Yb3rwFdddSN97Qv+u743iYWPuQD++p+QUXjvT5Y0uOOtb6sfxaEvjuDkbWU/ 4bCkDEwd57hLshzWkiFDk58EPsUiz3xeK+56fbLqN3CZI5bNHIESqphz5ucXALr3sr76iGRH3kmV82 ao1cEAjck3/Htf3IndK+0Q2tw7UuAOF6vYWy/nhVziEdEF104PYVlhv2IMPCt62GeVxF1aolM/WYyT BwijiRJ8wm08bUGHviqnmq5TUPlOCt X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-iio@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Returning an error value in an i2c remove callback results in an error message being emitted by the i2c core, but otherwise it doesn't make a difference. The device goes away anyhow and the devm cleanups are called. As tsl2583_set_power_state() already emits an error message on failure and the additional error message by the i2c core doesn't add any useful information, change the return value to zero to suppress this message. This patch is a preparation for making i2c remove callbacks return void. Signed-off-by: Uwe Kleine-König --- drivers/iio/light/tsl2583.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c index 7e101d5f72ee..efb3c13cfc87 100644 --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -883,7 +883,9 @@ static int tsl2583_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - return tsl2583_set_power_state(chip, TSL2583_CNTL_PWR_OFF); + tsl2583_set_power_state(chip, TSL2583_CNTL_PWR_OFF); + + return 0; } static int __maybe_unused tsl2583_suspend(struct device *dev)