[PATCH 07/13] drm: small property creation cleanup
Daniel Vetter
daniel at ffwll.ch
Wed Dec 17 06:13:00 PST 2014
On Tue, Dec 16, 2014 at 06:05:35PM -0500, Rob Clark wrote:
> Getting ready to add a lot more standard properties for atomic.
>
> Signed-off-by: Rob Clark <robdclark at gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
> drivers/gpu/drm/drm_crtc.c | 27 +++++++++++++++++----------
> 1 file changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 57cd950..96965ec 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1330,33 +1330,40 @@ EXPORT_SYMBOL(drm_plane_force_disable);
>
> static int drm_mode_create_standard_connector_properties(struct drm_device *dev)
> {
> - struct drm_property *edid;
> - struct drm_property *dpms;
> - struct drm_property *dev_path;
> + struct drm_property *prop;
>
> /*
> * Standard properties (apply to all connectors)
> */
> - edid = drm_property_create(dev, DRM_MODE_PROP_BLOB |
> + prop = drm_property_create(dev, DRM_MODE_PROP_BLOB |
> DRM_MODE_PROP_IMMUTABLE,
> "EDID", 0);
> - dev->mode_config.edid_property = edid;
> + if (!prop)
> + return -ENOMEM;
> + dev->mode_config.edid_property = prop;
>
> - dpms = drm_property_create_enum(dev, 0,
> + prop = drm_property_create_enum(dev, 0,
> "DPMS", drm_dpms_enum_list,
> ARRAY_SIZE(drm_dpms_enum_list));
> - dev->mode_config.dpms_property = dpms;
> + if (!prop)
> + return -ENOMEM;
> + dev->mode_config.dpms_property = prop;
>
> - dev_path = drm_property_create(dev,
> + prop = drm_property_create(dev,
> DRM_MODE_PROP_BLOB |
> DRM_MODE_PROP_IMMUTABLE,
> "PATH", 0);
> - dev->mode_config.path_property = dev_path;
> + if (!prop)
> + return -ENOMEM;
> + dev->mode_config.path_property = prop;
>
> - dev->mode_config.tile_property = drm_property_create(dev,
> + prop = drm_property_create(dev,
> DRM_MODE_PROP_BLOB |
> DRM_MODE_PROP_IMMUTABLE,
> "TILE", 0);
> + if (!prop)
> + return -ENOMEM;
> + dev->mode_config.tile_property = prop;
>
> return 0;
> }
> --
> 2.1.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the dri-devel
mailing list