linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Wu <bryan.wu@canonical.com>
To: "Kim, Milo" <Milo.Kim@ti.com>
Cc: "linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Richard Purdie <rpurdie@rpsys.net>
Subject: Re: [PATCH 3/3] leds-lp5523: use the i2c device id rather than fixed name
Date: Tue, 4 Sep 2012 16:25:39 +0800	[thread overview]
Message-ID: <CAK5ve-+xH5KreRaeigGk7zk--gCYfXuzQ3eXvmXDZmWobCRRUw@mail.gmail.com> (raw)
In-Reply-To: <A874F61F95741C4A9BA573A70FE3998F41EF210D@DQHE02.ent.ti.com>

On Tue, Sep 4, 2012 at 3:06 PM, Kim, Milo <Milo.Kim@ti.com> wrote:
>  LP5523 driver supports both LP5523 and LP55231.
>  The i2c device id is one of the two - lp5523 or lp55231.
>  So it's better to use matching i2c device id while enumerating the device
>  and naming LED channels.
>
Applied, thanks.

-Bryan

> Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
> ---
>  drivers/leds/leds-lp5523.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
> index e69e72a..3d60428 100644
> --- a/drivers/leds/leds-lp5523.c
> +++ b/drivers/leds/leds-lp5523.c
> @@ -833,7 +833,8 @@ static int __init lp5523_init_engine(struct lp5523_engine *engine, int id)
>  }
>
>  static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
> -                          int chan, struct lp5523_platform_data *pdata)
> +                          int chan, struct lp5523_platform_data *pdata,
> +                          const char *chip_name)
>  {
>         char name[32];
>         int res;
> @@ -856,7 +857,7 @@ static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
>                         led->cdev.name = pdata->led_config[chan].name;
>                 } else {
>                         snprintf(name, sizeof(name), "%s:channel%d",
> -                               pdata->label ?: "lp5523", chan);
> +                               pdata->label ? : chip_name, chan);
>                         led->cdev.name = name;
>                 }
>
> @@ -927,7 +928,7 @@ static int __devinit lp5523_probe(struct i2c_client *client,
>         if (ret)
>                 goto fail1;
>
> -       dev_info(&client->dev, "LP5523 Programmable led chip found\n");
> +       dev_info(&client->dev, "%s Programmable led chip found\n", id->name);
>
>         /* Initialize engines */
>         for (i = 0; i < ARRAY_SIZE(chip->engines); i++) {
> @@ -955,7 +956,8 @@ static int __devinit lp5523_probe(struct i2c_client *client,
>                 INIT_WORK(&chip->leds[led].brightness_work,
>                         lp5523_led_brightness_work);
>
> -               ret = lp5523_init_led(&chip->leds[led], &client->dev, i, pdata);
> +               ret = lp5523_init_led(&chip->leds[led], &client->dev, i, pdata,
> +                               id->name);
>                 if (ret) {
>                         dev_err(&client->dev, "error initializing leds\n");
>                         goto fail2;
> --
> 1.7.9.5
>
>
> Best Regards,
> Milo
>
>



-- 
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer    +86.186-168-78255 Mobile
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

      reply	other threads:[~2012-09-04  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-04  7:06 [PATCH 3/3] leds-lp5523: use the i2c device id rather than fixed name Kim, Milo
2012-09-04  8:25 ` Bryan Wu [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=CAK5ve-+xH5KreRaeigGk7zk--gCYfXuzQ3eXvmXDZmWobCRRUw@mail.gmail.com \
    --to=bryan.wu@canonical.com \
    --cc=Milo.Kim@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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;
as well as URLs for NNTP newsgroup(s).