RE: [PATCH 1/3] power: core: Add generic interface to get battery specification.

From: Tc, Jenny
Date: Sun Nov 09 2014 - 22:42:02 EST


>
> >> +ATOMIC_NOTIFIER_HEAD(psy_battery_info_notifier);
> >
> > Isn't it good to reuse the existing power_supply_notifier for this?
> >
> >> +enum battery_info_notifier_events {
> >> + PSY_BATT_INFO_REGISTERED,
> >> + PSY_BATT_INFO_UNREGISTERED,
> >> +};
> >
> > If we use the power_supply_notifier, then this can be moved to
> > enum power_supply_notifier_events
> >
>
>
> It doesn't use power_supply_notifier, rather than it uses newly introduced
> notifier for battery information. Intention of making of new notifier block here
> is to extinguish event from power_supply_changed which might be noisy for
> battery information consumer. However, If it looks wasteful code, it's not a big
> deal to use existed power_supply_notifier.

Using the power_supply_notifier helps to get all power supply notifications
(power_supply_chnaged, battery info register/unregister, ..) using a single notifier. The
consumers can ignore the unwanted events.