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

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Thu Jul 29 08:45:34 EDT 2010


On Thu, Jul 29, 2010 at 11:47:36AM +0200, Eric Bénard wrote:
> Signed-off-by: Eric Bénard <eric at eukrea.com>
> ---
> 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

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.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



More information about the linux-arm-kernel mailing list