Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp386076pxa; Tue, 11 Aug 2020 05:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCyes3aw+tU7hHnshctx+YUM4hxF0FprvIGCxDUKC9vSJ60gGx/Buzg0zSHHusLrtwjl7s X-Received: by 2002:a50:e803:: with SMTP id e3mr25009092edn.75.1597149898642; Tue, 11 Aug 2020 05:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597149898; cv=none; d=google.com; s=arc-20160816; b=laV588YyfGbfDEug8ctpOlbkqVMymXx4NzZPezY28DFq+rUT/dLHKDumyKaor7HUZ/ 7KZ4kDOb62VgKWVXwsA4Sz/YbeDvtwP1cXV/8Z1txBKT67NbIIGvuwAa6U8KgYGYkdsj Q3MbRF+/lk/+qlOPotSNB7+R8PDQdxeMeO4TX1fw/DxF9BiuMsxirQp6qsrBkHhNxyV8 kEa+Ob7AL31ujiYOe22b+z5xeLPQeqco2ToLLwMZegDYILPgBosAgX1EtM67H65iUNoo JwKU9TXHN6cXO1hSKVFlKuYBMDVpR++kuyNMOHlo+eSiIkH3ycaYA9eZyhNz8QTgmG2k 8D1w== 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:cc:to:subject:from:date :dkim-signature; bh=UoMzuNHLpMyb1+tD82j6gU5EX07Smv4Upec9Fe1sZFs=; b=uY8KWPoh+oMwo13qkQ9nj3yifMqsTZhqj8FAbKbd/TJ9vXx0E+asCumHPCSccFpwmW qsbLmkJTijzJ8VC3TzXs2DNnOor38vCU6brn9HurlZ/b97UjyB1qUY14xZxZwL7b6a2B 7phGE71ZGY4xCquRukS5+1PyBnzwRxVqmmyVuN8DRYSIIbiVwflIG2fANeCXGaFhkxK+ 6bhiqkxE3ZJYR89CIPOIxbyMJiOMGSQCLI8jsCZEB5VmTH34kX8ktEuDfyXnuL4nOv5C JyHdZY63VHS2P9UdPqnnOawyqcyRrnSh9nv+CY/6norz72XNnDmznv6DI9B4Q6QMqNXz HX4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=yiJaFQqU; 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 c3si12067482edl.567.2020.08.11.05.44.35; Tue, 11 Aug 2020 05:44:58 -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=yiJaFQqU; 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 S1728638AbgHKMnX (ORCPT + 99 others); Tue, 11 Aug 2020 08:43:23 -0400 Received: from crapouillou.net ([89.234.176.41]:34682 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbgHKMnX (ORCPT ); Tue, 11 Aug 2020 08:43:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1597149800; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UoMzuNHLpMyb1+tD82j6gU5EX07Smv4Upec9Fe1sZFs=; b=yiJaFQqUyuBXx4xoZbPe55o0lB0pePTCFmKY5H8WBawqqfcwfgk7kE1wH6XSjY2KfIjC+D HVs1UVB/8Bie3A5PGbLy0zURsBndkRRmarKO34mDOQBEmNQveYXG5ZV/zgyffEDhyJNGNw gAUcBrx+zz9pItOBKhriZV+b/X8Bbgs= Date: Tue, 11 Aug 2020 14:43:10 +0200 From: Paul Cercueil Subject: Re: [PATCH 06/13] MIPS: generic: Call the machine's .get_system_type callback if provided 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 Message-Id: In-Reply-To: <20200803170124.231110-7-paul@crapouillou.net> References: <20200803170124.231110-1-paul@crapouillou.net> <20200803170124.231110-7-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le lun. 3 ao=FBt 2020 =E0 19:01, Paul Cercueil a=20 =E9crit : > Call the machine's .get_system_type callback in the global > get_system_type() function, if it was provided by the mips_machine > implementation. >=20 > The get_system_type() function had to be moved within init.c to be=20 > able > to use the static variable "mach". Therefore the proc.c, now empty,=20 > has > been removed. >=20 > Signed-off-by: Paul Cercueil > --- > arch/mips/generic/Makefile | 1 - > arch/mips/generic/init.c | 19 +++++++++++++++++++ > arch/mips/generic/proc.c | 25 ------------------------- > 3 files changed, 19 insertions(+), 26 deletions(-) > delete mode 100644 arch/mips/generic/proc.c >=20 > diff --git a/arch/mips/generic/Makefile b/arch/mips/generic/Makefile > index 2384a6b09e4c..f49aeede93c2 100644 > --- a/arch/mips/generic/Makefile > +++ b/arch/mips/generic/Makefile > @@ -6,7 +6,6 @@ >=20 > obj-y +=3D init.o > obj-y +=3D irq.o > -obj-y +=3D proc.o >=20 > obj-$(CONFIG_YAMON_DT_SHIM) +=3D yamon-dt.o > obj-$(CONFIG_LEGACY_BOARD_SEAD3) +=3D board-sead3.o > diff --git a/arch/mips/generic/init.c b/arch/mips/generic/init.c > index 805d0135a9f4..7d82b436939e 100644 > --- a/arch/mips/generic/init.c > +++ b/arch/mips/generic/init.c > @@ -207,3 +207,22 @@ void __init arch_init_irq(void) > void __init prom_free_prom_memory(void) > { > } > + > +const char *get_system_type(void) > +{ > + const char *str; > + int err; > + > + if (mach && mach->get_system_type) > + return mach->get_system_type(of_root); The 'mach' variable is __initconst, so there's a section violation=20 right here. I'll send a V2. -Paul > + > + err =3D of_property_read_string(of_root, "model", &str); > + if (!err) > + return str; > + > + err =3D of_property_read_string_index(of_root, "compatible", 0, &str); > + if (!err) > + return str; > + > + return "Unknown"; > +} > diff --git a/arch/mips/generic/proc.c b/arch/mips/generic/proc.c > deleted file mode 100644 > index 4c992809cc3f..000000000000 > --- a/arch/mips/generic/proc.c > +++ /dev/null > @@ -1,25 +0,0 @@ > -// SPDX-License-Identifier: GPL-2.0-or-later > -/* > - * Copyright (C) 2016 Imagination Technologies > - * Author: Paul Burton > - */ > - > -#include > - > -#include > - > -const char *get_system_type(void) > -{ > - const char *str; > - int err; > - > - err =3D of_property_read_string(of_root, "model", &str); > - if (!err) > - return str; > - > - err =3D of_property_read_string_index(of_root, "compatible", 0, &str); > - if (!err) > - return str; > - > - return "Unknown"; > -} > -- > 2.27.0 >=20