Linux-mmc Archive on lore.kernel.org
 help / color / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Jun Nie <jun.nie@linaro.org>, Shawn Guo <shawnguo@kernel.org>,
	Paul Cercueil <paul@crapouillou.net>,
	Kevin Hilman <khilman@baylibre.com>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Al Cooper <alcooperx@gmail.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Lars Povlsen <lars.povlsen@microchip.com>,
	Steen Hegelund <Steen.Hegelund@microchip.com>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-tegra@vger.kernel.org
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Subject: [PATCH 05/11] mmc: meson: Simplify with dev_err_probe()
Date: Wed,  2 Sep 2020 21:36:52 +0200
Message-ID: <20200902193658.20539-6-krzk@kernel.org> (raw)
In-Reply-To: <20200902193658.20539-1-krzk@kernel.org>

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and the error value gets printed.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mmc/host/meson-gx-mmc.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 08a3b1c05acb..2802e4520783 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -426,11 +426,9 @@ static int meson_mmc_clk_init(struct meson_host *host)
 
 		snprintf(name, sizeof(name), "clkin%d", i);
 		clk = devm_clk_get(host->dev, name);
-		if (IS_ERR(clk)) {
-			if (clk != ERR_PTR(-EPROBE_DEFER))
-				dev_err(host->dev, "Missing clock %s\n", name);
-			return PTR_ERR(clk);
-		}
+		if (IS_ERR(clk))
+			return dev_err_probe(host->dev, PTR_ERR(clk),
+					     "Missing clock %s\n", name);
 
 		mux_parent_names[i] = __clk_get_name(clk);
 	}
@@ -1077,12 +1075,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
 	}
 
 	ret = device_reset_optional(&pdev->dev);
-	if (ret) {
-		if (ret != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "device reset failed: %d\n", ret);
-
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "device reset failed\n");
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	host->regs = devm_ioremap_resource(&pdev->dev, res);
-- 
2.17.1


  parent reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 19:36 [PATCH 00/11] mmc: Minor cleanups and compile test Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 01/11] mmc: bcm2835: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 19:56   ` Florian Fainelli
2020-09-02 19:36 ` [PATCH 02/11] mmc: davinci: " Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 03/11] mmc: dw_mmc-zx: " Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 04/11] mmc: jz4740: " Krzysztof Kozlowski
2020-09-03 10:49   ` Paul Cercueil
2020-09-03 11:47     ` Ulf Hansson
2020-09-02 19:36 ` Krzysztof Kozlowski [this message]
2020-09-02 19:36 ` [RFT 06/11] mmc: sdhci-brcmstb: Simplify with optional clock and dev_err_probe() Krzysztof Kozlowski
2020-09-02 19:58   ` Florian Fainelli
2020-09-03  8:09     ` Ulf Hansson
2020-09-02 19:36 ` [PATCH 07/11] mmc: sdhci-of-arasan: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 08/11] mmc: sdhci-tegra: " Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 09/11] mmc: dw_mmc: " Krzysztof Kozlowski
2020-09-02 19:36 ` [PATCH 10/11] mmc: sdhci-of-sparx5: Use proper printk format for dma_addr_t Krzysztof Kozlowski
2020-09-04  8:08   ` Lars Povlsen
2020-09-02 19:36 ` [PATCH 11/11] mmc: host: Enable compile testing of multiple drivers Krzysztof Kozlowski
2020-09-02 21:32   ` Michał Mirosław
2020-09-03  5:39     ` Krzysztof Kozlowski
2020-09-03  8:09 ` [PATCH 00/11] mmc: Minor cleanups and compile test Ulf Hansson
2020-09-03  8:28   ` Krzysztof Kozlowski
2020-09-10 22:55   ` Rob Herring
2020-09-11  6:00     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200902193658.20539-6-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=adrian.hunter@intel.com \
    --cc=alcooperx@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonathanh@nvidia.com \
    --cc=jun.nie@linaro.org \
    --cc=khilman@baylibre.com \
    --cc=lars.povlsen@microchip.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=michal.simek@xilinx.com \
    --cc=narmstrong@baylibre.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=paul@crapouillou.net \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=shawnguo@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-mmc Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mmc/0 linux-mmc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mmc linux-mmc/ https://lore.kernel.org/linux-mmc \
		linux-mmc@vger.kernel.org
	public-inbox-index linux-mmc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mmc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git