Re: [PATCH 2.6.29] eeepc-laptop: report brightness control events via the input layer

From: Corentin Chary
Date: Sun Apr 05 2009 - 04:22:45 EST


On Sun, Apr 5, 2009 at 12:10 AM, Darren Salt
<linux@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> I demand that Corentin Chary may or may not have written...
>
>>>> How can brn be -2?
>>> If notify_brn() wasn't called, it will be.
>
>> Oh, yeah, I miss the if() before notify_brn()
>
> Easily missed. ;-)
>
>>>> And why -2?
>>> Because notify_brn() won't return it (and if it ever does, it needs to be
>>> fixed). (Yes, I know, "magic numbers" and all that...)
>
>> Maybe a negative known error code could be used here
>
> I see the following:
>
> * read_acpi_int() returns 0 and writes the brightness setting to *val, or
>  returns -1 and writes -1 to *val if the ACPI call failed.
>
> * get_acpi() returns whatever was written to value by read_acpi_int(), or
>  -ENODEV if there's no ACPI method which can be called.
>
> * read_brightness is a trivial wrapper for get_acpi().
>
> * notify_brn() stores the result of read_brightness and returns the
>  previously-stored value, so it can store then later return -ENODEV, -1 or
>  the brightness setting.
>
> This makes -ENODEV a suitable value. Replacing that -1 with something other
> than -ENODEV might be good, but I don't think that that really matters right
> now (though I've replaced the "!= -1" in the original version of the patch
> with "< 0").
>
> Revised patch follows...

Thanks, it's cleaner now =).

There was just a little

ERROR: that open brace { should be on the previous line
#36: FILE: drivers/platform/x86/eeepc-laptop.c:521:
if (bd)
+ {

But I corrected that. It is now pushed in acpi4asus tree.

--
Corentin Chary
http://xf.iksaif.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/