public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/8] mfd: ab8500: Use power_supply_*() API for accessing function attrs
Date: Wed, 15 Oct 2014 11:07:12 +0200	[thread overview]
Message-ID: <20141015090712.GB9900@lee--X1> (raw)
In-Reply-To: <1413289246-31650-6-git-send-email-k.kozlowski@samsung.com>

On Tue, 14 Oct 2014, Krzysztof Kozlowski wrote:

> Replace direct calls to power supply function attributes with wrappers.
> Wrappers provide safe access access in case of unregistering the power
> supply (.e.g by removing the driver). Replace:
>  - get_property -> power_supply_get_property
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> ---
>  drivers/mfd/ab8500-sysctrl.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
> index 8e0dae59844d..93b2d2c32ca3 100644
> --- a/drivers/mfd/ab8500-sysctrl.c
> +++ b/drivers/mfd/ab8500-sysctrl.c
> @@ -49,7 +49,8 @@ static void ab8500_power_off(void)
>  		if (!psy)
>  			continue;
>  
> -		ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val);
> +		ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE,
> +				&val);
>  
>  		if (!ret && val.intval) {
>  			charger_present = true;
> @@ -63,8 +64,8 @@ static void ab8500_power_off(void)
>  	/* Check if battery is known */
>  	psy = power_supply_get_by_name("ab8500_btemp");
>  	if (psy) {
> -		ret = psy->get_property(psy, POWER_SUPPLY_PROP_TECHNOLOGY,
> -					&val);
> +		ret = power_supply_get_property(psy,
> +				POWER_SUPPLY_PROP_TECHNOLOGY, &val);
>  		if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) {
>  			printk(KERN_INFO
>  			       "Charger \"%s\" is connected with known battery."

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2014-10-15  9:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 12:20 [PATCH 0/8] power_supply: Add API for safe access of get_property-like function attrs Krzysztof Kozlowski
2014-10-14 12:20 ` [PATCH 1/8] power_supply: Add API for safe access of power supply " Krzysztof Kozlowski
2014-10-15 10:30   ` Pavel Machek
2014-10-14 12:20 ` [PATCH 2/8] power_supply: sysfs: Use power_supply_*() API for accessing " Krzysztof Kozlowski
2014-10-15 10:32   ` Pavel Machek
2014-10-15 10:49     ` Krzysztof Kozlowski
2014-10-15 12:19       ` Pavel Machek
2014-10-14 12:20 ` [PATCH 3/8] power: 88pm860x_charger: " Krzysztof Kozlowski
2014-10-15 10:33   ` Pavel Machek
2014-10-14 12:20 ` [PATCH 4/8] power: ab8500: " Krzysztof Kozlowski
2014-10-28  9:58   ` Linus Walleij
2014-10-14 12:20 ` [PATCH 5/8] mfd: " Krzysztof Kozlowski
2014-10-15  9:07   ` Lee Jones [this message]
2014-10-14 12:20 ` [PATCH 6/8] power: apm_power: " Krzysztof Kozlowski
2014-10-14 12:20 ` [PATCH 7/8] power: bq2415x_charger: " Krzysztof Kozlowski
2014-10-14 12:20 ` [PATCH 8/8] power: charger-manager: " Krzysztof Kozlowski
2014-10-15  2:22 ` [PATCH 0/8] power_supply: Add API for safe access of get_property-like " jonghwa3.lee at samsung.com
2014-10-15 10:35 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141015090712.GB9900@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox