drm: replace drm_get_connector_name() with direct name field use
authorJani Nikula <jani.nikula@intel.com>
Tue, 3 Jun 2014 11:56:20 +0000 (14:56 +0300)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Jun 2014 03:17:41 +0000 (13:17 +1000)
Generated using semantic patch:

@@
expression E;
@@

- drm_get_connector_name(E)
+ E->name

[airlied: regenerated]

Acked-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_crtc_helper.c
drivers/gpu/drm/drm_edid.c
drivers/gpu/drm/drm_edid_load.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/drm_probe_helper.c
drivers/gpu/drm/drm_sysfs.c

index edee61bccd148ec465ab6beb2d2cc99aff7ebf28..242937c76638973f1d50f7c13ad6a2719882d678 100644 (file)
@@ -1663,7 +1663,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
                                            head) {
                                DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
                                        connector->base.id,
-                                       drm_get_connector_name(connector));
+                                       connector->name);
                                if (put_user(connector->base.id,
                                             connector_id + copied)) {
                                        ret = -EFAULT;
@@ -2458,7 +2458,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
                        connector = obj_to_connector(obj);
                        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
                                        connector->base.id,
-                                       drm_get_connector_name(connector));
+                                       connector->name);
 
                        connector_set[i] = connector;
                }
index 54e8fdba02b46765f3ac16ceaad09c3483b4a260..d31659f7dfaa6be6911542fea0d58ac6b5664c4f 100644 (file)
@@ -600,11 +600,11 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
                }
                if (new_crtc) {
                        DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [CRTC:%d]\n",
-                               connector->base.id, drm_get_connector_name(connector),
+                               connector->base.id, connector->name,
                                new_crtc->base.id);
                } else {
                        DRM_DEBUG_KMS("[CONNECTOR:%d:%s] to [NOCRTC]\n",
-                               connector->base.id, drm_get_connector_name(connector));
+                               connector->base.id, connector->name);
                }
        }
 
@@ -630,7 +630,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
                        DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
                        for (i = 0; i < set->num_connectors; i++) {
                                DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id,
-                                             drm_get_connector_name(set->connectors[i]));
+                                             set->connectors[i]->name);
                                set->connectors[i]->funcs->dpms(set->connectors[i], DRM_MODE_DPMS_ON);
                        }
                }
index 643f830f3413c36e5d41876df442c1dfd09ebd97..085e5550aac501d4dac34749dbe0299d036e1152 100644 (file)
@@ -1232,7 +1232,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
                if (i == 4 && print_bad_edid) {
                        dev_warn(connector->dev->dev,
                         "%s: Ignoring invalid EDID block %d.\n",
-                        drm_get_connector_name(connector), j);
+                        connector->name, j);
 
                        connector->bad_edid_counter++;
                }
@@ -1252,7 +1252,7 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 carp:
        if (print_bad_edid) {
                dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n",
-                        drm_get_connector_name(connector), j);
+                        connector->name, j);
        }
        connector->bad_edid_counter++;
 
@@ -3470,24 +3470,24 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,
                        if (hdmi[6] & DRM_EDID_HDMI_DC_30) {
                                dc_bpc = 10;
                                DRM_DEBUG("%s: HDMI sink does deep color 30.\n",
-                                                 drm_get_connector_name(connector));
+                                                 connector->name);
                        }
 
                        if (hdmi[6] & DRM_EDID_HDMI_DC_36) {
                                dc_bpc = 12;
                                DRM_DEBUG("%s: HDMI sink does deep color 36.\n",
-                                                 drm_get_connector_name(connector));
+                                                 connector->name);
                        }
 
                        if (hdmi[6] & DRM_EDID_HDMI_DC_48) {
                                dc_bpc = 16;
                                DRM_DEBUG("%s: HDMI sink does deep color 48.\n",
-                                                 drm_get_connector_name(connector));
+                                                 connector->name);
                        }
 
                        if (dc_bpc > 0) {
                                DRM_DEBUG("%s: Assigning HDMI sink color depth as %d bpc.\n",
-                                                 drm_get_connector_name(connector), dc_bpc);
+                                                 connector->name, dc_bpc);
                                info->bpc = dc_bpc;
 
                                /*
@@ -3501,7 +3501,7 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,
                                if (hdmi[6] & DRM_EDID_HDMI_DC_Y444) {
                                        info->color_formats |= DRM_COLOR_FORMAT_YCRCB444;
                                        DRM_DEBUG("%s: HDMI sink does YCRCB444 in deep color.\n",
-                                                         drm_get_connector_name(connector));
+                                                         connector->name);
                                }
 
                                /*
@@ -3510,14 +3510,14 @@ static bool drm_assign_hdmi_deep_color_info(struct edid *edid,
                                 */
                                if (!(hdmi[6] & DRM_EDID_HDMI_DC_36)) {
                                        DRM_DEBUG("%s: HDMI sink should do DC_36, but does not!\n",
-                                                         drm_get_connector_name(connector));
+                                                         connector->name);
                                }
 
                                return true;
                        }
                        else {
                                DRM_DEBUG("%s: No deep color support on this HDMI sink.\n",
-                                                 drm_get_connector_name(connector));
+                                                 connector->name);
                        }
                }
        }
