Re: [PATCH 1/2] power_supply: Add charge control struct in powersupply class

From: Anton Vorontsov
Date: Mon Jan 07 2013 - 01:22:14 EST


On Mon, Jan 07, 2013 at 05:43:58AM +0000, Pallala, Ramakrishna wrote:
> > > > > +struct power_supply_charger_control {
> > > > > + const char *name;
> > > > > + /* get charging status */
> > > > > + int (*is_charging_enabled)(void);
> > > > > + int (*is_charger_enabled)(void);
[...]
> > The similar functionalities are exposed by patch
> > https://lkml.org/lkml/2012/10/18/219.
> > As per Anton's review comments on this patch, I'll be moving the macros to
> > power_supply.h.
> > Wouldn't that be enough ?
>
> Though the macros seem to be fine but I would still think that call back way of interfaces would be
> More flexible and straightforward.

We have properties mechanism deployed already, so I'd rather keep it
consistent.

p.s. We had 'properties vs. callbacks' debates before, there are pros and
cons of each approach. Unless there are some unresolvable issues, let's
stick with the original approach. :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/