From patchwork Wed Dec 5 19:50:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 152939 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9695039ljp; Wed, 5 Dec 2018 11:51:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/UyCvCSHxXO5pBFajsfnzStn/uBnOfVIg6L9PO6Ql3DUYvF/p+QpK7yY6rstKpnB6E+goqx X-Received: by 2002:a63:344e:: with SMTP id b75mr20752111pga.184.1544039460066; Wed, 05 Dec 2018 11:51:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039460; cv=none; d=google.com; s=arc-20160816; b=rifPsZBt+cNO8c0yWprXd9cpttN/ZUfrQkmt9AbopznZWg6x3nJtze5i9QjgcOF1lU jaIxIduVC3VBN+MbUmNdj3UJ4ZiKv+BZkmS6ObiB8kEOmpSBAlMQ7O5vlKqNIHjrv4pD f+xcYleUEsxahPX3gb0KEEEGPcq8GGY+ZXDl8otObw1S4IB5XyPqzbPtqORIVnMk0h4S RTxkM7RYPCLYh8V35Z6rG0nwvboXHMOA4Enq1NYxUTghMey5mltcvycU1o+Je+Zt82o3 fzEFPzQMbMPHRQFG6OzhAlut8GbvDG1TgaWH++hRlk83JF1kxhl4ui5mlbgmUNRjBm83 nljg== 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=hpEtuMyejLbcg/OvDvyl/00uB/0Gj9YbrzwIg6g5G5g=; b=tUlsRlg4GrC9Kojgo+TwWwPRovvDi0FN4FtnUPvbRaL7wJs9SqC/O4CwLCc4D4yiVt ocpL3whADrKnPlgaOc36jidhdnTLPi3Wbzf5dul0kV/cSaM2NPx1RyO+QaQKP/fFJK4M ssZFx+4lovwlW+EA5Vi/O+U46EJ7nhBNsfX1lGjJe6CT6FJo8mkkvlrA7FsXWK+i/P+H +5zPVswS+Pxu0Zy2Na0hu0z+ftyCKB222v0WZ3lMuhSuIZARedDulHLN6spcS003zoIT dP+HlTDJBDHjbXBBi7H3NSPvmgTopGr+lTotGmyMKK89j9STFrnGMnSGRV/u1PGlF7U+ R9sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 101si8773286pld.22.2018.12.05.11.50.59; Wed, 05 Dec 2018 11:51:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728635AbeLETu6 (ORCPT + 31 others); Wed, 5 Dec 2018 14:50:58 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:41021 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbeLETuz (ORCPT ); Wed, 5 Dec 2018 14:50:55 -0500 Received: by mail-ot1-f65.google.com with SMTP id u16so19816688otk.8; Wed, 05 Dec 2018 11:50:54 -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=hpEtuMyejLbcg/OvDvyl/00uB/0Gj9YbrzwIg6g5G5g=; b=MU+Np392YzPLZI/76QyQRbH/S/scbJRk3f/W6Lbti95nLu6JLYdeVwn2MgUFpcyzBH 7ZxiWgvSXZflIzVYPXUrfYOZo+tiBu3psV0nlJRKstPBEY5yZnq6HAsD6tnPVLT8o6Qg 5yY3TNWWAI2tstvhpw0aRydB8FNPmPLA9jc86+LcOsWgsh2OGHxDaWuudgGIAPc+hq65 HJWRPSfKdE1pJeOs3zA78Zj/cewrEk4OacMAvgIs93NV3GzDuEr6rIK1PhzQQQ8yONKj KOsDjvs7CJ/EAQer9AfSHVZo4NM0QPv/G0TJW90nNqFxO5+wNAe8VL97r/Rpm2P9hJw1 s1uA== X-Gm-Message-State: AA+aEWYgkjW1hfk7xpdlRf12FGo9Zovz0DDj2A/HgrVDDO3x4Y7wd2ce UjP4Y2mYzralb439Oa8OPgyFLrk= X-Received: by 2002:a9d:17ca:: with SMTP id j68mr15245129otj.268.1544039454388; Wed, 05 Dec 2018 11:50:54 -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.50.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:50:53 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Greg Kroah-Hartman Subject: [PATCH] char/rtc: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:19 -0600 Message-Id: <20181205195050.4759-3-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. The open coded iterating thru the child node names is converted to use for_each_child_of_node() instead. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Rob Herring --- drivers/char/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 4948c8bda6b1..62b7c721c732 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -866,8 +866,8 @@ static int __init rtc_init(void) #ifdef CONFIG_SPARC32 for_each_node_by_name(ebus_dp, "ebus") { struct device_node *dp; - for (dp = ebus_dp; dp; dp = dp->sibling) { - if (!strcmp(dp->name, "rtc")) { + for_each_child_of_node(ebus_dp, dp) { + if (of_node_name_eq(dp, "rtc")) { op = of_find_device_by_node(dp); if (op) { rtc_port = op->resource[0].start;