From patchwork Wed Aug 12 00:15:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 11709821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1D2913B1 for ; Wed, 12 Aug 2020 00:15:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9996520782 for ; Wed, 12 Aug 2020 00:15:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=crapouillou.net header.i=@crapouillou.net header.b="v9zMHpJr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726531AbgHLAP5 (ORCPT ); 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?b?5ZGo55Cw5p2w?= , 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 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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;