From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Wed, 12 Nov 2014 22:16:37 +0100 (CET) Received: from hauke-m.de ([5.39.93.123]:50351 "EHLO hauke-m.de" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S27013413AbaKLVQeBT3GK (ORCPT ); Wed, 12 Nov 2014 22:16:34 +0100 Received: from [IPv6:2001:470:7259:0:855b:83cf:788:3e2] (unknown [IPv6:2001:470:7259:0:855b:83cf:788:3e2]) by hauke-m.de (Postfix) with ESMTPSA id 9263120025; Wed, 12 Nov 2014 22:16:33 +0100 (CET) Message-ID: <5463CE30.2080405@hauke-m.de> Date: Wed, 12 Nov 2014 22:16:32 +0100 From: Hauke Mehrtens User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , linux-mips@linux-mips.org, Ralf Baechle CC: Arnd Bergmann , Greg Kroah-Hartman Subject: Re: [PATCH] MIPS: BCM47XX: Move NVRAM driver to the drivers/misc/ References: <1415735146-31552-1-git-send-email-zajec5@gmail.com> In-Reply-To: <1415735146-31552-1-git-send-email-zajec5@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 44087 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: hauke@hauke-m.de Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips On 11/11/2014 08:45 PM, Rafał Miłecki wrote: > After Broadcom switched from MIPS to ARM for their home routers we need > to have NVRAM driver in some common place (not arch/mips/). > We were thinking about putting it in bus directory, however there are > two possible buses for MIPS: drivers/ssb/ and drivers/bcma/. So this > won't fit there neither. > This is why I would like to move this driver to the drivers/misc/ I will do a more detailed review when you send a patch with -M > Signed-off-by: Rafał Miłecki > --- > arch/mips/Kconfig | 1 + > arch/mips/bcm47xx/Makefile | 2 +- > arch/mips/bcm47xx/board.c | 2 +- > arch/mips/bcm47xx/nvram.c | 228 -------------------- > arch/mips/bcm47xx/setup.c | 1 - > arch/mips/bcm47xx/sprom.c | 1 - > arch/mips/bcm47xx/time.c | 1 - > arch/mips/include/asm/mach-bcm47xx/bcm47xx.h | 1 + > arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h | 21 -- > drivers/bcma/driver_mips.c | 2 +- > drivers/misc/Kconfig | 9 + > drivers/misc/Makefile | 1 + > drivers/misc/bcm47xx_nvram.c | 230 +++++++++++++++++++++ > drivers/net/ethernet/broadcom/b44.c | 2 +- > drivers/net/ethernet/broadcom/bgmac.c | 2 +- > drivers/ssb/driver_chipcommon_pmu.c | 2 +- > drivers/ssb/driver_mipscore.c | 2 +- > include/linux/bcm47xx_nvram.h | 18 ++ > 18 files changed, 267 insertions(+), 259 deletions(-) > delete mode 100644 arch/mips/bcm47xx/nvram.c > delete mode 100644 arch/mips/include/asm/mach-bcm47xx/bcm47xx_nvram.h > create mode 100644 drivers/misc/bcm47xx_nvram.c > create mode 100644 include/linux/bcm47xx_nvram.h .... > diff --git a/include/linux/bcm47xx_nvram.h b/include/linux/bcm47xx_nvram.h > new file mode 100644 > index 0000000..5ed6917 > --- /dev/null > +++ b/include/linux/bcm47xx_nvram.h > @@ -0,0 +1,18 @@ > +/* > + * This program is free software; you can redistribute it and/or modify it > + * under the terms of the GNU General Public License as published by the > + * Free Software Foundation; either version 2 of the License, or (at your > + * option) any later version. > + */ > + > +#ifndef __BCM47XX_NVRAM_H > +#define __BCM47XX_NVRAM_H > + > +#include > +#include > + > +int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); > +int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); > +int bcm47xx_nvram_gpio_pin(const char *name); Could you change this to something like this: #ifdef CONFIG_BCM47XX_NVRAM int bcm47xx_nvram_init_from_mem(u32 base, u32 lim); int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len); int bcm47xx_nvram_gpio_pin(const char *name); #else static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim) {return -1;}; static inline int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len) {return -1;}; static inline int bcm47xx_nvram_gpio_pin(const char *name) {return -1;}; #endif and use something better than -1. This way we can get rid of these all other the code. #ifdef CONFIG_BCM47XX .. #endif If this is planed in the next patch I would be fine with that. > + > +#endif /* __BCM47XX_NVRAM_H */ >