Re: [PATCH] backlight: Use id->driver_data to differentiate lp855xchips
From: Andrew Morton
Date: Thu Mar 22 2012 - 17:51:21 EST
On Wed, 21 Mar 2012 18:11:27 +0800
Axel Lin <axel.lin@xxxxxxxxx> wrote:
> Current code has corresponding driver_data settings for different chip types.
> Use the driver_data to differentiate lp855x chips.
>
> Also make lp855x_is_valid_rom_area() return bool instead of int.
>
> -static int lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr)
> +static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr)
> {
>
> ...
>
> - return (addr >= start && addr <= end) ? 1 : 0;
> + return (addr >= start && addr <= end) ? true : false;
> }
This:
--- a/drivers/video/backlight/lp855x_bl.c~backlight-use-id-driver_data-to-differentiate-lp855x-chips-fix
+++ a/drivers/video/backlight/lp855x_bl.c
@@ -82,7 +82,7 @@ static bool lp855x_is_valid_rom_area(str
return false;
}
- return (addr >= start && addr <= end) ? true : false;
+ return (addr >= start && addr <= end);
}
static int lp855x_init_registers(struct lp855x *lp)
_
--
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/