Subject: [PATCH v2] video/imxfb.c: allow usage without BACKLIGHT_CLASS_DEVICE

From: [email-masked] (Eric Bénard)
Date: Thu, 29 Jul 2010 15:03:20 +0200

Le 29/07/2010 14:45, Uwe Kleine-K?nig a ?crit :
> On Thu, Jul 29, 2010 at 11:47:36AM +0200, Eric B?nard wrote:
>> Signed-off-by: Eric B?nard<[email-masked]>
>> ---
>> v2:	handle CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE
>>
>>   drivers/video/imxfb.c |   18 ++++++++++++++++--
>>   1 files changed, 16 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
>> index 43f0639..a6f0d3f 100644
>> --- a/drivers/video/imxfb.c
>> +++ b/drivers/video/imxfb.c
>> @@ -175,7 +175,10 @@ struct imxfb_info {
>>
>>   	struct imx_fb_videomode *mode;
>>   	int			num_modes;
>> +#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
>> +	defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
>>   	struct backlight_device *bl;
>> +#endif
> I suspect this fails to build with
> 	CONFIG_BACKLIGHT_CLASS_DEVICE=m
> 	CONFIG_FB_IMX=y
>
you're right, I tested both =y and both =m but not one =y one =m :-(

> Maybe do the following:
>
> #if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
> 	(defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE) == defined(CONFIG_FB_IMX_MODULE))
> #define BACKLIGHT_AVAILABLE
> #endif
>
> and use #ifdef BACKLIGHT_AVAILABLE to guard the backlight code?
>
> I didn't test this though.
>
patch follows (compile tested with all cases, including this new one ;-).

Eric