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:

committed by
Dave Airlie

parent
4a67d39190
commit
d9bc3c02e3
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user