From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84B81C433E0 for ; Tue, 11 Aug 2020 12:43:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B13E2076B for ; Tue, 11 Aug 2020 12:43:24 +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="yiJaFQqU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728549AbgHKMnX (ORCPT ); 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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