]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
reset: rzg2l-usbphy-ctrl: Fix a NULL vs IS_ERR() bug in probe
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 1 Nov 2025 13:27:07 +0000 (16:27 +0300)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 18 Nov 2025 16:52:54 +0000 (17:52 +0100)
The devm_regmap_field_alloc() function never returns NULL, it returns
error pointers.  Update the error checking to match.

Fixes: 58128aa88867 ("reset: rzg2l-usbphy-ctrl: Add support for USB PWRRDY")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/reset/reset-rzg2l-usbphy-ctrl.c

index eea56687cd0a3d62168d2b0cad8c18b359160002..4ecb9acb264183465abc12412b0f1c5715dd8a9e 100644 (file)
@@ -158,8 +158,8 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev)
        field.msb = __fls(args[1]);
 
        pwrrdy = devm_regmap_field_alloc(dev, regmap, field);
-       if (!pwrrdy)
-               return -ENOMEM;
+       if (IS_ERR(pwrrdy))
+               return PTR_ERR(pwrrdy);
 
        rzg2l_usbphy_ctrl_set_pwrrdy(pwrrdy, true);