From patchwork Wed Dec 5 19:50:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 152951 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9695469ljp; Wed, 5 Dec 2018 11:51:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/W+oALOMOpscM6HE5b/bHad3ouRZ7p+MNJu51/gbSBxHGJDTZFT5sIAuVQ25e9GD0YfXcs3 X-Received: by 2002:a63:5026:: with SMTP id e38mr21676386pgb.123.1544039489355; Wed, 05 Dec 2018 11:51:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039489; cv=none; d=google.com; s=arc-20160816; b=cggjDzOBJJBoRg3VDULA/7Y8+8IA5ZPHViPgrx2vYNABLZmnmS1xl3QLa862GgjOKL K2h3GAhCzE5ZEJ2HuIxHYFcRt5zz92AYi3/NQyENltAf8za6LA7+5ty0LF3GT/j4mLmp MchMpXaGRuR21h3NF6uXgcTr7pLu/N93AMC75OV/QdQty6nzS+aDhS08OKtTg8jUsjME /2JzY3hZQQU3bbrHR7/kpHg9zKOJ+haKqEsrW/nfiByxsx1Pnmq297MJzWM0RlI/dqTa elgpZGq7HrF8Ys72683Xjlh0CwBy7ovuj/5sZo1BvazNW1kvBKpGXPKi9PxXSwgXEllL WaVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:to:from :delivered-to; bh=UcKuuD0CKKtaKbwSEjc8W6EQfi4L9+V/WUqv7TUfg0w=; b=YXSo5Qce97MHkbuLhIjkQ00nNiIFbBQ4Y4mUI02c+kCCalrCUCQBlvJhvIbp7JvNAR ifqPFZ62dg89CUoitTnXzJo5Q4eewbhtpl+CNdQJYLv89fxkuQFghpbjaZ14EPJMRtzc 4Rtk9DRGKEhK2Jz8g18/Y2pb+0l5lab33HqNUYrZmPOgX8t9LHnERenPcD1qA98Vo9Ya KvaVJa3cZ3oUPn1wPqmPGrd9Y5xcz5IvdduRPK3SJRd3jOB77KY6cqVBID8hhByEtcN/ UN1QTl/YwVn10dzu1SWvZhimMl78OPV/n4xqxQwHakiFv6ZKy9K5MijZJB7PdLhEhKEn 2WAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id j24si19105936pgn.149.2018.12.05.11.51.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Dec 2018 11:51:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7B3D6E4E0; Wed, 5 Dec 2018 19:51:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8BF66E4DF for ; Wed, 5 Dec 2018 19:51:24 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id w13so18623935oiw.9 for ; Wed, 05 Dec 2018 11:51:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RAj3RG1UBPGI7GeqlRPUG5pKvqZ7bJfcoUGOt4urFsw=; b=Rb5YVejSFTWDhHY41hnhHCzJtHx+TpbkAIV6Iu0kE0dUZnHOoCgpifec5j/0j9BVAB dNauFGK597Q+PprajAVDDcu/SrJI+i9plJTHcdCWcZhlKjs0RBj949bLoL4k2yl2eOjO BYcc76JKr38I2ehDJs2UKeA4KHTo8z37GsxpKaxynw8ABxNkJ39PfEK4wMiEomTd6jgp CH2aFv0lF+j1Czhscw1x6UCWdFc1Nya83znrY78YdwFdtLZ3azUI8MHvc0ycNKT/FEbR laL7iM/HH+P25LarB+UGp/7LW7c0kZ34I4LQGI5ok8s5m664ckpw6fMUwiEKEWNsdukZ SgaQ== X-Gm-Message-State: AA+aEWZrjYvWwhAizDmV34WCAGmqpx4VC8U8oG+gDIDNfRXMeyKx4TkU BaYFshSsq12S+0iNHm6/0A== X-Received: by 2002:aca:f244:: with SMTP id q65mr14732666oih.50.1544039484056; Wed, 05 Dec 2018 11:51:24 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id k13sm25759879otj.19.2018.12.05.11.51.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:23 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:45 -0600 Message-Id: <20181205195050.4759-29-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Cc: Benjamin Herrenschmidt Cc: Bartlomiej Zolnierkiewicz Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linux-omap@vger.kernel.org Signed-off-by: Rob Herring --- drivers/video/fbdev/aty/radeon_pm.c | 6 +++--- drivers/video/fbdev/cg14.c | 4 ++-- drivers/video/fbdev/cg3.c | 2 +- drivers/video/fbdev/ffb.c | 2 +- drivers/video/fbdev/imsttfb.c | 4 ++-- drivers/video/fbdev/offb.c | 2 +- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/aty/radeon_pm.c b/drivers/video/fbdev/aty/radeon_pm.c index e695adb0e573..2dc5703eac51 100644 --- a/drivers/video/fbdev/aty/radeon_pm.c +++ b/drivers/video/fbdev/aty/radeon_pm.c @@ -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; } diff --git a/drivers/video/fbdev/cg14.c b/drivers/video/fbdev/cg14.c index 9af54c2368fd..a6dce1a78490 100644 --- a/drivers/video/fbdev/cg14.c +++ b/drivers/video/fbdev/cg14.c @@ -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 { diff --git a/drivers/video/fbdev/cg3.c b/drivers/video/fbdev/cg3.c index 1bd95b02f3aa..6d42def8436b 100644 --- a/drivers/video/fbdev/cg3.c +++ b/drivers/video/fbdev/cg3.c @@ -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); diff --git a/drivers/video/fbdev/ffb.c b/drivers/video/fbdev/ffb.c index 6b1915872af1..b7aee0c427a8 100644 --- a/drivers/video/fbdev/ffb.c +++ b/drivers/video/fbdev/ffb.c @@ -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); diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index 901ca4ed10e9..b268570b019d 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -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 */ diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c index 31f769d67195..7b452a520e85 100644 --- a/drivers/video/fbdev/offb.c +++ b/drivers/video/fbdev/offb.c @@ -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, diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index f1eb8b0f8a2a..5ce893c1923d 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -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; }