]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: meson-mx-sdhc: use PTR_ERR_OR_ZERO() to simplify code
authorXichao Zhao <zhao.xichao@vivo.com>
Tue, 12 Aug 2025 09:29:08 +0000 (17:29 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 19 Aug 2025 12:34:15 +0000 (14:34 +0200)
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>
Link: https://lore.kernel.org/r/20250812092908.101867-1-zhao.xichao@vivo.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/meson-mx-sdhc-clkc.c

index cbd17a596cd25ca038e66ba13e4c55556c7cb4ec..6d619bd0a8dc899ac30bca23073e91f3965d96d1 100644 (file)
@@ -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,