All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karol Lewandowski <k.lewandowsk@samsung.com>
To: Anton Vorontsov <cbouatmailru@gmail.com>
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	m.szyprowski@samsung.com, devicetree-discuss@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] max17042_battery: Preserve properties outside of platform data
Date: Wed, 14 Mar 2012 10:14:31 +0100	[thread overview]
Message-ID: <4F606177.3080702@samsung.com> (raw)
In-Reply-To: <20120313192110.GB2187@oksana.dev.rtsoft.ru>

On 13.03.2012 20:21, Anton Vorontsov wrote:

> On Wed, Feb 22, 2012 at 07:06:21PM +0100, Karol Lewandowski wrote:
>> Add fields originally found in platform data back to max17042_chip,
>> as the former data structure might be not available on device
>> tree-based systems.
>>
>> This commit makes it possible to safely declare platform data with
>> __initdata tag.
>>
>> Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/power/max17042_battery.c |   36 +++++++++++++++++++++++-------------
>>  1 files changed, 23 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
>> index 21a3650..49c1377 100644
>> --- a/drivers/power/max17042_battery.c
>> +++ b/drivers/power/max17042_battery.c
>> @@ -33,7 +33,8 @@
>>  struct max17042_chip {
>>  	struct i2c_client *client;
>>  	struct power_supply battery;
>> -	struct max17042_platform_data *pdata;
>> +	bool enable_current_sense;
>> +	u32 r_sns;
> 
> Dirk Brandewie implemented config_data in addition to these
> fields, so this patch would have needed a rework. So I decided
> to drop this particular patch and rework patch 3/3 to make OF
> helper allocat pdata instead.


Actually, this is how I done it for first time.  However,
shortly after that I've seen some maintainers opposing use
of platform data at runtime.
This is why I've moved it to private data.

On the other hand I don't like duplicating same fields in private
and platform data.  Thus, I actually like reworked version
a bit more.

Thanks!
-- 
Karol Lewandowski | Samsung Poland R&D Center | Linux/Platform

  reply	other threads:[~2012-03-14  9:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 18:06 [PATCH 0/3] power: max17042_battery: Add DT bindings Karol Lewandowski
2012-02-22 18:06 ` [PATCH 1/3] max17042_battery: Use devm_kzalloc() where applicable Karol Lewandowski
2012-03-13 19:18   ` Anton Vorontsov
2012-03-13 19:18     ` Anton Vorontsov
2012-02-22 18:06 ` [PATCH 2/3] max17042_battery: Preserve properties outside of platform data Karol Lewandowski
2012-03-13 19:21   ` Anton Vorontsov
2012-03-14  9:14     ` Karol Lewandowski [this message]
2012-02-22 18:06 ` [PATCH 3/3] max17042_battery: Make it possible to instantiate driver from DT Karol Lewandowski
2012-03-13 19:22   ` Anton Vorontsov
2012-03-14 12:29     ` Karol Lewandowski
2012-03-14 12:29       ` Karol Lewandowski

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=4F606177.3080702@samsung.com \
    --to=k.lewandowsk@samsung.com \
    --cc=cbouatmailru@gmail.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=myungjoo.ham@samsung.com \
    /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.