Re: [PATCHv2 2/2] power_supply: Add support for tps65217-charger.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

On Thu, Sep 24, 2015 at 09:23:25AM +0200, Enric Balletbo i Serra wrote:
> This patch adds support for the tps65217 charger driver. This driver is
> responsible for controlling the charger aspect of the tps65217 mfd.
> Currently, this mainly consists of turning on and off the charger, but
> some other features of the charger can be supported through this driver.
>
> [...]
>
> +static int tps65217_ac_get_property(struct power_supply *psy,
> +			enum power_supply_property psp,
> +			union power_supply_propval *val)
> +{
> +	struct tps65217_charger *charger = power_supply_get_drvdata(psy);
> +
> +	if (psp == POWER_SUPPLY_PROP_ONLINE) {
> +		val->intval = charger->ac_online;
> +		charger->prev_ac_online = charger->ac_online;

I think this is no longer needed at this place.

> +		return 0;
> +	}
> +	return -EINVAL;
> +}
> 
> [...]
>
> +static int tps65217_charger_remove(struct platform_device *pdev)
> +{
> +	struct tps65217_charger *charger = platform_get_drvdata(pdev);
> +
> +	kthread_stop(charger->poll_task);
> +
> +	power_supply_unregister(charger->ac);

This is not needed with devm_power_supply_register() and actually
it's wrong, since it would be called again by managed resources
infrastructure.

> +	return 0;
> +}

-- Sebastian

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux