From: neil.armstrong@linaro.org
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, ulf.hansson@linaro.org
Subject: Re: [PATCH v1 5/7] mmc: meson-mx-sdio: Use dev_err_probe() where appropriate
Date: Mon, 17 Nov 2025 10:11:00 +0100 [thread overview]
Message-ID: <9df2dd4c-9283-4f3c-859e-586e1b397a96@linaro.org> (raw)
In-Reply-To: <20251108231253.1641927-6-martin.blumenstingl@googlemail.com>
On 11/9/25 00:12, Martin Blumenstingl wrote:
> This streamlines probe error handling / logging with other drivers.
>
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
> drivers/mmc/host/meson-mx-sdio.c | 30 +++++++++++++++++-------------
> 1 file changed, 17 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c
> index 214ce84f1ddd..052bcf8f32df 100644
> --- a/drivers/mmc/host/meson-mx-sdio.c
> +++ b/drivers/mmc/host/meson-mx-sdio.c
> @@ -520,16 +520,14 @@ static int meson_mx_mmc_add_host(struct meson_mx_mmc_host *host)
> struct device *slot_dev = mmc_dev(mmc);
> int ret;
>
> - if (of_property_read_u32(slot_dev->of_node, "reg", &host->slot_id)) {
> - dev_err(slot_dev, "missing 'reg' property\n");
> - return -EINVAL;
> - }
> + if (of_property_read_u32(slot_dev->of_node, "reg", &host->slot_id))
> + return dev_err_probe(slot_dev, -EINVAL,
> + "missing 'reg' property\n");
>
> - if (host->slot_id >= MESON_MX_SDIO_MAX_SLOTS) {
> - dev_err(slot_dev, "invalid 'reg' property value %d\n",
> - host->slot_id);
> - return -EINVAL;
> - }
> + if (host->slot_id >= MESON_MX_SDIO_MAX_SLOTS)
> + return dev_err_probe(slot_dev, -EINVAL,
> + "invalid 'reg' property value %d\n",
> + host->slot_id);
>
> /* Get regulators and the supported OCR mask */
> ret = mmc_regulator_get_supply(mmc);
> @@ -666,7 +664,8 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)
> host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
> &meson_mx_sdio_regmap_config);
> if (IS_ERR(host->regmap)) {
> - ret = PTR_ERR(host->regmap);
> + ret = dev_err_probe(host->controller_dev, PTR_ERR(host->regmap),
> + "Failed to initialize regmap\n");
> goto error_unregister_slot_pdev;
> }
>
> @@ -680,12 +679,16 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)
> meson_mx_mmc_irq,
> meson_mx_mmc_irq_thread, IRQF_ONESHOT,
> NULL, host);
> - if (ret)
> + if (ret) {
> + dev_err_probe(host->controller_dev, ret,
> + "Failed to request IRQ\n");
> goto error_unregister_slot_pdev;
> + }
>
> core_clk = devm_clk_get_enabled(host->controller_dev, "core");
> if (IS_ERR(core_clk)) {
> - ret = PTR_ERR(core_clk);
> + ret = dev_err_probe(host->controller_dev, PTR_ERR(core_clk),
> + "Failed to get and enable 'core' clock\n");
> goto error_unregister_slot_pdev;
> }
>
> @@ -697,7 +700,8 @@ static int meson_mx_mmc_probe(struct platform_device *pdev)
>
> ret = clk_prepare_enable(host->cfg_div_clk);
> if (ret) {
> - dev_err(host->controller_dev, "Failed to enable MMC clock\n");
> + dev_err_probe(host->controller_dev, ret,
> + "Failed to enable MMC (cfg div) clock\n");
> goto error_unregister_slot_pdev;
> }
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2025-11-17 9:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 23:12 [PATCH v1 0/7] mmc: meson-mx-sdio: Various driver improvements Martin Blumenstingl
2025-11-08 23:12 ` [PATCH v1 1/7] mmc: meson-mx-sdio: Switch to regmap for register access Martin Blumenstingl
2025-11-17 9:08 ` neil.armstrong
2025-11-08 23:12 ` [PATCH v1 2/7] mmc: meson-mx-sdio: Use devm_clk_get_enabled() Martin Blumenstingl
2025-11-17 9:09 ` neil.armstrong
2025-11-08 23:12 ` [PATCH v1 3/7] mmc: meson-mx-sdio: Refactor internal clock initialization Martin Blumenstingl
2025-11-17 9:10 ` neil.armstrong
2025-11-08 23:12 ` [PATCH v1 4/7] mmc: meson-mx-sdio: Use devm_mmc_alloc_host() helper Martin Blumenstingl
2025-11-17 9:10 ` neil.armstrong
2025-11-08 23:12 ` [PATCH v1 5/7] mmc: meson-mx-sdio: Use dev_err_probe() where appropriate Martin Blumenstingl
2025-11-17 9:11 ` neil.armstrong [this message]
2025-11-08 23:12 ` [PATCH v1 6/7] mmc: meson-mx-sdio: Fix indentation in meson_mx_mmc_irq_thread() Martin Blumenstingl
2025-11-17 9:11 ` neil.armstrong
2025-11-08 23:12 ` [PATCH v1 7/7] mmc: meson-mx-sdio: Ignore disabled "mmc-slot" child-nodes Martin Blumenstingl
2025-11-18 15:31 ` [PATCH v1 0/7] mmc: meson-mx-sdio: Various driver improvements Ulf Hansson
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=9df2dd4c-9283-4f3c-859e-586e1b397a96@linaro.org \
--to=neil.armstrong@linaro.org \
--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=martin.blumenstingl@googlemail.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox