drm: add convenience function to create an range property

Creating a range property is a common pattern, so create
a convenience function for this and use it where appropriate.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Sascha Hauer
2012-02-06 10:58:18 +01:00
committed by Dave Airlie
parent 4a67d39190
commit d9bc3c02e3
8 changed files with 56 additions and 121 deletions

View File

@@ -725,10 +725,7 @@ static int psb_create_backlight_property(struct drm_device *dev)
if (dev_priv->backlight_property)
return 0;
backlight = drm_property_create(dev, DRM_MODE_PROP_RANGE,
"backlight", 2);
backlight->values[0] = 0;
backlight->values[1] = 100;
backlight = drm_property_create_range(dev, 0, "backlight", 0, 100);
dev_priv->backlight_property = backlight;