linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code
@ 2025-08-12  9:29 Xichao Zhao
  2025-08-14 19:10 ` Martin Blumenstingl
  2025-08-18 10:55 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Xichao Zhao @ 2025-08-12  9:29 UTC (permalink / raw)
  To: ulf.hansson, neil.armstrong, khilman
  Cc: jbrunet, martin.blumenstingl, linux-mmc, linux-amlogic,
	linux-kernel, Xichao Zhao

Use the standard error pointer macro to shorten the code and simplify.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
---
 drivers/mmc/host/meson-mx-sdhc-clkc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mmc/host/meson-mx-sdhc-clkc.c b/drivers/mmc/host/meson-mx-sdhc-clkc.c
index cbd17a596cd2..6d619bd0a8dc 100644
--- a/drivers/mmc/host/meson-mx-sdhc-clkc.c
+++ b/drivers/mmc/host/meson-mx-sdhc-clkc.c
@@ -84,10 +84,8 @@ static int meson_mx_sdhc_gate_clk_hw_register(struct device *dev,
 		return ret;
 
 	clk_bulk_data[bulk_index].clk = devm_clk_hw_get_clk(dev, hw, name_suffix);
-	if (IS_ERR(clk_bulk_data[bulk_index].clk))
-		return PTR_ERR(clk_bulk_data[bulk_index].clk);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(clk_bulk_data[bulk_index].clk);
 }
 
 int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code
  2025-08-12  9:29 [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
@ 2025-08-14 19:10 ` Martin Blumenstingl
  2025-08-18 10:55 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2025-08-14 19:10 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: ulf.hansson, neil.armstrong, khilman, jbrunet, linux-mmc,
	linux-amlogic, linux-kernel

On Tue, Aug 12, 2025 at 11:29 AM Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> Use the standard error pointer macro to shorten the code and simplify.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code
  2025-08-12  9:29 [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
  2025-08-14 19:10 ` Martin Blumenstingl
@ 2025-08-18 10:55 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2025-08-18 10:55 UTC (permalink / raw)
  To: Xichao Zhao
  Cc: neil.armstrong, khilman, jbrunet, martin.blumenstingl, linux-mmc,
	linux-amlogic, linux-kernel

On Tue, 12 Aug 2025 at 11:29, Xichao Zhao <zhao.xichao@vivo.com> wrote:
>
> Use the standard error pointer macro to shorten the code and simplify.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/meson-mx-sdhc-clkc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-mx-sdhc-clkc.c b/drivers/mmc/host/meson-mx-sdhc-clkc.c
> index cbd17a596cd2..6d619bd0a8dc 100644
> --- a/drivers/mmc/host/meson-mx-sdhc-clkc.c
> +++ b/drivers/mmc/host/meson-mx-sdhc-clkc.c
> @@ -84,10 +84,8 @@ static int meson_mx_sdhc_gate_clk_hw_register(struct device *dev,
>                 return ret;
>
>         clk_bulk_data[bulk_index].clk = devm_clk_hw_get_clk(dev, hw, name_suffix);
> -       if (IS_ERR(clk_bulk_data[bulk_index].clk))
> -               return PTR_ERR(clk_bulk_data[bulk_index].clk);
>
> -       return 0;
> +       return PTR_ERR_OR_ZERO(clk_bulk_data[bulk_index].clk);
>  }
>
>  int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base,
> --
> 2.34.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-18 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-12  9:29 [PATCH] mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code Xichao Zhao
2025-08-14 19:10 ` Martin Blumenstingl
2025-08-18 10:55 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).