[PATCH v2 1/2] mtd: maps: physmap: Add VPP regulator control

Pawel Moll pawel.moll at arm.com
Mon Jul 23 14:24:21 EDT 2012


On Mon, 2012-07-23 at 18:46 +0100, Mark Brown wrote:
> > +	info->vpp_regulator = devm_regulator_get(&dev->dev, "vpp");
> > +	if (IS_ERR(info->vpp_regulator))
> > +		info->vpp_regulator = NULL;
> > +
> 
> No, this is very bad karma.  You shouldn't just silently ignore the
> error here, if we didn't get the supply it's probably important and
> otherwise why bother checking the error at all?  

The reason is simple - to make the regulator completely optional. That's
also why I check the existence of "vpp-supply" property in the OF
version.

> Systems should use
> a fixed voltage regulator to stub out the supply if there's not any
> runtime contol.

I know this discussion and I appreciate your point of view. The fact
that I disagree doesn't matter here. Simply speaking - I'd rather drop
this patch completely than break current (as in: no regulator necessary)
behaviour of the physmap driver. I'm not ready to take all the flak from
dozens of hmm...unhappy users :-)

> At a bare minimum you should be passing back -EPROBE_DEFER if you get
> that.

Which is, if I'm not mistaken, exactly what is returned when no supply
is defined by the board. Which gets us to the starting point. As I said
- if this is deemed unacceptable, I'll simply forget about this patch.

Regards

Paweł






More information about the linux-mtd mailing list