[Intel-gfx] [PATCH] i915: Add native backlight support

Julien Cristau jcristau at debian.org
Mon Feb 22 18:21:18 CET 2010


Hi Matthew,

On Mon, Feb 22, 2010 at 12:05:06 -0500, Matthew Garrett wrote:

> +static int intel_lvds_backlight_setup(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = dev->dev_private;
> -	u32 reg;
> +	struct backlight_properties props;
> +
> +	props.max_brightness = intel_lvds_get_max_backlight(dev);
> +	props.type = BACKLIGHT_RAW;
> +	dev_priv->backlight = backlight_device_register("intel_backlight",
> +							&dev->pdev->dev, dev,
> +							&intel_lvds_bl_ops,
> +							&props);
> +	if (IS_ERR(dev_priv->backlight)) {
> +		DRM_ERROR("Failed to register backlight: %ld\n",
> +			  PTR_ERR(dev_priv->backlight));
> +		dev_priv->backlight = NULL;

missing return here.

> +	}
> +	dev_priv->backlight->props.brightness = intel_lvds_get_backlight(dev);
> +	return 0;
> +}
>  

Cheers,
Julien



More information about the Intel-gfx mailing list