Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3173655imu; Fri, 18 Jan 2019 06:07:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ghD1NP6YCQ3VkmB+P32HxafLxzre5iXI9EAKjkexeFEQ493ESPfBnCKayT+m45fSy79G9 X-Received: by 2002:a17:902:96a:: with SMTP id 97mr18781755plm.45.1547820457828; Fri, 18 Jan 2019 06:07:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547820457; cv=none; d=google.com; s=arc-20160816; b=rF28nU+e9GBCrCk8cBEnkz/L//Pc+YAdSyLDByQ0jSbuVr2NhL6J5XgLyXKsi7u0np 08Sq0Gtw6Cm8xR1kaR2iv+a+lFTm8uZrCSudUyUSwjb+zWPN2Nabf+E3h2C3jn5plO0p rk1dSwJyg5LQh8At+Yfd261dZxzI8D+zEqAzLnSjJeSin/Xm9Aah4EONxTvFYp5MyCaa ps5uiD9n9eirJyr88I/8IycnFkQOT5Tj24gp/XlBlJB6UzliI1WBNUjjePPZAU9InJ+B gBPdWk0xKm5zUeRMGWNwXns30n/hyuFuUtSCJ0QLz4DYLLfPOYCyMTreIyo1vV/nWinO EoIg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cftGcUhp2hIXsQQzx8A/AHnCjsMjkAUMb50zkj+yZSs=; b=L5S6EwRS54uiM9q5KrySorEZqWM4TO/0qYisO2KGbGLEMUwSzwJPVNoLw9TDisJRK7 D9X340YL4hxmu7mRfT80rlumRrvb7sFIjnG0wNvz6nenjQXHeavsldjgYS+NTDI5y9Ls U2CXWMc60zbzRT7dj6OF3ZimYAyxELmo8x+aigWNrOiZ1rOLCG3BjFtY6uhMfE1xXKen ZmCyQesHb+CxT0g8cwng8v+SRbTJfg7SOYpioPAfXj/9pP4FClizwuWgjRORkuAWgtxj wPfxXxucDaMvv4oiBVSxjVSQZZITXqwfCfpDOdB2pQAbwNTfKFlB0alP4Ft54xVjCaRx dezA== 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 a17si4573604pfn.213.2019.01.18.06.07.14; Fri, 18 Jan 2019 06:07:37 -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 S1727879AbfAROFA (ORCPT + 99 others); Fri, 18 Jan 2019 09:05:00 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40695 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727760AbfAROEk (ORCPT ); Fri, 18 Jan 2019 09:04:40 -0500 Received: by mail-lj1-f194.google.com with SMTP id n18-v6so11727170lji.7 for ; Fri, 18 Jan 2019 06:04:38 -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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cftGcUhp2hIXsQQzx8A/AHnCjsMjkAUMb50zkj+yZSs=; b=jJk6cESLiQAGVNNa4JtLeY/LcH1rUpmGyGKsVYA7qYWznSn564SDU0oVaT1IgZ4riq QNC+Ip5ArsrL+wW1ybGzpzcbQdwnZk+kv0yXw5Pga/JBnjB/m+xb8Muat9kYvr4wm3Rl aSmG4dW84FjfUvUdvTsRiOh/SX00l0IMbcCKaqPaKycXbIQVpQqRofAUeqZ4ianhIbIS fZGJMt/jYXvXD/HsUw+Q3SNgHDhPdWdmOPdiaaOiMNjuRF8kgfv10uuW5eOSf2xG2j/J 6mukmhvUG+eJBeE6Wdhrmn7GndtjwJolcdw4NNcvoqjghXXwo1x0Z+zCA9sDMYnsJ4Ls hmGQ== X-Gm-Message-State: AJcUukeHQOCov4hE73u3SeuiB2sEMI8XHt76lYyIE/fWMuzhcNAVKDhn IG/41Fco3ggvSDsDaP+Ct3Y= X-Received: by 2002:a2e:6595:: with SMTP id e21-v6mr13144023ljf.123.1547820277864; Fri, 18 Jan 2019 06:04:37 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id x21sm809550lfe.6.2019.01.18.06.04.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jan 2019 06:04:35 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1gkUlB-0002W5-Dv; Fri, 18 Jan 2019 15:04:37 +0100 From: Johan Hovold To: Palmer Dabbelt Cc: Albert Ou , Andreas Schwab , Atish Patra , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 4/5] riscv: treat cpu devicetree nodes without status as enabled Date: Fri, 18 Jan 2019 15:03:07 +0100 Message-Id: <20190118140308.9599-5-johan@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190118140308.9599-1-johan@kernel.org> References: <20190118140308.9599-1-johan@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Follow the Linux convention and treat devicetree nodes without a status property as enabled rather than disabled, while also allowing "ok" as a shorthand for "okay". Signed-off-by: Johan Hovold --- arch/riscv/kernel/cpu.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/riscv/kernel/cpu.c b/arch/riscv/kernel/cpu.c index 974d374fd36b..d1d9bfd5a89f 100644 --- a/arch/riscv/kernel/cpu.c +++ b/arch/riscv/kernel/cpu.c @@ -22,7 +22,7 @@ */ int riscv_of_processor_hartid(struct device_node *node) { - const char *isa, *status; + const char *isa; u32 hart; if (!of_device_is_compatible(node, "riscv")) { @@ -39,12 +39,8 @@ int riscv_of_processor_hartid(struct device_node *node) return -ENODEV; } - if (of_property_read_string(node, "status", &status)) { - pr_warn("CPU with hartid=%d has no \"status\" property\n", hart); - return -ENODEV; - } - if (strcmp(status, "okay")) { - pr_info("CPU with hartid=%d has a non-okay status of \"%s\"\n", hart, status); + if (!of_device_is_available(node)) { + pr_info("CPU with hartid=%d is not available\n", hart); return -ENODEV; } -- 2.20.1