lkml.org 
[lkml]   [2012]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.


\
 
 \ /
  Last update: 2012-11-18 05:41    [W:0.136 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site