From: Adrian Hunter <adrian.hunter@intel.com>
To: Artem Shimko <a.shimko.dev@gmail.com>,
<andriy.shevchenko@intel.com>, <ulfh@kernel.org>,
<p.zabel@pengutronix.de>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] mmc: sdhci-of-dwcmshc: remove redundant IS_ERR() check
Date: Wed, 20 May 2026 09:18:28 +0300 [thread overview]
Message-ID: <ce639149-0089-45dc-9c6e-5e6ab4afbf9f@intel.com> (raw)
In-Reply-To: <20260518110034.142587-3-a.shimko.dev@gmail.com>
On 18/05/2026 14:00, Artem Shimko wrote:
> The clk_disable_unprepare() function has internal protection against
> ERR_PTR and NULL pointers (IS_ERR_OR_NULL). Remove the redundant
> IS_ERR() check for bus_clk in dwcmshc_suspend() and in the error
> path of dwcmshc_resume() to simplify the code.
>
> Note that the clk_prepare_enable() call in dwcmshc_resume() must retain
> its IS_ERR() check because clk_prepare() only handles NULL pointers,
> not ERR_PTR.
>
> No functional change intended.
>
> Signed-off-by: Artem Shimko <a.shimko.dev@gmail.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci-of-dwcmshc.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-of-dwcmshc.c
> index 8c3ca47c8060..29bb46783ee5 100644
> --- a/drivers/mmc/host/sdhci-of-dwcmshc.c
> +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c
> @@ -2564,8 +2564,7 @@ static int dwcmshc_suspend(struct device *dev)
> return ret;
>
> clk_disable_unprepare(pltfm_host->clk);
> - if (!IS_ERR(priv->bus_clk))
> - clk_disable_unprepare(priv->bus_clk);
> + clk_disable_unprepare(priv->bus_clk);
>
> clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks);
>
> @@ -2608,8 +2607,7 @@ static int dwcmshc_resume(struct device *dev)
> disable_other_clks:
> clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks);
> disable_bus_clk:
> - if (!IS_ERR(priv->bus_clk))
> - clk_disable_unprepare(priv->bus_clk);
> + clk_disable_unprepare(priv->bus_clk);
> disable_clk:
> clk_disable_unprepare(pltfm_host->clk);
> return ret;
next prev parent reply other threads:[~2026-05-20 6:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 11:00 [PATCH 0/3] mmc: sdhci-of-dwcmshc: Minor cleanups Artem Shimko
2026-05-18 11:00 ` [PATCH 1/3] mmc: sdhci-of-dwcmshc: improve delay handling with fsleep() Artem Shimko
2026-05-18 14:16 ` Andy Shevchenko
2026-05-18 14:50 ` Artem Shimko
2026-05-18 18:35 ` Andy Shevchenko
2026-05-19 15:43 ` Artem Shimko
2026-05-18 11:00 ` [PATCH 2/3] mmc: sdhci-of-dwcmshc: remove redundant IS_ERR() check Artem Shimko
2026-05-20 6:18 ` Adrian Hunter [this message]
2026-05-18 11:00 ` [PATCH 3/3] mmc: sdhci-of-dwcmshc: use dev_err_probe() to simplify error paths Artem Shimko
2026-05-20 6:18 ` Adrian Hunter
2026-05-20 7:14 ` Artem Shimko
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=ce639149-0089-45dc-9c6e-5e6ab4afbf9f@intel.com \
--to=adrian.hunter@intel.com \
--cc=a.shimko.dev@gmail.com \
--cc=andriy.shevchenko@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=ulfh@kernel.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
all inboxes | Powered by JetHome®