@@ -3600,7 +3600,7 @@ static void drm_add_display_info(struct edid *edid,
        }
 
        DRM_DEBUG("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n",
-                         drm_get_connector_name(connector), info->bpc);
+                         connector->name, info->bpc);
 
        info->color_formats |= DRM_COLOR_FORMAT_RGB444;
        if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444)
@@ -3628,7 +3628,7 @@ int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid)
        }
        if (!drm_edid_is_valid(edid)) {
                dev_warn(connector->dev->dev, "%s: EDID invalid.\n",
-                        drm_get_connector_name(connector));
+                        connector->name);
                return 0;
        }
 
index 6e09f615ebc9b015593d986f7b804a761f79e131..0a235fe61c9b9bfd929a1f4a71461bc6ad2bd3d7 100644 (file)
@@ -261,7 +261,7 @@ out:
 
 int drm_load_edid_firmware(struct drm_connector *connector)
 {
-       const char *connector_name = drm_get_connector_name(connector);
+       const char *connector_name = connector->name;
        char *edidname = edid_firmware, *last, *colon;
        int ret;
        struct edid *edid;
index e95ed5805f07326668afceb83363a951d0a1cf1a..1ddc17464250c23cfec7b2ac50bcac495053124f 100644 (file)
@@ -120,7 +120,7 @@ static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper)
                mode = &fb_helper_conn->cmdline_mode;
 
                /* do something on return - turn off connector maybe */
-               if (fb_get_options(drm_get_connector_name(connector), &option))
+               if (fb_get_options(connector->name, &option))
                        continue;
 
                if (drm_mode_parse_command_line_for_connector(option,
@@ -142,12 +142,12 @@ static int drm_fb_helper_parse_command_line(struct drm_fb_helper *fb_helper)
                                }
 
                                DRM_INFO("forcing %s connector %s\n",
-                                        drm_get_connector_name(connector), s);
+                                        connector->name, s);
                                connector->force = mode->force;
                        }
 
                        DRM_DEBUG_KMS("cmdline mode for connector %s %dx%d@%dHz%s%s%s\n",
-                                     drm_get_connector_name(connector),
+                                     connector->name,
                                      mode->xres, mode->yres,
                                      mode->refresh_specified ? mode->refresh : 60,
                                      mode->rb ? " reduced blanking" : "",
index 79f07f2c13d3c8ffcc4e530245dcf0a5d0abe263..d22676b89cbb337147ec319fe5af4963e5e9f1d8 100644 (file)
@@ -96,7 +96,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
        WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
 
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
-                       drm_get_connector_name(connector));
+                       connector->name);
        /* set all modes to the unverified state */
        list_for_each_entry(mode, &connector->modes, head)
                mode->status = MODE_UNVERIFIED;
@@ -120,7 +120,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
 
        if (connector->status == connector_status_disconnected) {
                DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n",
-                       connector->base.id, drm_get_connector_name(connector));
+                       connector->base.id, connector->name);
                drm_mode_connector_update_edid_property(connector, NULL);
                verbose_prune = false;
                goto prune;
@@ -168,7 +168,7 @@ prune:
        drm_mode_sort(&connector->modes);
 
        DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id,
-                       drm_get_connector_name(connector));
+                       connector->name);
        list_for_each_entry(mode, &connector->modes, head) {
                drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
                drm_mode_debug_printmodeline(mode);
@@ -286,7 +286,7 @@ static void output_poll_execute(struct work_struct *work)
                        DRM_DEBUG_KMS("[CONNECTOR:%d:%s] "
                                      "status updated from %s to %s\n",
                                      connector->base.id,
-                                     drm_get_connector_name(connector),
+                                     connector->name,
                                      old, new);
 
                        changed = true;
@@ -431,7 +431,7 @@ bool drm_helper_hpd_irq_event(struct drm_device *dev)
                connector->status = connector->funcs->detect(connector, false);
                DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
                              connector->base.id,
-                             drm_get_connector_name(connector),
+                             connector->name,
                              drm_get_connector_status_name(old_status),
                              drm_get_connector_status_name(connector->status));
                if (old_status != connector->status)
index c22c3097c3e857ba823cd9c339333983842c4ecf..369b26278e76601b519f19ef82fe771d297ea250 100644 (file)
@@ -380,9 +380,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)
 
        connector->kdev = device_create(drm_class, dev->primary->kdev,
                                        0, connector, "card%d-%s",
-                                       dev->primary->index, drm_get_connector_name(connector));
+                                       dev->primary->index, connector->name);
        DRM_DEBUG("adding \"%s\" to sysfs\n",
-                 drm_get_connector_name(connector));
+                 connector->name);
 
        if (IS_ERR(connector->kdev)) {
                DRM_ERROR("failed to register connector device: %ld\n", PTR_ERR(connector->kdev));
@@ -460,7 +460,7 @@ void drm_sysfs_connector_remove(struct drm_connector *connector)
        if (!connector->kdev)
                return;
        DRM_DEBUG("removing \"%s\" from sysfs\n",
-                 drm_get_connector_name(connector));
+                 connector->name);
 
        for (i = 0; i < ARRAY_SIZE(connector_attrs); i++)
                device_remove_file(connector->kdev, &connector_attrs[i]);