Re: [PATCH 2/2] power_supply: Register power supply for thermalcooling device

From: Anton Vorontsov
Date: Sat Nov 17 2012 - 23:49:55 EST


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@xxxxxxxxx>
> ---
> 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.
--
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/