[Intel-gfx] [PATCH 3/4] drm/i915: Consistent drm_minor use

David Weinehall david.weinehall at linux.intel.com
Mon Aug 1 15:38:54 UTC 2016


Use consistent naming for drm_minor, and always use kdev_to_drm_minor()
to convert kdev to drm_minor.

Signed-off-by: David Weinehall <david.weinehall at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_sysfs.c | 52 +++++++++++++++++++--------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 1e679ce394b8..33797b295b64 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -76,7 +76,7 @@ show_rc6_mask(struct device *kdev, struct device_attribute *attr, char *buf)
 static ssize_t
 show_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
 	u32 rc6_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6);
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
 }
@@ -100,7 +100,7 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 static ssize_t
 show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
 	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
 }
@@ -266,8 +266,8 @@ static struct bin_attribute dpf_attrs_1 = {
 static ssize_t gt_act_freq_mhz_show(struct device *kdev,
 				    struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	int ret;
 
@@ -298,8 +298,8 @@ static ssize_t gt_act_freq_mhz_show(struct device *kdev,
 static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
 				    struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n",
@@ -309,8 +309,8 @@ static ssize_t gt_cur_freq_mhz_show(struct device *kdev,
 
 static ssize_t gt_boost_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_i915_private *dev_priv = to_i915(minor->dev);
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_i915_private *dev_priv = to_i915(dminor->dev);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n",
 			intel_gpu_freq(dev_priv,
@@ -321,8 +321,8 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
 				       struct device_attribute *attr,
 				       const char *buf, size_t count)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val;
 	ssize_t ret;
@@ -346,8 +346,8 @@ static ssize_t gt_boost_freq_mhz_store(struct device *kdev,
 static ssize_t vlv_rpe_freq_mhz_show(struct device *kdev,
 				     struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n",
@@ -357,8 +357,8 @@ static ssize_t vlv_rpe_freq_mhz_show(struct device *kdev,
 
 static ssize_t gt_max_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n",
@@ -370,8 +370,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
 				     struct device_attribute *attr,
 				     const char *buf, size_t count)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val;
 	ssize_t ret;
@@ -418,8 +418,8 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
 
 static ssize_t gt_min_freq_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
 	return snprintf(buf, PAGE_SIZE, "%d\n",
@@ -431,8 +431,8 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
 				     struct device_attribute *attr,
 				     const char *buf, size_t count)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val;
 	ssize_t ret;
@@ -490,8 +490,8 @@ static DEVICE_ATTR(gt_RPn_freq_mhz, S_IRUGO, gt_rp_mhz_show, NULL);
 /* For now we have a static number of RP states */
 static ssize_t gt_rp_mhz_show(struct device *kdev, struct device_attribute *attr, char *buf)
 {
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	u32 val;
 
@@ -538,8 +538,8 @@ static ssize_t error_state_read(struct file *filp, struct kobject *kobj,
 {
 
 	struct device *kdev = kobj_to_dev(kobj);
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	struct i915_error_state_file_priv error_priv;
 	struct drm_i915_error_state_buf error_str;
 	ssize_t ret_count = 0;
@@ -573,8 +573,8 @@ static ssize_t error_state_write(struct file *file, struct kobject *kobj,
 				 loff_t off, size_t count)
 {
 	struct device *kdev = kobj_to_dev(kobj);
-	struct drm_minor *minor = kdev_to_drm_minor(kdev);
-	struct drm_device *dev = minor->dev;
+	struct drm_minor *dminor = kdev_to_drm_minor(kdev);
+	struct drm_device *dev = dminor->dev;
 	int ret;
 
 	DRM_DEBUG_DRIVER("Resetting error state\n");
-- 
2.8.1



More information about the Intel-gfx mailing list