All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Milo Kim <milo.kim@ti.com>
Cc: cooloney@gmail.com, Toshi Kikuchi <toshik@chromium.org>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds:lp55xx: use the private data instead of updating I2C device platform data
Date: Mon, 24 Aug 2015 10:54:15 +0200	[thread overview]
Message-ID: <55DADBB7.5050808@samsung.com> (raw)
In-Reply-To: <1440400195-1432-1-git-send-email-milo.kim@ti.com>

On 08/24/2015 09:09 AM, Milo Kim wrote:
> Currently, lp55xx_of_populate_pdata() allocates lp55xx_platform_data if
> it's null. And it parses the DT and copies values into the
> 'client->dev.platform_data'. This may have architectural issue.
> Platform data is configurable through the DT or I2C board info inside the
> platform area. However, lp55xx common driver changes this configuration
> when it is loaded. So 'client->dev.platform_data' is not null anymore.
> Eventually, the driver initialization is not identical when it's unloaded
> and loaded again.
> The lp55xx common driver should use the private data, 'lp55xx_chip->pdata'
> instead of changing the original platform data.
>
> So, lp55xx_of_populate_pdata() is modified as follows.
> * Do not update 'dev->platform_data'. Return the pointer of new allocated
>     lp55xx_platform_data. Then the driver points it to private data,
>     'lp55xx_chip->pdata'.
> * Each lp55xx driver checks the pointer and handles an error case.
>
> Then, original platform data configuration will be kept regardless of
> loading or unloading the driver.
> The driver allocates the memory and copies them from the DT if it's NULL.
> After the driver is loaded again, 'client->dev.platform_data' is same as
> initial load, so the driver is initialized identically.
>
> Cc: Toshi Kikuchi <toshik@chromium.org>
> Cc: linux-leds@vger.kernel.org
> Signed-off-by: Milo Kim <milo.kim@ti.com>
> ---
>   drivers/leds/leds-lp5521.c        | 11 +++++------
>   drivers/leds/leds-lp5523.c        | 11 +++++------
>   drivers/leds/leds-lp5562.c        | 11 +++++------
>   drivers/leds/leds-lp55xx-common.c | 13 ++++++-------
>   drivers/leds/leds-lp55xx-common.h |  4 ++--
>   drivers/leds/leds-lp8501.c        | 11 +++++------
>   6 files changed, 28 insertions(+), 33 deletions(-)

Merged, thanks.

-- 
Best Regards,
Jacek Anaszewski

      reply	other threads:[~2015-08-24  8:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-24  7:09 [PATCH] leds:lp55xx: use the private data instead of updating I2C device platform data Milo Kim
2015-08-24  8:54 ` Jacek Anaszewski [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=55DADBB7.5050808@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=toshik@chromium.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.