]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
fbdev: Use of_node_name_eq for node name comparisons
authorRob Herring <robh@kernel.org>
Fri, 8 Feb 2019 18:24:45 +0000 (19:24 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Fri, 8 Feb 2019 18:24:45 +0000 (19:24 +0100)
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

For instances using of_node_cmp, this has the side effect of now using
case sensitive comparisons. This should not matter for any FDT based
system which omap is.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/aty/radeon_pm.c
drivers/video/fbdev/cg14.c
drivers/video/fbdev/cg3.c
drivers/video/fbdev/ffb.c
drivers/video/fbdev/imsttfb.c
drivers/video/fbdev/offb.c
drivers/video/fbdev/omap2/omapfb/dss/dss-of.c

index e695adb0e5733db9e00f0934506a0af57de09601..2dc5703eac519f0bbc706092b4f50155aa0fa4b0 100644 (file)
@@ -2844,8 +2844,8 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
                 * in some desktop G4s), Via (M9+ chip on iBook G4) and
                 * Snowy (M11 chip on iBook G4 manufactured after July 2005)
                 */
-               if (!strcmp(rinfo->of_node->name, "ATY,JasperParent") ||
-                   !strcmp(rinfo->of_node->name, "ATY,SnowyParent")) {
+               if (of_node_name_eq(rinfo->of_node, "ATY,JasperParent") ||
+                   of_node_name_eq(rinfo->of_node, "ATY,SnowyParent")) {
                        rinfo->reinit_func = radeon_reinitialize_M10;
                        rinfo->pm_mode |= radeon_pm_off;
                }
@@ -2855,7 +2855,7 @@ void radeonfb_pm_init(struct radeonfb_info *rinfo, int dynclk, int ignore_devlis
                        rinfo->pm_mode |= radeon_pm_off;
                }
 #endif
-               if (!strcmp(rinfo->of_node->name, "ATY,ViaParent")) {
+               if (of_node_name_eq(rinfo->of_node, "ATY,ViaParent")) {
                        rinfo->reinit_func = radeon_reinitialize_M9P;
                        rinfo->pm_mode |= radeon_pm_off;
                }
index 9af54c2368fdb7252219329e9405a73ad4a2f479..a6dce1a78490ae21d82c3250ac42507002745ef4 100644 (file)
@@ -486,8 +486,8 @@ static int cg14_probe(struct platform_device *op)
                                          info->var.xres);
        info->fix.smem_len = PAGE_ALIGN(linebytes * info->var.yres);
 
-       if (!strcmp(dp->parent->name, "sbus") ||
-           !strcmp(dp->parent->name, "sbi")) {
+       if (of_node_name_eq(dp->parent, "sbus") ||
+           of_node_name_eq(dp->parent, "sbi")) {
                info->fix.smem_start = op->resource[0].start;
                par->iospace = op->resource[0].flags & IORESOURCE_BITS;
        } else {
index 1bd95b02f3aa413463183503f0b29223ddf09822..6d42def8436b24b1d36e3a453d5eb466e0a872de 100644 (file)
@@ -369,7 +369,7 @@ static int cg3_probe(struct platform_device *op)
        info->var.red.length = 8;
        info->var.green.length = 8;
        info->var.blue.length = 8;
-       if (!strcmp(dp->name, "cgRDI"))
+       if (of_node_name_eq(dp, "cgRDI"))
                par->flags |= CG3_FLAG_RDI;
        if (par->flags & CG3_FLAG_RDI)
                cg3_rdi_maybe_fixup_var(&info->var, dp);
index 6b1915872af1658c06f43d057f387303f6e69386..b7aee0c427a87978fbac441eaeb7edfca37057a7 100644 (file)
@@ -944,7 +944,7 @@ static int ffb_probe(struct platform_device *op)
 
        info->var.accel_flags = FB_ACCELF_TEXT;
 
-       if (!strcmp(dp->name, "SUNW,afb"))
+       if (of_node_name_eq(dp, "SUNW,afb"))
                par->flags |= FFB_FLAG_AFB;
 
        par->board_type = of_getintprop_default(dp, "board_type", 0);
index 901ca4ed10e9c923c9e332d8b20523a121270b4f..b268570b019d7e6b2b7ce81d6106f489b3f01212 100644 (file)
@@ -1498,8 +1498,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        switch (pdev->device) {
                case PCI_DEVICE_ID_IMS_TT128: /* IMS,tt128mbA */
                        par->ramdac = IBM;
-                       if (dp && ((strcmp(dp->name, "IMS,tt128mb8") == 0) ||
-                                  (strcmp(dp->name, "IMS,tt128mb8A") == 0)))
+                       if (of_node_name_eq(dp, "IMS,tt128mb8") ||
+                           of_node_name_eq(dp, "IMS,tt128mb8A"))
                                par->ramdac = TVP;
                        break;
                case PCI_DEVICE_ID_IMS_TT3D:  /* IMS,tt3d */
index 057d3cdef92e67963291f1a130cb3df700f4807a..8f62e174990ba78412710900c823a98dece02b5b 100644 (file)
@@ -646,7 +646,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
                }
 #endif
                /* kludge for valkyrie */
-               if (strcmp(dp->name, "valkyrie") == 0)
+               if (of_node_name_eq(dp, "valkyrie"))
                        address += 0x1000;
                offb_init_fb(no_real_node ? "bootx" : NULL,
                             width, height, depth, pitch, address,
index f1eb8b0f8a2aac3358b4a23a133f244ed385a127..5ce893c1923d283758e46e7c1e6690cefc10e022 100644 (file)
@@ -60,7 +60,7 @@ omapdss_of_get_next_port(const struct device_node *parent,
                                return NULL;
                        }
                        prev = port;
-               } while (of_node_cmp(port->name, "port") != 0);
+               } while (!of_node_name_eq(port, "port"));
 
                of_node_put(ports);
        }
@@ -83,7 +83,7 @@ omapdss_of_get_next_endpoint(const struct device_node *parent,
                if (!ep)
                        return NULL;
                prev = ep;
-       } while (of_node_cmp(ep->name, "endpoint") != 0);
+       } while (!of_node_name_eq(ep, "endpoint"));
 
        return ep;
 }