From patchwork Wed Aug 26 14:51:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 012B3C433DF for ; Wed, 26 Aug 2020 14:52:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D17912224D for ; Wed, 26 Aug 2020 14:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453556; bh=9WnEmDPaImvJaOTWnFx8b/OSZEA9nx5y8bHKHDlhKUI=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=uYxmOTpiyxh3G4sLxBIL+cf5nbuKQvTE8T3LRV886HQAW25aJoYwRHlZhifaEd7YS Vir0xJ1mBRQ5MTGzDiddBIBoBXTVNfxAIGsWubleFodvKWXDQTlNsWdTJU0u1I6uNG CgF4Y3pRQ3T74kDtn/Z6OdmRZyR8LtllkW6ChdtE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbgHZOwg (ORCPT ); Wed, 26 Aug 2020 10:52:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727115AbgHZOwO (ORCPT ); Wed, 26 Aug 2020 10:52:14 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C0EAE22B3F; Wed, 26 Aug 2020 14:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453533; bh=9WnEmDPaImvJaOTWnFx8b/OSZEA9nx5y8bHKHDlhKUI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aJrqJa6HvWi+UDeHiktjcnwsc8pvpxK3yOD/bTOpc0gZ0Dz5jNA/JXWkV9VjM1hSi EZG3uyLXtjiAu642kY2Xla9sVjz6itQu/EscsjJ+s45ehCjWuRtu4Ye+wq19dH8gsP mAoIMP6wd/aAK7HX8R5JQR+boq/TIuNLctb4AbFY= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 02/16] iio: accel: mma8452: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:39 +0200 Message-Id: <20200826145153.10444-2-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/accel/mma8452.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index 4e6e70250048..104b87b98455 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -1538,22 +1538,14 @@ static int mma8452_probe(struct i2c_client *client, data->chip_info = match->data; data->vdd_reg = devm_regulator_get(&client->dev, "vdd"); - if (IS_ERR(data->vdd_reg)) { - if (PTR_ERR(data->vdd_reg) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(&client->dev, "failed to get VDD regulator!\n"); - return PTR_ERR(data->vdd_reg); - } + if (IS_ERR(data->vdd_reg)) + return dev_err_probe(&client->dev, PTR_ERR(data->vdd_reg), + "failed to get VDD regulator!\n"); data->vddio_reg = devm_regulator_get(&client->dev, "vddio"); - if (IS_ERR(data->vddio_reg)) { - if (PTR_ERR(data->vddio_reg) == -EPROBE_DEFER) - return -EPROBE_DEFER; - - dev_err(&client->dev, "failed to get VDDIO regulator!\n"); - return PTR_ERR(data->vddio_reg); - } + if (IS_ERR(data->vddio_reg)) + return dev_err_probe(&client->dev, PTR_ERR(data->vddio_reg), + "failed to get VDDIO regulator!\n"); ret = regulator_enable(data->vdd_reg); if (ret) { From patchwork Wed Aug 26 14:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79DAAC433E3 for ; Wed, 26 Aug 2020 14:58:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52EE421741 for ; Wed, 26 Aug 2020 14:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453885; bh=0BJzEKvQ44LGzPY9kSUrwxv7Ki3QbBPW0SdS15oQN5E=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=XOCAFv1RJn0puBNYL4u8sk1euWJxiDu/sVD1RLVeaFmMmJnizrk2yRDCtWdEDC3he 3U0h3FYedVhXhvda/D4D20SknlLYOM+NhiiVDFCyqp3mjl9aK6NbHbVBStj439SKOR KQnasrEFRkieqIrkJnAGkk7XPvw8v7cHZvhpfv2I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbgHZOwg (ORCPT ); Wed, 26 Aug 2020 10:52:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727774AbgHZOwT (ORCPT ); Wed, 26 Aug 2020 10:52:19 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 44A8022B40; Wed, 26 Aug 2020 14:52:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453539; bh=0BJzEKvQ44LGzPY9kSUrwxv7Ki3QbBPW0SdS15oQN5E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vLeiuX8dqkF1ILp+s6YfKWBeEPj1isB94J2AOD4ZWu4h9uuQ+odO28g6fwvx62i3j JhRBQwWv+pGHNl1x/53Y1mCgqfMXMx0XoMqp+jNA2yIBgbDPrRqzQ75bfGIhXF8gTU +Dbct08w/0wIm+JwqVTyud5Aw0G3kXEuhO697oH0= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 03/16] iio: adc: envelope-detector: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:40 +0200 Message-Id: <20200826145153.10444-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/envelope-detector.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/iio/adc/envelope-detector.c b/drivers/iio/adc/envelope-detector.c index 2a4fd3bb64cf..d73eac36153f 100644 --- a/drivers/iio/adc/envelope-detector.c +++ b/drivers/iio/adc/envelope-detector.c @@ -348,11 +348,9 @@ static int envelope_detector_probe(struct platform_device *pdev) indio_dev->num_channels = 1; env->dac = devm_iio_channel_get(dev, "dac"); - if (IS_ERR(env->dac)) { - if (PTR_ERR(env->dac) != -EPROBE_DEFER) - dev_err(dev, "failed to get dac input channel\n"); - return PTR_ERR(env->dac); - } + if (IS_ERR(env->dac)) + return dev_err_probe(dev, PTR_ERR(env->dac), + "failed to get dac input channel\n"); env->comp_irq = platform_get_irq_byname(pdev, "comp"); if (env->comp_irq < 0) @@ -360,11 +358,9 @@ static int envelope_detector_probe(struct platform_device *pdev) ret = devm_request_irq(dev, env->comp_irq, envelope_detector_comp_isr, 0, "envelope-detector", env); - if (ret) { - if (ret != -EPROBE_DEFER) - dev_err(dev, "failed to request interrupt\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to request interrupt\n"); + env->comp_irq_trigger = irq_get_trigger_type(env->comp_irq); if (env->comp_irq_trigger & IRQF_TRIGGER_RISING) env->comp_irq_trigger_inv |= IRQF_TRIGGER_FALLING; From patchwork Wed Aug 26 14:51:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22279C433E3 for ; Wed, 26 Aug 2020 14:52:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9150221E2 for ; Wed, 26 Aug 2020 14:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453559; bh=63gj/uTCsFYMkt/AT+w/CDkwgSGu5Zbr+ERRB5p1wnM=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=lAewySU+NuWdo1MIv2NqzysyPKhofP2d3n5BHfHolML0P2k+yYio8I3BtxrFyf7HR oDa1Osi42VLc6StjAckpwZypldJN5PC2Tkt46r1B/wg0r458hKkOaNh2sdplP6Z/k3 aTWxZ4eWtU65P2DnIW+CxGj0yMPo/FJG/ywN8jak= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728120AbgHZOwi (ORCPT ); Wed, 26 Aug 2020 10:52:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:39080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbgHZOwg (ORCPT ); Wed, 26 Aug 2020 10:52:36 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB1AE22B49; Wed, 26 Aug 2020 14:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453556; bh=63gj/uTCsFYMkt/AT+w/CDkwgSGu5Zbr+ERRB5p1wnM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=scRXfuu4/yARMyjVu4iOTRUPGt1hx6peEuIk9y8eFtgIVQYLomR53puCOev9UkHHJ EyjYbSqVxfgLxRuXiNTv70BbRe4hgcfzIfnnMbBDQx+hwWmna8crZUBjRme5mKaV1S 2sU/mqv4LdijkoZN0cS4IuKctuQF3Jkf+P02J/tI= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 06/16] iio: adc: meson_saradc: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:43 +0200 Message-Id: <20200826145153.10444-6-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/meson_saradc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 93c2252c0b89..a9d06e8a576a 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio/adc/meson_saradc.c @@ -719,11 +719,8 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev) if (ret == -ENODEV) return 0; - if (ret != -EPROBE_DEFER) - dev_err(indio_dev->dev.parent, - "failed to get temperature_calib cell\n"); - - return ret; + return dev_err_probe(indio_dev->dev.parent, ret, + "failed to get temperature_calib cell\n"); } priv->tsc_regmap = From patchwork Wed Aug 26 14:51:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A684C433DF for ; Wed, 26 Aug 2020 14:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E22632224D for ; Wed, 26 Aug 2020 14:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453564; bh=puGjOEDLy1X0v7TsUcfxnMsdsGraY1mRsNBw6Wv3Cv4=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=ZnzPosuJjFv+9wbpE38/xMwmgKUqRJBTgDEPdKe62P+9gnyrBBkDTk7e9f+F8trkX qiRGkCudymP9w0Tw2m5Zh/gla0/5bv3t3U6+eSean/ybjT5ZChsl+q5SyM43dOny+d CpwKAhNeufqW3wcm2MaueWcQfRp1dQrjmp0NBUIA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727111AbgHZOwn (ORCPT ); Wed, 26 Aug 2020 10:52:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:39292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728135AbgHZOwl (ORCPT ); Wed, 26 Aug 2020 10:52:41 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69A5B2078D; Wed, 26 Aug 2020 14:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453561; bh=puGjOEDLy1X0v7TsUcfxnMsdsGraY1mRsNBw6Wv3Cv4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ldIBv5k3e8+FgbZ2n0OafK9d/gfOuB8cpZ3ndZLJbp0j51kuUE4udvnkuwnRZhk6E VCbrjo05ajjrlxIrvwUmAYd963AMJ/HR3rw3z8bcjYfSevDPJHo6BMt8NCVX/SfASx OjqFXjQIkWcN0Q8QtJtMZ+iN5Uq6VI9zPsWy5veI= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 07/16] iio: adc: rcar-gyroadc: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:44 +0200 Message-Id: <20200826145153.10444-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/rcar-gyroadc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c index d2c1419e72a0..dcaefc108ff6 100644 --- a/drivers/iio/adc/rcar-gyroadc.c +++ b/drivers/iio/adc/rcar-gyroadc.c @@ -495,12 +495,9 @@ static int rcar_gyroadc_probe(struct platform_device *pdev) return PTR_ERR(priv->regs); priv->clk = devm_clk_get(dev, "fck"); - if (IS_ERR(priv->clk)) { - ret = PTR_ERR(priv->clk); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get IF clock (ret=%i)\n", ret); - return ret; - } + if (IS_ERR(priv->clk)) + return dev_err_probe(dev, PTR_ERR(priv->clk), + "Failed to get IF clock\n"); ret = rcar_gyroadc_parse_subdevs(indio_dev); if (ret) From patchwork Wed Aug 26 14:51:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257333 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6293C433E4 for ; Wed, 26 Aug 2020 14:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB65E22B49 for ; Wed, 26 Aug 2020 14:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453581; bh=kkISLubLn02Pqd4uTanIQMpVWj7X3BN+1/yofvSuWc8=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=Ce+aOjuPgVLDRD/jBrodCSONE83fmZznfbhU7PRQYOAaCzdHL/KRq7aYGsvqTs8a1 dfuS++27ayqcJxHsRszs0WbDLfpIlYjuvHRIycCq5/pT9y8jlIbYLleZWHPuKj7H7R foy0QnHBkT1UTixrd6GbTXHbNmg102/94zPnA494= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbgHZOw5 (ORCPT ); Wed, 26 Aug 2020 10:52:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726870AbgHZOwx (ORCPT ); Wed, 26 Aug 2020 10:52:53 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FABE2177B; Wed, 26 Aug 2020 14:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453572; bh=kkISLubLn02Pqd4uTanIQMpVWj7X3BN+1/yofvSuWc8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H83nW6V5S3urOUpULphtz3zccovbw9g0fFCefrjuYoLXand4Ge+9p3+Qyf/Srtffc YmReJ+BHI1bG1UUo4u3E1DyrY/ZG2fhUgi/JEZbJBWLnHhmG2Rw6sbUKkSHiVsfKm3 XeueJ6nAcItK/oN4JmekPru4Me0xq7pfmGDQHOR8= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 09/16] iio: afe: iio-rescale: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:46 +0200 Message-Id: <20200826145153.10444-9-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/afe/iio-rescale.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c index 69c0f277ada0..e42ea2b1707d 100644 --- a/drivers/iio/afe/iio-rescale.c +++ b/drivers/iio/afe/iio-rescale.c @@ -276,11 +276,9 @@ static int rescale_probe(struct platform_device *pdev) int ret; source = devm_iio_channel_get(dev, NULL); - if (IS_ERR(source)) { - if (PTR_ERR(source) != -EPROBE_DEFER) - dev_err(dev, "failed to get source channel\n"); - return PTR_ERR(source); - } + if (IS_ERR(source)) + return dev_err_probe(dev, PTR_ERR(source), + "failed to get source channel\n"); sizeof_ext_info = iio_get_channel_ext_info_count(source); if (sizeof_ext_info) { From patchwork Wed Aug 26 14:51:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9353AC433E3 for ; Wed, 26 Aug 2020 14:57:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E3952078D for ; Wed, 26 Aug 2020 14:57:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453859; bh=T5xvC4E4MsMwGEUX1i7xJJFIfrS9fUuZLYOkjgS9wJs=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=iajrykSVzCiC0Z9LHa7C9gpbS/mJhFDha6uyStNfVtNJZ7c+SI7bjVjjEvubGPybL pw3Tl7f3ADSLrpc/PxS7n/z0OIkpwCthJ7taR/cJT+wQL381IUBgDzv1vpQdLycpQz pVxbtNZPGFQZwgfY+ZlBv7oSC7RcePoc1IFUjYSY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbgHZO5h (ORCPT ); Wed, 26 Aug 2020 10:57:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:40144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbgHZOxJ (ORCPT ); Wed, 26 Aug 2020 10:53:09 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 274E822B47; Wed, 26 Aug 2020 14:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453589; bh=T5xvC4E4MsMwGEUX1i7xJJFIfrS9fUuZLYOkjgS9wJs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TcqQ7VNMtsK+sKv7CWZAgceEyGN4b2Kv4KecHfDzf2y6sQudrL/XO+CMTh0E0YAHT nl4Y8124+m8Egy0EyY4N9B+q4hWpeo7q4e+KRsmcpuEW0ZA3wnnH+0gc4ebw5vvi+b kj8Mh0mQoca0QAp+eL6ifjaReTfgXrfyoF5MrhPE= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 12/16] iio: dac: dpot-dac: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:49 +0200 Message-Id: <20200826145153.10444-12-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/dac/dpot-dac.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/iio/dac/dpot-dac.c b/drivers/iio/dac/dpot-dac.c index be61c3b01e8b..2258535b8a42 100644 --- a/drivers/iio/dac/dpot-dac.c +++ b/drivers/iio/dac/dpot-dac.c @@ -183,18 +183,14 @@ static int dpot_dac_probe(struct platform_device *pdev) indio_dev->num_channels = 1; dac->vref = devm_regulator_get(dev, "vref"); - if (IS_ERR(dac->vref)) { - if (PTR_ERR(dac->vref) != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to get vref regulator\n"); - return PTR_ERR(dac->vref); - } + if (IS_ERR(dac->vref)) + return dev_err_probe(&pdev->dev, PTR_ERR(dac->vref), + "failed to get vref regulator\n"); dac->dpot = devm_iio_channel_get(dev, "dpot"); - if (IS_ERR(dac->dpot)) { - if (PTR_ERR(dac->dpot) != -EPROBE_DEFER) - dev_err(dev, "failed to get dpot input channel\n"); - return PTR_ERR(dac->dpot); - } + if (IS_ERR(dac->dpot)) + return dev_err_probe(&pdev->dev, PTR_ERR(dac->dpot), + "failed to get dpot input channel\n"); ret = iio_get_channel_type(dac->dpot, &type); if (ret < 0) From patchwork Wed Aug 26 14:51:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257330 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0189C433DF for ; Wed, 26 Aug 2020 14:57:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A56B22078D for ; Wed, 26 Aug 2020 14:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453834; bh=L62NHGTlHRmxfW0UXMzF8rz6Eg4TzDjh28d5OkWRb1E=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=g0jPT0uymzBIHYce2MUjJ9j6g+TVe4ypg4OPVq0xs9MK2THHfrTt1RVw9JpuDHS05 M+e2bY5oUjPJreZTgheDEC4XkDTmZ1eakrkPe7EvYpdXpxEZTNln/jNlRR9WIIxugE KrHxdvCP0LUnjUb9QzzMWmWcAc0oRjBUqKZ/kEy0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726831AbgHZO46 (ORCPT ); Wed, 26 Aug 2020 10:56:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:40618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbgHZOxX (ORCPT ); Wed, 26 Aug 2020 10:53:23 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3DB7921741; Wed, 26 Aug 2020 14:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453602; bh=L62NHGTlHRmxfW0UXMzF8rz6Eg4TzDjh28d5OkWRb1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vP/Bl97+JtTx4OaxuqQf637JfAncWM+cvwXtDyt0M8X8AQGOnemx5q4V2euAPCZtf WMttIrtvRRJoKWifKDkfX1+8Lk9eoqJepIe0UPQtCofwtHrOo0FSV5Ulu90tABrKky CgwWyQQVxz02bZRXieUrcDYksXCsOiCqHlrCVigs= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 14/16] iio: light: isl29018: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:51 +0200 Message-Id: <20200826145153.10444-14-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/light/isl29018.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/light/isl29018.c b/drivers/iio/light/isl29018.c index ac8ad0f32689..2689867467a8 100644 --- a/drivers/iio/light/isl29018.c +++ b/drivers/iio/light/isl29018.c @@ -746,12 +746,9 @@ static int isl29018_probe(struct i2c_client *client, chip->suspended = false; chip->vcc_reg = devm_regulator_get(&client->dev, "vcc"); - if (IS_ERR(chip->vcc_reg)) { - err = PTR_ERR(chip->vcc_reg); - if (err != -EPROBE_DEFER) - dev_err(&client->dev, "failed to get VCC regulator!\n"); - return err; - } + if (IS_ERR(chip->vcc_reg)) + return dev_err_probe(&client->dev, PTR_ERR(chip->vcc_reg), + "failed to get VCC regulator!\n"); err = regulator_enable(chip->vcc_reg); if (err) { From patchwork Wed Aug 26 14:51:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 257332 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAA5DC433E1 for ; Wed, 26 Aug 2020 14:53:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 99C3121741 for ; Wed, 26 Aug 2020 14:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453618; bh=v/Zb3PmGpo5l2DvxNKoEoZ/zVbV6OtENUtPofNroKvs=; h=From:To:Subject:Date:In-Reply-To:References:List-ID:From; b=iDmbApuMJZOzxfwMAbSsDran24RtFhlgNcQj76FhbCMTVVFTc5+gLLuFuo41DDrdJ osu6VeUV45aanxoZpLf8705EcPfbUlY62Pa+C9oohn8UWs9hjL+7jWs4xVO11ml2O1 m8yh2H+QyZI3OtCLyPXrAraSpIZ9A2YfUvGS/28o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbgHZOxh (ORCPT ); Wed, 26 Aug 2020 10:53:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:41056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727840AbgHZOxg (ORCPT ); Wed, 26 Aug 2020 10:53:36 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06B9A2177B; Wed, 26 Aug 2020 14:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453615; bh=v/Zb3PmGpo5l2DvxNKoEoZ/zVbV6OtENUtPofNroKvs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G1yTKeODAnBmqu0tCCEEeOyfX9WSgWuaRVB3SQP1H4qDRVlOSt+hpoRkjYlGCBeok gmAK8tht/DTIU8dviczhNyYxIUUm3LiA3INTKD5WTXuyCsmJyzN0tD+pJ8COzkkiWo 7i/+1mvilt2zqVD/ofW0B8ni0jFzO+qcRjHUi2ro= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 16/16] iio: magnetometer: ak8974: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:53 +0200 Message-Id: <20200826145153.10444-16-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-1-krzk@kernel.org> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/magnetometer/ak8974.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index cbb44e401c0a..fa6a8e1a815c 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -843,15 +843,9 @@ static int ak8974_probe(struct i2c_client *i2c, ret = devm_regulator_bulk_get(&i2c->dev, ARRAY_SIZE(ak8974->regs), ak8974->regs); - if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(&i2c->dev, "cannot get regulators: %d\n", ret); - else - dev_dbg(&i2c->dev, - "regulators unavailable, deferring probe\n"); - - return ret; - } + if (ret < 0) + return dev_err_probe(&i2c->dev, ret, + "cannot get regulators\n"); ret = regulator_bulk_enable(ARRAY_SIZE(ak8974->regs), ak8974->regs); if (ret < 0) {