mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: "cbou@mail.ru" <cbou@mail.ru>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] lp8788-charger: use consumer device name on setting IIO channels
Date: Fri, 19 Oct 2012 16:37:26 +0100	[thread overview]
Message-ID: <508173B6.20806@kernel.org> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998F64178F97@DQHE02.ent.ti.com>

On 10/18/2012 07:11 AM, Kim, Milo wrote:
>  To get the ADC value for the battery voltage and temperature,
>  LP8788 ADC driver is used.
>  LP8788 charger driver is the consumer of LP8788 ADC driver.
>  Thus, specific ADC driver name is required on getting the channel
>  using iio_channel_get().
> 
> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>

> ---
>  drivers/power/lp8788-charger.c |    9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/power/lp8788-charger.c b/drivers/power/lp8788-charger.c
> index e852d12..614e6aa 100644
> --- a/drivers/power/lp8788-charger.c
> +++ b/drivers/power/lp8788-charger.c
> @@ -592,7 +592,8 @@ static void lp8788_irq_unregister(struct platform_device *pdev,
>  	}
>  }
>  
> -static void lp8788_setup_adc_channel(struct lp8788_charger *pchg)
> +static void lp8788_setup_adc_channel(const char *consumer_name,
> +				struct lp8788_charger *pchg)
>  {
>  	struct lp8788_charger_platform_data *pdata = pchg->pdata;
>  	struct device *dev = pchg->lp->dev;
> @@ -616,7 +617,7 @@ static void lp8788_setup_adc_channel(struct lp8788_charger *pchg)
>  	case LPADC_VBATT_5P5:
>  	case LPADC_VBATT_6P0:
>  	case LPADC_VBATT_5P0:
> -		chan = iio_channel_get(NULL, chan_name[id]);
> +		chan = iio_channel_get(consumer_name, chan_name[id]);
>  		pchg->chan[LP8788_VBATT] = IS_ERR(chan) ? NULL : chan;
>  		break;
>  	default:
> @@ -631,7 +632,7 @@ static void lp8788_setup_adc_channel(struct lp8788_charger *pchg)
>  	case LPADC_ADC2:
>  	case LPADC_ADC3:
>  	case LPADC_ADC4:
> -		chan = iio_channel_get(NULL, chan_name[id]);
> +		chan = iio_channel_get(consumer_name, chan_name[id]);
>  		pchg->chan[LP8788_BATT_TEMP] = IS_ERR(chan) ? NULL : chan;
>  		break;
>  	default:
> @@ -747,7 +748,7 @@ static __devinit int lp8788_charger_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	lp8788_setup_adc_channel(pchg);
> +	lp8788_setup_adc_channel(pdev->name, pchg);
>  
>  	ret = lp8788_psy_register(pdev, pchg);
>  	if (ret)
> 

      reply	other threads:[~2012-10-19 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  6:11 Kim, Milo
2012-10-19 15:37 ` Jonathan Cameron [this message]

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=508173B6.20806@kernel.org \
    --to=jic23@kernel.org \
    --cc=Milo.Kim@ti.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=cbou@mail.ru \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome