diff options
author | Marc Dietrich <marvin24@gmx.de> | 2013-06-21 10:28:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-24 15:59:03 -0700 |
commit | 2c6cbdd0ef966cdf5e93ea17475a577dacf44dd7 (patch) | |
tree | 6560cc9b718638671669ba2c05607d7588d24f51 | |
parent | 2b8d5e5b39a251b99a42cac8eccb268190ff3baf (diff) | |
download | linux-stable-2c6cbdd0ef966cdf5e93ea17475a577dacf44dd7.tar.gz linux-stable-2c6cbdd0ef966cdf5e93ea17475a577dacf44dd7.tar.bz2 linux-stable-2c6cbdd0ef966cdf5e93ea17475a577dacf44dd7.zip |
staging: nvec: remove instantiating via platform device
Tegra has been converted to support device tree only. Remove support
for instantiating via platform device.
Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/nvec/nvec.c | 33 | ||||
-rw-r--r-- | drivers/staging/nvec/nvec.h | 25 |
2 files changed, 14 insertions, 44 deletions
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 197c393c4ca7..8e935a4aafe2 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -33,7 +33,6 @@ #include <linux/mfd/core.h> #include <linux/mutex.h> #include <linux/notifier.h> -#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/workqueue.h> @@ -776,7 +775,6 @@ static int tegra_nvec_probe(struct platform_device *pdev) { int err, ret; struct clk *i2c_clk; - struct nvec_platform_data *pdata = pdev->dev.platform_data; struct nvec_chip *nvec; struct nvec_msg *msg; struct resource *res; @@ -785,6 +783,11 @@ static int tegra_nvec_probe(struct platform_device *pdev) unmute_speakers[] = { NVEC_OEM0, 0x10, 0x59, 0x95 }, enable_event[7] = { NVEC_SYS, CNF_EVENT_REPORTING, true }; + if(!pdev->dev.of_node) { + dev_err(&pdev->dev, "must be instantiated using device tree\n"); + return -ENODEV; + } + nvec = devm_kzalloc(&pdev->dev, sizeof(struct nvec_chip), GFP_KERNEL); if (nvec == NULL) { dev_err(&pdev->dev, "failed to reserve memory\n"); @@ -793,23 +796,15 @@ static int tegra_nvec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, nvec); nvec->dev = &pdev->dev; - if (pdata) { - nvec->gpio = pdata->gpio; - nvec->i2c_addr = pdata->i2c_addr; - } else if (nvec->dev->of_node) { - nvec->gpio = of_get_named_gpio(nvec->dev->of_node, - "request-gpios", 0); - if (nvec->gpio < 0) { - dev_err(&pdev->dev, "no gpio specified"); - return -ENODEV; - } - if (of_property_read_u32(nvec->dev->of_node, - "slave-addr", &nvec->i2c_addr)) { - dev_err(&pdev->dev, "no i2c address specified"); - return -ENODEV; - } - } else { - dev_err(&pdev->dev, "no platform data\n"); + nvec->gpio = of_get_named_gpio(nvec->dev->of_node, "request-gpios", 0); + if (nvec->gpio < 0) { + dev_err(&pdev->dev, "no gpio specified"); + return -ENODEV; + } + + if (of_property_read_u32(nvec->dev->of_node, "slave-addr", + &nvec->i2c_addr)) { + dev_err(&pdev->dev, "no i2c address specified"); return -ENODEV; } diff --git a/drivers/staging/nvec/nvec.h b/drivers/staging/nvec/nvec.h index 2b1316d87470..e880518935fb 100644 --- a/drivers/staging/nvec/nvec.h +++ b/drivers/staging/nvec/nvec.h @@ -103,31 +103,6 @@ struct nvec_msg { }; /** - * struct nvec_subdev - A subdevice of nvec, such as nvec_kbd - * @name: The name of the sub device - * @platform_data: Platform data - * @id: Identifier of the sub device - */ -struct nvec_subdev { - const char *name; - void *platform_data; - int id; -}; - -/** - * struct nvec_platform_data - platform data for a tegra slave controller - * @i2c_addr: number of i2c slave adapter the ec is connected to - * @gpio: gpio number for the ec request line - * - * Platform data, to be used in board definitions. For an example, take a - * look at the paz00 board in arch/arm/mach-tegra/board-paz00.c - */ -struct nvec_platform_data { - int i2c_addr; - int gpio; -}; - -/** * struct nvec_chip - A single connection to an NVIDIA Embedded controller * @dev: The device * @gpio: The same as for &struct nvec_platform_data |