diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-12-10 19:56:56 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2014-12-10 19:56:56 +0000 |
commit | b0b43e1ef963e7b4f87bd8942fec30def9731a17 (patch) | |
tree | 891aa8cd2f0a373024275bb39b774a1dcc5aeb2b /target/linux/bcm53xx/files/drivers | |
parent | a1da38f7b16914bd0ccfabcc4f15bb4ca6799abf (diff) | |
download | upstream-b0b43e1ef963e7b4f87bd8942fec30def9731a17.tar.gz upstream-b0b43e1ef963e7b4f87bd8942fec30def9731a17.tar.bz2 upstream-b0b43e1ef963e7b4f87bd8942fec30def9731a17.zip |
bcm53xx: use static NVRAM pointer for now
This will allow us to sync with code sent for upstream.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
SVN-Revision: 43608
Diffstat (limited to 'target/linux/bcm53xx/files/drivers')
-rw-r--r-- | target/linux/bcm53xx/files/drivers/misc/bcm47xx-nvram.c | 21 | ||||
-rw-r--r-- | target/linux/bcm53xx/files/drivers/misc/bcm47xx-sprom.c | 4 |
2 files changed, 6 insertions, 19 deletions
diff --git a/target/linux/bcm53xx/files/drivers/misc/bcm47xx-nvram.c b/target/linux/bcm53xx/files/drivers/misc/bcm47xx-nvram.c index 55374799c0..d1f9d7c6ae 100644 --- a/target/linux/bcm53xx/files/drivers/misc/bcm47xx-nvram.c +++ b/target/linux/bcm53xx/files/drivers/misc/bcm47xx-nvram.c @@ -39,6 +39,8 @@ struct bcm47xx_nvram { char *nvram_buf; }; +static struct bcm47xx_nvram *nvram = NULL; + static const u32 nvram_sizes[] = {0x8000, 0xF000, 0x10000}; static u32 find_nvram_size(void __iomem *end) @@ -117,16 +119,9 @@ found: return 0; } -int bcm47xx_nvram_getenv(const struct device *dev, const char *name, char *val, - size_t val_len) +int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len) { char *var, *value, *end, *eq; - struct bcm47xx_nvram *nvram; - - if (!dev) - return -ENODEV; - - nvram = dev_get_drvdata(dev); if (!name || !nvram || !nvram->nvram_len) return -EINVAL; @@ -149,20 +144,17 @@ int bcm47xx_nvram_getenv(const struct device *dev, const char *name, char *val, } EXPORT_SYMBOL(bcm47xx_nvram_getenv); -int bcm47xx_nvram_gpio_pin(const struct device *dev, const char *name) +int bcm47xx_nvram_gpio_pin(const char *name) { int i, err; char nvram_var[10]; char buf[30]; - if (!dev) - return -ENODEV; - for (i = 0; i < 32; i++) { err = snprintf(nvram_var, sizeof(nvram_var), "gpio%i", i); if (err <= 0) continue; - err = bcm47xx_nvram_getenv(dev, nvram_var, buf, sizeof(buf)); + err = bcm47xx_nvram_getenv(nvram_var, buf, sizeof(buf)); if (err <= 0) continue; if (!strcmp(name, buf)) @@ -176,7 +168,6 @@ static int bcm47xx_nvram_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - struct bcm47xx_nvram *nvram; int err; struct resource flash_mem; void __iomem *mmio; @@ -199,8 +190,6 @@ static int bcm47xx_nvram_probe(struct platform_device *pdev) if (err) goto err_unmap_mmio; - platform_set_drvdata(pdev, nvram); - err_unmap_mmio: iounmap(mmio); return err; diff --git a/target/linux/bcm53xx/files/drivers/misc/bcm47xx-sprom.c b/target/linux/bcm53xx/files/drivers/misc/bcm47xx-sprom.c index 4e56208b8a..e36abc8a45 100644 --- a/target/linux/bcm53xx/files/drivers/misc/bcm47xx-sprom.c +++ b/target/linux/bcm53xx/files/drivers/misc/bcm47xx-sprom.c @@ -637,9 +637,7 @@ static void bcm47xx_sprom_fill(struct ssb_sprom *sprom, static int bcm47xx_sprom_getenv(const struct bcm47xx_sprom_fill *fill, const char *name, char *val, size_t val_len) { - const struct platform_device *nvram_dev = fill->priv; - - return bcm47xx_nvram_getenv(&nvram_dev->dev, name, val, val_len); + return bcm47xx_nvram_getenv(name, val, val_len); }; static int bcm47xx_sprom_probe(struct platform_device *pdev) |