From patchwork Wed Dec 5 19:50:29 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: 152944 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9695169ljp; Wed, 5 Dec 2018 11:51:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/UkI8JNb2H00SGn3eGIHgB8pIQqMVrtgcqY9+yCV5MRfhq/cXaU9t3pp1rX4bdf6C+4ig7b X-Received: by 2002:a62:c42:: with SMTP id u63mr25178827pfi.73.1544039469425; Wed, 05 Dec 2018 11:51:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039469; cv=none; d=google.com; s=arc-20160816; b=MBLI9wn5UDDZqC8OacRhlrkV6UitheBfuP/eHAcvBZGF5sP6IhUTWHvy+WfHtraIfe 9Ut3SLjpF1Yru7ttd+XZf3fJPh6CKTpRuVA4NAyPE01wsgAm+hQlRhRJg4S8pr3pcjnT NWVtztGcRtwfqsF9bQIo3NobBRZKdl1a59OhLgyIOTkrKm6n+ooddl8bRkmww8Bg7aUo D/GsMgKPFvdt3huflKvrlB31v3WTJp9QC/SeWP3gUguWCHmOc4APDpjHgLjbRE658Ecr jr2k9OLpygMTFoEHl2bF5PdSHz24/jp303Ru0QOUcG7Tp5g873MiSVEB1WzqnEHqRitZ UXEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=X3XSi5wbaDANKBZ4iC2gvXZdeAkU6Sim0nb7Xgvxqsk=; b=Y207RdtS2RczTzzR5uKbzq6Xo1bHMygTAwZMX/uqX8e0RawsX7qP5EzgalzDICtv// Qb6og4gbcGqkEybtvxDOL03buLU948eprrqpzcMJjSxhw6XtXSXV720x/OeS56q0Gva7 fEQIk4MhdfEp7QopvzYv9x8s4gcG2A2SQTjieeusLqcrB67TyM4teYLMXqo/K3lVDnZT MMZR2/yxpjMa+PRavIRLlWcFdvVx/eR0FLZEO7zfmpGb60Fy8Mp5WvlhQMR8zRpqnYgY zZuD1lFxxRCck8UCmjDZ2M1nmUYVsqiet3bhjzHCLJOKHTpqj5t6CSxl+Eb3JE/V1j4L mzSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si21670526pfc.156.2018.12.05.11.51.09; Wed, 05 Dec 2018 11:51:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728722AbeLETvI (ORCPT + 3 others); Wed, 5 Dec 2018 14:51:08 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39790 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728683AbeLETvG (ORCPT ); Wed, 5 Dec 2018 14:51:06 -0500 Received: by mail-ot1-f65.google.com with SMTP id n8so15941943otl.6; Wed, 05 Dec 2018 11:51:06 -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=X3XSi5wbaDANKBZ4iC2gvXZdeAkU6Sim0nb7Xgvxqsk=; b=oVIJbtBc24/vo2ZKiMTa5OzSWH2BALchwGiuIcL0jjLxfPBQqZcOUZgfMz5T/53xys T6LBeeapRJCeP/4vKwrrhMU+W2hMigj3Fibw/Ga32BLulijMWsjYLIDzterHpr1p/TxL HlcWeDbdg4CyWho0Mi8zuLOgrngDPcFacdXlTHXu2F1V5wO7YNnIGkeS1SHHg5wPN7FC 0wzlrnJh9hUnGDPcrB0fOg9356wzXLjkPKjWt/4i3zxgLA5mPlYjvvRS7dGHoiBuoIK4 csSzTxzZsevtDNJtIJEBtgMaz648vjPdIqmvO972sdtrCuxENr9cj3s6pAqOdrU88r3i fSWg== X-Gm-Message-State: AA+aEWaXqumikRFVqONQRt1aAOF1ysS9x7XEF7aVJkFYvol2ByAsS9Hs eeDR3DeGTOdF9OEm1IM5cwiu0Ns= X-Received: by 2002:a9d:12d:: with SMTP id 42mr15586588otu.352.1544039465403; Wed, 05 Dec 2018 11:51:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:04 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Kyungmin Park , Sylwester Nawrocki , Mauro Carvalho Chehab , Kukjin Kim , Krzysztof Kozlowski , Benoit Parrot , Hyun Kwon , Laurent Pinchart , Michal Simek , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH] media: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:29 -0600 Message-Id: <20181205195050.4759-13-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Kyungmin Park Cc: Sylwester Nawrocki Cc: Mauro Carvalho Chehab Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Benoit Parrot Cc: Hyun Kwon Cc: Laurent Pinchart Cc: Michal Simek Cc: linux-media@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Signed-off-by: Rob Herring --- drivers/media/platform/exynos4-is/media-dev.c | 12 ++++++------ drivers/media/platform/ti-vpe/cal.c | 4 ++-- drivers/media/platform/xilinx/xilinx-tpg.c | 2 +- drivers/media/v4l2-core/v4l2-fwnode.c | 6 ++---- 4 files changed, 11 insertions(+), 13 deletions(-) -- 2.19.1 Reviewed-by: Benoit Parrot diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 870501b0f351..ced14af56606 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -445,7 +445,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, */ np = of_get_parent(rem); - if (np && !of_node_cmp(np->name, "i2c-isp")) + if (of_node_name_eq(np, "i2c-isp")) pd->fimc_bus_type = FIMC_BUS_TYPE_ISP_WRITEBACK; else pd->fimc_bus_type = pd->sensor_bus_type; @@ -495,7 +495,7 @@ static int fimc_md_register_sensor_entities(struct fimc_md *fmd) for_each_available_child_of_node(parent, node) { struct device_node *port; - if (of_node_cmp(node->name, "csis")) + if (!of_node_name_eq(node, "csis")) continue; /* The csis node can have only port subnode. */ port = of_get_next_child(node, NULL); @@ -720,13 +720,13 @@ static int fimc_md_register_platform_entities(struct fimc_md *fmd, continue; /* If driver of any entity isn't ready try all again later. */ - if (!strcmp(node->name, CSIS_OF_NODE_NAME)) + if (of_node_name_eq(node, CSIS_OF_NODE_NAME)) plat_entity = IDX_CSIS; - else if (!strcmp(node->name, FIMC_IS_OF_NODE_NAME)) + else if (of_node_name_eq(node, FIMC_IS_OF_NODE_NAME)) plat_entity = IDX_IS_ISP; - else if (!strcmp(node->name, FIMC_LITE_OF_NODE_NAME)) + else if (of_node_name_eq(node, FIMC_LITE_OF_NODE_NAME)) plat_entity = IDX_FLITE; - else if (!strcmp(node->name, FIMC_OF_NODE_NAME) && + else if (of_node_name_eq(node, FIMC_OF_NODE_NAME) && !of_property_read_bool(node, "samsung,lcd-wb")) plat_entity = IDX_FIMC; diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 95a093f41905..fc3c212b96e1 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -1615,7 +1615,7 @@ 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")); } return port; @@ -1635,7 +1635,7 @@ 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; } diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c index 851d20dcd550..ce686b8d6cff 100644 --- a/drivers/media/platform/xilinx/xilinx-tpg.c +++ b/drivers/media/platform/xilinx/xilinx-tpg.c @@ -725,7 +725,7 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) const struct xvip_video_format *format; struct device_node *endpoint; - if (!port->name || of_node_cmp(port->name, "port")) + if (!of_node_name_eq(port, "port")) continue; format = xvip_of_get_format(port); diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c b/drivers/media/v4l2-core/v4l2-fwnode.c index 218f0da0ce76..849326241b17 100644 --- a/drivers/media/v4l2-core/v4l2-fwnode.c +++ b/drivers/media/v4l2-core/v4l2-fwnode.c @@ -564,8 +564,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode, fwnode = fwnode_get_parent(__fwnode); fwnode_property_read_u32(fwnode, port_prop, &link->local_port); fwnode = fwnode_get_next_parent(fwnode); - if (is_of_node(fwnode) && - of_node_cmp(to_of_node(fwnode)->name, "ports") == 0) + if (is_of_node(fwnode) && of_node_name_eq(to_of_node(fwnode), "ports")) fwnode = fwnode_get_next_parent(fwnode); link->local_node = fwnode; @@ -578,8 +577,7 @@ int v4l2_fwnode_parse_link(struct fwnode_handle *__fwnode, fwnode = fwnode_get_parent(fwnode); fwnode_property_read_u32(fwnode, port_prop, &link->remote_port); fwnode = fwnode_get_next_parent(fwnode); - if (is_of_node(fwnode) && - of_node_cmp(to_of_node(fwnode)->name, "ports") == 0) + if (is_of_node(fwnode) && of_node_name_eq(to_of_node(fwnode), "ports")) fwnode = fwnode_get_next_parent(fwnode); link->remote_node = fwnode;