Re: [PATCH] power_supply: Add driver for TWL4030/TPS65950 BCIcharger

From: Anton Vorontsov
Date: Wed Dec 02 2009 - 16:27:20 EST


On Wed, Dec 02, 2009 at 10:38:31PM +0200, Grazvydas Ignotas wrote:
> On Mon, Nov 30, 2009 at 8:58 PM, Anton Vorontsov
> <avorontsov@xxxxxxxxxxxxx> wrote:
> > On Mon, Nov 30, 2009 at 12:45:20PM -0600, Madhusudhan wrote:
> > [...]
> >> > + Â case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> >> > + Â Â Â Â Â /* charging must be active for meaningful result */
> >> > + Â Â Â Â Â if (!is_charging) {
> >>
> >> How about putting a kern_info here?
> >
> > It might be better to return -EINVAL.
>
> That causes lots of warnings from power_supply core (driver failed to
> report XXX property), Not sure what to do here, I'd prefer to keep
> returning 0.

Lying to userspace is a bad idea.

How about this patch + changing the driver to return -ENODATA?