}
reg = dev_opp->regulator;
- if (IS_ERR_OR_NULL(reg)) {
+ if (IS_ERR(reg)) {
/* Regulator may not be required for device */
if (reg)
dev_err(dev, "%s: Invalid regulator (%ld)\n", __func__,
of_node_put(np);
}
+ /* Set regulator to a non-NULL error value */
+ dev_opp->regulator = ERR_PTR(-ENXIO);
+
/* Find clk for the device */
dev_opp->clk = clk_get(dev, NULL);
if (IS_ERR(dev_opp->clk)) {
if (dev_opp->prop_name)
return;
- if (!IS_ERR_OR_NULL(dev_opp->regulator))
+ if (!IS_ERR(dev_opp->regulator))
return;
/* Release clk */
{
struct regulator *reg = dev_opp->regulator;
- if (!IS_ERR_OR_NULL(reg) &&
+ if (!IS_ERR(reg) &&
!regulator_is_supported_voltage(reg, opp->u_volt_min,
opp->u_volt_max)) {
pr_warn("%s: OPP minuV: %lu maxuV: %lu, not supported by regulator\n",
}
/* Already have a regulator set */
- if (WARN_ON(!IS_ERR_OR_NULL(dev_opp->regulator))) {
+ if (WARN_ON(!IS_ERR(dev_opp->regulator))) {
ret = -EBUSY;
goto err;
}
goto unlock;
}
- if (IS_ERR_OR_NULL(dev_opp->regulator)) {
+ if (IS_ERR(dev_opp->regulator)) {
dev_err(dev, "%s: Doesn't have regulator set\n", __func__);
goto unlock;
}
WARN_ON(!list_empty(&dev_opp->opp_list));
regulator_put(dev_opp->regulator);
- dev_opp->regulator = ERR_PTR(-EINVAL);
+ dev_opp->regulator = ERR_PTR(-ENXIO);
/* Try freeing device_opp if this was the last blocking resource */
_remove_device_opp(dev_opp);