From patchwork Fri Nov 16 22:10:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 151381 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp958138ljp; Fri, 16 Nov 2018 14:11:13 -0800 (PST) X-Google-Smtp-Source: AJdET5cCckjkdL9jf5Zfhf8og0VjgbpJAwue3LqCOgtyjQQRo1Ju9o/Hwi0mrBoChJl2IprEQxrx X-Received: by 2002:a63:ec4b:: with SMTP id r11mr11264528pgj.44.1542406273756; Fri, 16 Nov 2018 14:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542406273; cv=none; d=google.com; s=arc-20160816; b=S8pJdxa7pL1elamsd4OMXD+dxhzs1FwiPzB+KLnpoDQZdhLEIyOtguZ/MylNAaSDuL MhsVYiuPQrsoKMd3AaIebG3RAgN45cF1D86OMFWBct1O6+pEpwQVa1BYfn+rOx3K5giF RDDafqvA2FyxemgYTtzdWZQkeDk35bxvP3PqIGFaYRukBT9sKPIOfhAWWeHy2rv/gTZO rOiU8eCEefuMSbCXcvJWgfrq4IPF1xtH5+TI4mQsGf+3+yIADYgydrBM7hA2ATexkkbr GDboFObtRc1s1HtvO0JM0ro4mt8O/2Sg9RoIEhkleLvqVb3/qKWfnf2dXZiUxgvfdq4o Z0dg== 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=dm96ml3cZNVLC3eH890iFCugyIdMvaya0M2JyB3z1mo=; b=to2pOjyfZi54sSh6Fwpdl0eCr92k1mz0qgN6DURptEfREMEMmkFvh2FO+j29xUalNO K3TKKVWzIEnZFgDvjh6ZJ32P3gGw7s+OYseXzUdoavF8XvnNCCCiKf/+XbiK2+AdZnMi cpt4f/i8QBW2Wz2VqnIP4dPjxIhoqRFTc3JE6QUDqMMUAXM238J1H+OzdoUjgPb7En27 lsXAHslFz9La3HvxKdb+ePukGbMma8rZbs0VxqxvIAQ0T5y5Q0/mXeEh9FzPyg+iKPAH ubjD1Us3ZOCgrbDmoFT/X+Hf7wEb10Ai5c/UdfjmZ32fmupD4R1L+mpkC2Cxtc+aD+nD CBEw== 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 88-v6si33351999plb.57.2018.11.16.14.11.13; Fri, 16 Nov 2018 14:11:13 -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 S1729781AbeKQIZV (ORCPT + 32 others); Sat, 17 Nov 2018 03:25:21 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:36803 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeKQIZU (ORCPT ); Sat, 17 Nov 2018 03:25:20 -0500 Received: by mail-ot1-f66.google.com with SMTP id k98so22736842otk.3; Fri, 16 Nov 2018 14:11:10 -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=dm96ml3cZNVLC3eH890iFCugyIdMvaya0M2JyB3z1mo=; b=Lm405YJIthW+XPQ4HpRVW6Xq0JwvCzF3IppLeUHg504qc++u1c//QqW/6rpKE5N6oo X0KSU79Rya2BH2zgfULtr9wYh+pss5x1WrY4O3nfUqcBLLqRAW2t6xUMswMXYhzF2+IJ zvhp02earaz6R201TIUhPZBqXR650Tkhqfewj7a4y42IyHnD9sUvBy4F5UOwnxvvgY5q tTJJ5efce1R6Ir5p64AuGro9LPrlwPzz0iONtlmeClfQHMzLPbk36qL44nN/IFeoT9bg gR4+mU7z96MdtMUpq/uXv5vGR98VkO/qP9Lcu7J7qp8vPQoiY3tn9qgMcemGzVG0zcVC pg9w== X-Gm-Message-State: AGRZ1gLY1OOjnYT2b7MbEqJVC+7l0IV68Nq3x0EmwKyG8Cpn3uDcxVVK YxutkdplrjAfIUbQVdOqug== X-Received: by 2002:a9d:2c94:: with SMTP id p20mr7089642otb.92.1542406269333; Fri, 16 Nov 2018 14:11:09 -0800 (PST) Received: from localhost.localdomain (mobile-166-173-57-127.mycingular.net. [166.173.57.127]) by smtp.googlemail.com with ESMTPSA id p204-v6sm12142631oib.25.2018.11.16.14.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 14:11:08 -0800 (PST) From: Rob Herring To: Michael Ellerman Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: Rework btext_find_display to use of_stdout and device_type helpers Date: Fri, 16 Nov 2018 16:10:59 -0600 Message-Id: <20181116221104.23024-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 Remove directly accessing device_node.type pointer and use the accessors instead. This will eventually allow removing the type pointer. In the process, the of_stdout pointer can be used instead of finding the stdout node again. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- arch/powerpc/kernel/btext.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) -- 2.19.1 diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c index b4241ed1456e..488b0875ed66 100644 --- a/arch/powerpc/kernel/btext.c +++ b/arch/powerpc/kernel/btext.c @@ -232,20 +232,12 @@ static int btext_initialize(struct device_node *np) int __init btext_find_display(int allow_nonstdout) { - const char *name; - struct device_node *np = NULL; + struct device_node *np = of_stdout; int rc = -ENODEV; - name = of_get_property(of_chosen, "linux,stdout-path", NULL); - if (name != NULL) { - np = of_find_node_by_path(name); - if (np != NULL) { - if (strcmp(np->type, "display") != 0) { - printk("boot stdout isn't a display !\n"); - of_node_put(np); - np = NULL; - } - } + if (!of_node_is_type(np, "display")) { + printk("boot stdout isn't a display !\n"); + np = NULL; } if (np) rc = btext_initialize(np);