lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 Mar 2012 10:14:31 +0100
From:	Karol Lewandowski <k.lewandowsk@...sung.com>
To:	Anton Vorontsov <cbouatmailru@...il.com>
Cc:	myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
	m.szyprowski@...sung.com, devicetree-discuss@...ts.ozlabs.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] max17042_battery: Preserve properties outside of
 platform data

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@...sung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@...sung.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