[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9df2dd4c-9283-4f3c-859e-586e1b397a96@linaro.org>
Date: Mon, 17 Nov 2025 10:11:00 +0100
From: neil.armstrong@...aro.org
To: Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
linux-amlogic@...ts.infradead.org, linux-mmc@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
ulf.hansson@...aro.org
Subject: Re: [PATCH v1 5/7] mmc: meson-mx-sdio: Use dev_err_probe() where
appropriate
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@...glemail.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@...aro.org>
Powered by blists - more mailing lists