diff options
| author | Dan Carpenter <dan.carpenter@linaro.org> | 2025-11-01 16:27:07 +0300 |
|---|---|---|
| committer | Philipp Zabel <p.zabel@pengutronix.de> | 2025-11-18 17:52:54 +0100 |
| commit | cea5d43b63b221522f8532a7894149f3d8d11f4b (patch) | |
| tree | 36052492bb1e264dcb1c432af81145f8da4d44ac /drivers/reset | |
| parent | da91533c2b7a569b272b8271f0b2c407f86407ed (diff) | |
reset: rzg2l-usbphy-ctrl: Fix a NULL vs IS_ERR() bug in probe
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>
Diffstat (limited to 'drivers/reset')
| -rw-r--r-- | drivers/reset/reset-rzg2l-usbphy-ctrl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c index eea56687cd0a..4ecb9acb2641 100644 --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c @@ -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); |
