[PATCH 16/17] drm/property: Rename struct drm_property::dev to drm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"dev" is usually used for struct device pointers. Using it for struct
drm_device pointers is irritating (for me at least). Replace it
by "drm" and adapt all users.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
---
 drivers/gpu/drm/drm_atomic_uapi.c              |  5 +++--
 drivers/gpu/drm/drm_mode_object.c              | 16 ++++++++--------
 drivers/gpu/drm/drm_property.c                 |  6 +++---
 drivers/gpu/drm/tests/drm_damage_helper_test.c |  2 +-
 include/drm/drm_property.h                     |  4 ++--
 5 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
index d9d41d1b4f5d..58300caeea38 100644
--- a/drivers/gpu/drm/drm_atomic_uapi.c
+++ b/drivers/gpu/drm/drm_atomic_uapi.c
@@ -898,7 +898,7 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
 int drm_atomic_get_property(struct drm_mode_object *obj,
 		struct drm_property *property, uint64_t *val)
 {
-	struct drm_device *dev = property->dev;
+	struct drm_device *dev = property->drm;
 	int ret;
 
 	switch (obj->type) {
@@ -1064,7 +1064,8 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
 		break;
 	}
 	default:
-		drm_dbg_atomic(prop->dev, "[OBJECT:%d] has no properties\n", obj->id);
+		drm_dbg_atomic(prop->drm, "[OBJECT:%d] has no properties\n",
+			       obj->id);
 		ret = -EINVAL;
 		break;
 	}
diff --git a/drivers/gpu/drm/drm_mode_object.c b/drivers/gpu/drm/drm_mode_object.c
index 63f071e77d77..6f33dd62b329 100644
--- a/drivers/gpu/drm/drm_mode_object.c
+++ b/drivers/gpu/drm/drm_mode_object.c
@@ -235,7 +235,7 @@ void drm_object_attach_property(struct drm_mode_object *obj,
 				uint64_t init_val)
 {
 	int count = obj->properties->count;
-	struct drm_device *dev = property->dev;
+	struct drm_device *dev = property->drm;
 
 
 	if (obj->type == DRM_MODE_OBJECT_CONNECTOR) {
@@ -285,7 +285,7 @@ int drm_object_property_set_value(struct drm_mode_object *obj,
 {
 	int i;
 
-	WARN_ON(drm_drv_uses_atomic_modeset(property->dev) &&
+	WARN_ON(drm_drv_uses_atomic_modeset(property->drm) &&
 		!(property->flags & DRM_MODE_PROP_IMMUTABLE));
 
 	for (i = 0; i < obj->properties->count; i++) {
@@ -324,7 +324,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj,
 	 * their value in obj->properties->values[].. mostly to avoid
 	 * having to deal w/ EDID and similar props in atomic paths:
 	 */
-	if (drm_drv_uses_atomic_modeset(property->dev) &&
+	if (drm_drv_uses_atomic_modeset(property->drm) &&
 			!(property->flags & DRM_MODE_PROP_IMMUTABLE))
 		return drm_atomic_get_property(obj, property, val);
 
@@ -351,7 +351,7 @@ static int __drm_object_property_get_value(struct drm_mode_object *obj,
 int drm_object_property_get_value(struct drm_mode_object *obj,
 				  struct drm_property *property, uint64_t *val)
 {
-	WARN_ON(drm_drv_uses_atomic_modeset(property->dev));
+	WARN_ON(drm_drv_uses_atomic_modeset(property->drm));
 
 	return __drm_object_property_get_value(obj, property, val);
 }
@@ -377,7 +377,7 @@ int drm_object_property_get_default_value(struct drm_mode_object *obj,
 					  struct drm_property *property,
 					  uint64_t *val)
 {
-	WARN_ON(!drm_drv_uses_atomic_modeset(property->dev));
+	WARN_ON(!drm_drv_uses_atomic_modeset(property->drm));
 
 	return __drm_object_property_get_prop_value(obj, property, val);
 }
@@ -483,7 +483,7 @@ static int set_property_legacy(struct drm_mode_object *obj,
 			       struct drm_property *prop,
 			       uint64_t prop_value)
 {
-	struct drm_device *dev = prop->dev;
+	struct drm_device *dev = prop->drm;
 	struct drm_mode_object *ref;
 	struct drm_modeset_acquire_ctx ctx;
 	int ret = -EINVAL;
@@ -515,7 +515,7 @@ static int set_property_atomic(struct drm_mode_object *obj,
 			       struct drm_property *prop,
 			       uint64_t prop_value)
 {
-	struct drm_device *dev = prop->dev;
+	struct drm_device *dev = prop->drm;
 	struct drm_atomic_state *state;
 	struct drm_modeset_acquire_ctx ctx;
 	int ret;
@@ -580,7 +580,7 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
 	if (!property)
 		goto out_unref;
 
-	if (drm_drv_uses_atomic_modeset(property->dev))
+	if (drm_drv_uses_atomic_modeset(property->drm))
 		ret = set_property_atomic(arg_obj, file_priv, property, arg->value);
 	else
 		ret = set_property_legacy(arg_obj, property, arg->value);
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c
index ab533c5b8cd4..045232c91420 100644
--- a/drivers/gpu/drm/drm_property.c
+++ b/drivers/gpu/drm/drm_property.c
@@ -110,7 +110,7 @@ struct drm_property *drm_property_create(struct drm_device *dev,
 	if (!property)
 		return NULL;
 
-	property->dev = dev;
+	property->drm = dev;
 
 	if (num_values) {
 		property->values = kcalloc(num_values, sizeof(uint64_t),
@@ -904,7 +904,7 @@ bool drm_property_change_valid_get(struct drm_property *property,
 		if (value == 0)
 			return true;
 
-		blob = drm_property_lookup_blob(property->dev, value);
+		blob = drm_property_lookup_blob(property->drm, value);
 		if (blob) {
 			*ref = &blob->base;
 			return true;
@@ -916,7 +916,7 @@ bool drm_property_change_valid_get(struct drm_property *property,
 		if (value == 0)
 			return true;
 
-		*ref = __drm_mode_object_find(property->dev, NULL, value,
+		*ref = __drm_mode_object_find(property->drm, NULL, value,
 					      property->values[0]);
 		return *ref != NULL;
 	}
diff --git a/drivers/gpu/drm/tests/drm_damage_helper_test.c b/drivers/gpu/drm/tests/drm_damage_helper_test.c
index 0403e0e4450a..ed70d8ff1469 100644
--- a/drivers/gpu/drm/tests/drm_damage_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_damage_helper_test.c
@@ -47,7 +47,7 @@ static int drm_damage_helper_init(struct kunit *test)
 	mock->obj_props.count = 0;
 	mock->plane.base.properties = &mock->obj_props;
 	mock->prop.base.id = 1; /* 0 is an invalid id */
-	mock->prop.dev = &mock->device;
+	mock->prop.drm = &mock->device;
 
 	drm_plane_enable_fb_damage_clips(&mock->plane);
 
diff --git a/include/drm/drm_property.h b/include/drm/drm_property.h
index c6b570a8459e..9022f350eee7 100644
--- a/include/drm/drm_property.h
+++ b/include/drm/drm_property.h
@@ -184,9 +184,9 @@ struct drm_property {
 	uint64_t *values;
 
 	/**
-	 * @dev: DRM device
+	 * @drm: DRM device
 	 */
-	struct drm_device *dev;
+	struct drm_device *drm;
 
 	/**
 	 * @enum_list:
-- 
2.39.2




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux