Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4321853imu; Mon, 14 Jan 2019 20:28:45 -0800 (PST) X-Google-Smtp-Source: ALg8bN6EtKO7SMjJJXURQXU6j6X5+FXL4A2FB99I0SK4C78vtesO+VnNvp9xknQD9JC/FVfWVJNO X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr2133166plb.244.1547526524990; Mon, 14 Jan 2019 20:28:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547526524; cv=none; d=google.com; s=arc-20160816; b=LWbfV1m08V/T/QcYVJYU/iH0YH+QsjHBYmGr02Mz32QQkdIvsDmblvFGkMZzEReAgy C8NcDhRyCbV8kmgwyA1fr9AvffLz8cftKpnTnffx6uofniQL+H1XGg/S/6g4da5Jg0+X DfQlWfXiL3hcze1V3UMS2lCMFJGDleucgIPEvtVxEeAruKvGRIWJ8WFpVJUWA4X44Rs3 gFCpwQ8ftyMwIC1CsoBNovEAx4inVltYKah9qIN+Xzmb3vS72oIfp7Zhr/kigdBSEwav eAnNW14xWLMCR75iMaoJy8U07BeRktDOVGFleGEGhdHfKUm2SuOjpFjeRZ13hUBPE0Dx tEVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=Zp/5UP0qKnvAeLPCr8l2WUd5vhwWHdV/nYXT9XksZkM=; b=CzKaXQ/aLpvN/nEX4HzAlDEBQh6ES4e5FvmAh6uLb7S21MVUX7nCfDQfLVKTM8RbQt jaiB5B9knb+wb0I4nByMU7tgujaTTbUbdGUgDst6xD2Ju8TwMZ+V6dirp+F+vdieRlng rEZJnv++uKI6l6yN77bBrFy2G5DKrD5SaW0iAkjb6RYIgCkWbDtAJtV2GwFqiVvJE96i 3YkXDT659ep4XokjIPKN2UCkkylC1AgfmT4jKs3cp95KUy52vF2C4r/6mb1NV+jTQVAi EOoIaqiAuicpAenfXEkrMolqa/mgx43Ky886kNrnIN7uqBJWcoisaJXh8g0YbpGWHbkY OkzQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si2265893pfk.287.2019.01.14.20.28.29; Mon, 14 Jan 2019 20:28:44 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728418AbfAOEXx (ORCPT + 99 others); Mon, 14 Jan 2019 23:23:53 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:37464 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbfAOEW0 (ORCPT ); Mon, 14 Jan 2019 23:22:26 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 1CDF629E68; Mon, 14 Jan 2019 23:22:24 -0500 (EST) To: Arnd Bergmann , Greg Kroah-Hartman , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Bartlomiej Zolnierkiewicz Cc: linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linuxppc-dev@lists.ozlabs.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Message-Id: <0792e10d71abdf3152b74bddbb9da68c1f17e48c.1547525936.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v9 06/22] powerpc: Replace nvram_* extern declarations with standard header Date: Tue, 15 Jan 2019 15:18:56 +1100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the nvram_read_byte() and nvram_write_byte() declarations in powerpc/include/asm/nvram.h and use the cross-platform static functions in linux/nvram.h instead. Tested-by: Stan Johnson Signed-off-by: Finn Thain --- Changed since v8: - Added nvram_read_byte() and nvram_write_byte() functions to avoid a potential build failure during 'git bisect'. - Brought forward some powerpc cleanup to avoid naming collisions with nvram.h functions. - Replaced the ppc_md.nvram_* method wrappers with the ones in nvram.h. --- arch/powerpc/include/asm/nvram.h | 6 ------ arch/powerpc/kernel/setup_32.c | 25 +--------------------- drivers/char/generic_nvram.c | 1 + drivers/video/fbdev/matrox/matroxfb_base.c | 2 +- include/linux/nvram.h | 3 +++ 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/include/asm/nvram.h b/arch/powerpc/include/asm/nvram.h index 09a518bb7c03..56a388da9c4f 100644 --- a/arch/powerpc/include/asm/nvram.h +++ b/arch/powerpc/include/asm/nvram.h @@ -98,10 +98,4 @@ extern int nvram_write_os_partition(struct nvram_os_partition *part, unsigned int err_type, unsigned int error_log_cnt); -/* Determine NVRAM size */ -extern ssize_t nvram_get_size(void); - -/* Normal access to NVRAM */ -extern unsigned char nvram_read_byte(int i); -extern void nvram_write_byte(unsigned char c, int i); #endif /* _ASM_POWERPC_NVRAM_H */ diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 947f904688b0..f5107796e2d7 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -149,30 +150,6 @@ __setup("l3cr=", ppc_setup_l3cr); #ifdef CONFIG_GENERIC_NVRAM -/* Generic nvram hooks used by drivers/char/gen_nvram.c */ -unsigned char nvram_read_byte(int addr) -{ - if (ppc_md.nvram_read_val) - return ppc_md.nvram_read_val(addr); - return 0xff; -} -EXPORT_SYMBOL(nvram_read_byte); - -void nvram_write_byte(unsigned char val, int addr) -{ - if (ppc_md.nvram_write_val) - ppc_md.nvram_write_val(addr, val); -} -EXPORT_SYMBOL(nvram_write_byte); - -ssize_t nvram_get_size(void) -{ - if (ppc_md.nvram_size) - return ppc_md.nvram_size(); - return -1; -} -EXPORT_SYMBOL(nvram_get_size); - void nvram_sync(void) { if (ppc_md.nvram_sync) diff --git a/drivers/char/generic_nvram.c b/drivers/char/generic_nvram.c index ff5394f47587..0c22b9503e84 100644 --- a/drivers/char/generic_nvram.c +++ b/drivers/char/generic_nvram.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index 838869c6490c..0a4e5bad33f4 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -111,12 +111,12 @@ #include "matroxfb_g450.h" #include #include +#include #include #include #ifdef CONFIG_PPC_PMAC #include -unsigned char nvram_read_byte(int); static int default_vmode = VMODE_NVRAM; static int default_cmode = CMODE_NVRAM; #endif diff --git a/include/linux/nvram.h b/include/linux/nvram.h index a1e01dc89759..79431dab87a1 100644 --- a/include/linux/nvram.h +++ b/include/linux/nvram.h @@ -15,8 +15,11 @@ extern const struct nvram_ops arch_nvram_ops; static inline ssize_t nvram_get_size(void) { +#ifdef CONFIG_PPC +#else if (arch_nvram_ops.get_size) return arch_nvram_ops.get_size(); +#endif return -ENODEV; } -- 2.19.2