Commit 2289ccd7 authored by Claudiu Beznea's avatar Claudiu Beznea Committed by Philipp Zabel
Browse files

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: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent ae089de7
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -117,13 +117,13 @@ static const struct regmap_config rzg2l_usb_regconf = {
	.max_register = 1,
};

static void rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap_field *pwrrdy,
static int rzg2l_usbphy_ctrl_set_pwrrdy(struct regmap_field *pwrrdy,
					bool power_on)
{
	u32 val = power_on ? 0 : 1;

	/* The initialization path guarantees that the mask is 1 bit long. */
	regmap_field_update_bits(pwrrdy, 1, val);
	return regmap_field_update_bits(pwrrdy, 1, val);
}

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

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

	rzg2l_usbphy_ctrl_set_pwrrdy(pwrrdy, true);
	ret = rzg2l_usbphy_ctrl_set_pwrrdy(priv->pwrrdy, true);
	if (ret)
		return ret;

	return devm_add_action_or_reset(dev, rzg2l_usbphy_ctrl_pwrrdy_off, pwrrdy);
}