drm: small property creation cleanup
authorRob Clark <robdclark@gmail.com>
Thu, 18 Dec 2014 21:01:52 +0000 (16:01 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 5 Jan 2015 12:55:28 +0000 (13:55 +0100)
Getting ready to add a lot more standard properties for atomic.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
[danvet: Realign function paramaters where the lines shrunk
massively.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index 3bac877228fac34be1c76804085ffaff9849c535..f33863a40d42d51b0995f56071cb3e010fcfe805 100644 (file)
@@ -1325,33 +1325,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;
-
-       dev_path = drm_property_create(dev,
-                                      DRM_MODE_PROP_BLOB |
-                                      DRM_MODE_PROP_IMMUTABLE,
-                                      "PATH", 0);
-       dev->mode_config.path_property = dev_path;
-
-       dev->mode_config.tile_property = drm_property_create(dev,
-                                                            DRM_MODE_PROP_BLOB |
-                                                            DRM_MODE_PROP_IMMUTABLE,
-                                                            "TILE", 0);
+       if (!prop)
+               return -ENOMEM;
+       dev->mode_config.dpms_property = prop;
+
+       prop = drm_property_create(dev,
+                                  DRM_MODE_PROP_BLOB |
+                                  DRM_MODE_PROP_IMMUTABLE,
+                                  "PATH", 0);
+       if (!prop)
+               return -ENOMEM;
+       dev->mode_config.path_property = prop;
+
+       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;
 }