lkml.org 
[lkml]   [2013]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 06/35] mfd: ab8500-core: Sysfs chip id modification
From
On 20 February 2013 09:13, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 19 Feb 2013, Arnd Bergmann wrote:
>
>> On Friday 15 February 2013, Lee Jones wrote:
>> > struct ab8500 *ab8500;
>> > + int chip_id = -EINVAL;
>> >
>> > ab8500 = dev_get_drvdata(dev);
>> > - return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL);
>> > + if(ab8500) {
>> > + chip_id = ab8500->chip_id;
>> > + if((is_ab8505(ab8500) || is_ab9540(ab8500)) && ab8500->version != 0xFF)
>> > + chip_id = (ab8500->version << 8) | chip_id;
>> > + }
>> > + return sprintf(buf, "%#x\n", chip_id);
>> > }
>>
>> What's the use of printing "ffffffea" for unknown versions here?
>
> You mean instead of -EINVAL? No idea, Marcus?
>
Looks like I'm guilty of just making the minimal changes. Arnd is
right though, getting ffffffea(-EINVAL) back is pretty useless.
I'll have to check user land to see what is using this. Maybe not
printing and returning 0 should be the correct behaviour
when an unknown version is found.


\
 
 \ /
  Last update: 2013-02-20 10:42    [W:0.068 / U:1.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site