Messages in this thread | | | Date | Sat, 17 Nov 2012 20:35:33 -0800 | From | Anton Vorontsov <> | Subject | Re: [PATCH 2/2] power_supply: Register power supply for thermal cooling device |
| |
On Tue, Oct 09, 2012 at 10:25:59PM +0530, Ramakrishna Pallala wrote: > This patch registers the power supply as a cooling device if the > power supply has support for charge throttling. > > Now with this change low level drivers need not register with > thermal framework as it is automatically done by power supply framework. > > Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com> > --- > drivers/power/power_supply_core.c | 100 +++++++++++++++++++++++++++++++++++++ > include/linux/power_supply.h | 1 + > 2 files changed, 101 insertions(+), 0 deletions(-) > > diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c > index 08cc8a3..3338d49 100644 > --- a/drivers/power/power_supply_core.c > +++ b/drivers/power/power_supply_core.c [...] > +static int ps_get_max_charge_cntl_limit(struct thermal_cooling_device *tcd, > + unsigned long *state) > +{ > + struct power_supply *psy; > + union power_supply_propval val; > + int ret; > + > + WARN_ON(tcd == NULL); > + psy = tcd->devdata; > + ret = psy->get_property(psy, > + POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX, &val); > + if (!ret) > + *state = val.intval; > + > + return ret; > +} > + > +static int ps_get_cur_chrage_cntl_limit(struct thermal_cooling_device *tcd,
Typo, "charge".
> + unsigned long *state) > +{ > + struct power_supply *psy; > + union power_supply_propval val; > + int ret; > + > + WARN_ON(tcd == NULL);
This is unneeded, we'll get oops anyway.
I fixed it up and applied, thank you!
Anton.
| |