Skip to content

Commit 2289ccd

Browse files
claudiubezneapH5
authored andcommitted
reset: rzg2l-usbphy-ctrl: Propagate the return value of regmap_field_update_bits()
Propagate the return value of regmap_field_update_bits() to avoid losing any possible error. With this, the return type of rzg2l_usbphy_ctrl_set_pwrrdy() was updated accordingly. Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
1 parent ae089de commit 2289ccd

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/reset/reset-rzg2l-usbphy-ctrl.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ static const struct regmap_config rzg2l_usb_regconf = {
117117
.max_register = 1,
118118
};
119119

120-
static void rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap_field *pwrrdy,
121-
bool power_on)
120+
static int rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap_field *pwrrdy,
121+
bool power_on)
122122
{
123123
u32 val = power_on ? 0 : 1;
124124

125125
/* The initialization path guarantees that the mask is 1 bit long. */
126-
regmap_field_update_bits(pwrrdy, 1, val);
126+
return regmap_field_update_bits(pwrrdy, 1, val);
127127
}
128128

129129
static void rzg2l_usbphy_ctrl_pwrrdy_off(void *data)
@@ -138,6 +138,7 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev)
138138
struct regmap *regmap;
139139
const int *data;
140140
u32 args[2];
141+
int ret;
141142

142143
data = device_get_match_data(dev);
143144
if ((uintptr_t)data != RZG2L_USBPHY_CTRL_PWRRDY)
@@ -161,7 +162,9 @@ static int rzg2l_usbphy_ctrl_pwrrdy_init(struct device *dev)
161162
if (IS_ERR(pwrrdy))
162163
return PTR_ERR(pwrrdy);
163164

164-
rzg2l_usbphy_ctrl_set_pwrrdy(pwrrdy, true);
165+
ret = rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, true);
166+
if (ret)
167+
return ret;
165168

166169
return devm_add_action_or_reset(dev, rzg2l_usbphy_ctrl_pwrrdy_off, pwrrdy);
167170
}

0 commit comments

Comments
 (0)