Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp61527pxa; Tue, 11 Aug 2020 17:21:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznASVb3CmP13fJiB7dmqZ9ZcQMq3wHsRJ8Q5cz9qQztxMLF7lUj5V9IBH2Zakeigz8x7cF X-Received: by 2002:a17:906:4f8c:: with SMTP id o12mr22515883eju.69.1597191674713; Tue, 11 Aug 2020 17:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597191674; cv=none; d=google.com; s=arc-20160816; b=kOgzTQDpRSn47VEW708jmhLaZ9zdNOX5iBZjo+5w/qjQb8YXufZpHpKT9LmmqJ7egy EMV/SrH7C0dGm7HSqQ0ytygx5MBFieGEJ0lMK30nwOfVq023PsX94sjLoKoL4e7aZKv1 hfml1q0LY80K278jjrOHNd41Nc0ViBedz3Pibd2rTCidYMXz+B/o+ogEROP9bxOzF0qQ eIJI+mYVD3YAaWb0QpXcKIoiv+zXZHJf/yAD6lbfoe0BWK+0PLiiC96wncMIn/0XwBvA FeBplxVS0VPQQUxxiJnS3f1TneivdDxakfAYoW1AkGbklZYW1FxMrHIiKe4d9QMFZ4YW 3zcg== 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 :dkim-signature; bh=rqt0QmQaBfDvBShfDeNyebNZVArGH+T4/867oxMIwgE=; b=h/jmXcAevBMpMvUlYU6uaID3lEGHGZ1PttLhAi9lIeVd5yorNB8GiEjk+nynt0mkmd EwzQ/MWtADl4pdg76rrfru1XBkd7JB6tJNkpgl4KEIRLPGPH5J1JL7UNbVPWXwOUuZTW 7/PoEAi8FyQ/wVhdaxa/tPLtrXyL8qJUqDJf6zjrWiYRX2TNV3unmP3O19JWCQRVKrbP gWeN2MXyr/HUC0VckIhc9wblgE86d/kQYfWaZloo8VVevv31AIhlpcHOZwKp0EvdmcTt ORoaBhvXjQoO4TqiSg3760hEyBTmlOIi56o81pTr3XgZLIfYpO6V7h4A8X4wqZQk/Yac 1fGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=v9zMHpJr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx25si215915edb.149.2020.08.11.17.20.44; Tue, 11 Aug 2020 17:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=v9zMHpJr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726676AbgHLAP5 (ORCPT + 99 others); Tue, 11 Aug 2020 20:15:57 -0400 Received: from crapouillou.net ([89.234.176.41]:52124 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726221AbgHLAP5 (ORCPT ); Tue, 11 Aug 2020 20:15:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597191323; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rqt0QmQaBfDvBShfDeNyebNZVArGH+T4/867oxMIwgE=; b=v9zMHpJrZJb6k59vYKUXrJ8f2nqv49gpAcw3Sw3e8l/Osp9TTzYS9z8l9tU9ozHSQTn8il xQUBq4rxeG0pjT69LLuldQYA7meqHEfbNRSNN7K2q6myFl/HsFMmFA0NgMGo01sMwE1OUm 9hA7A2tYGxl7I0x+SgEyNf8cIh0REmk= From: Paul Cercueil To: Thomas Bogendoerfer Cc: Paul Burton , Krzysztof Kozlowski , =?UTF-8?q?=E5=91=A8=E7=90=B0=E6=9D=B0?= , od@zcrc.me, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Paul Cercueil Subject: [PATCH v2 05/13] MIPS: generic: Allow boards to set system type Date: Wed, 12 Aug 2020 02:15:02 +0200 Message-Id: <20200812001510.460382-6-paul@crapouillou.net> In-Reply-To: <20200812001510.460382-1-paul@crapouillou.net> References: <20200812001510.460382-1-paul@crapouillou.net> 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 Check for the (already existing) "system_type" variable in the get_system_type() function. If non-NULL, return it as the system type. Signed-off-by: Paul Cercueil --- Notes: v2: Instead of adding a .get_system_type callback to the mips_machine struct, the boards now simply override the "system_type" variable when they want to set a custom one. arch/mips/generic/proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/mips/generic/proc.c b/arch/mips/generic/proc.c index 4c992809cc3f..cce2fde219a3 100644 --- a/arch/mips/generic/proc.c +++ b/arch/mips/generic/proc.c @@ -8,11 +8,16 @@ #include +char *system_type; + const char *get_system_type(void) { const char *str; int err; + if (system_type) + return system_type; + err = of_property_read_string(of_root, "model", &str); if (!err) return str; -- 2.28.0