* [PATCH 01/61] gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:32 ` Andrew Lunn
2016-02-22 14:07 ` [PATCH 02/61] gpio: Add resource management devm_gpio_chip_{add_data,remove} Laxman Dewangan
` (60 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Add device managed APIs devm_gpiochip_add_data() and
devm_gpiochip_remove() for the APIs gpiochip_add_data()
and gpiochip_remove().
This helps in reducing code in error path and sometimes
removal of .remove callback for driver unbind.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpiolib.c | 74 +++++++++++++++++++++++++++++++++++++++++++++
include/linux/gpio/driver.h | 4 +++
2 files changed, 78 insertions(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 5c1ba87..d9a40bc 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -462,6 +462,80 @@ void gpiochip_remove(struct gpio_chip *chip)
}
EXPORT_SYMBOL_GPL(gpiochip_remove);
+static void devm_gpio_chip_release(struct device *dev, void *res)
+{
+ struct gpio_chip *chip = *(struct gpio_chip **)res;
+
+ gpiochip_remove(chip);
+}
+
+static int devm_gpio_chip_match(struct device *dev, void *res, void *data)
+
+{
+ struct gpio_chip **r = res;
+
+ if (!r || !*r) {
+ WARN_ON(!r || !*r);
+ return 0;
+ }
+
+ return *r == data;
+}
+
+/**
+ * devm_gpiochip_add_data() - Resource manager piochip_add_data()
+ * @dev: the device pointer on which irq_chip belongs to.
+ * @chip: the chip to register, with chip->base initialized
+ * Context: potentially before irqs will work
+ *
+ * Returns a negative errno if the chip can't be registered, such as
+ * because the chip->base is invalid or already associated with a
+ * different chip. Otherwise it returns zero as a success code.
+ *
+ * The gpio chip automatically be released when the device is unbound.
+ */
+int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
+ void *data)
+{
+ struct gpio_chip **ptr;
+ int ret;
+
+ ptr = devres_alloc(devm_gpio_chip_release, sizeof(*ptr),
+ GFP_KERNEL);
+ if (!ptr)
+ return -ENOMEM;
+
+ ret = gpiochip_add_data(chip, data);
+ if (ret < 0) {
+ devres_free(ptr);
+ return ret;
+ }
+
+ *ptr = chip;
+ devres_add(dev, ptr);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(devm_gpiochip_add_data);
+
+/**
+ * devm_gpiochip_remove() - Resource manager of gpiochip_remove()
+ * @dev: device for which which resource was allocated
+ * @chip: the chip to remove
+ *
+ * A gpio_chip with any GPIOs still requested may not be removed.
+ */
+void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip)
+{
+ int ret;
+
+ ret = devres_release(dev, devm_gpio_chip_release,
+ devm_gpio_chip_match, chip);
+ if (!ret)
+ WARN_ON(ret);
+}
+EXPORT_SYMBOL_GPL(devm_gpiochip_remove);
+
/**
* gpiochip_find() - iterator for locating a specific gpio_chip
* @data: data to pass to match function
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 82fda48..d5d19cc 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -205,6 +205,10 @@ static inline int gpiochip_add(struct gpio_chip *chip)
return gpiochip_add_data(chip, NULL);
}
extern void gpiochip_remove(struct gpio_chip *chip);
+extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
+ void *data);
+extern void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip);
+
extern struct gpio_chip *gpiochip_find(void *data,
int (*match)(struct gpio_chip *chip, void *data));
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 01/61] gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove
2016-02-22 14:07 ` [PATCH 01/61] gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove Laxman Dewangan
@ 2016-02-22 14:32 ` Andrew Lunn
0 siblings, 0 replies; 78+ messages in thread
From: Andrew Lunn @ 2016-02-22 14:32 UTC (permalink / raw)
To: Laxman Dewangan
Cc: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding,
linux-tegra, linux-doc, gregkh, patches, linux-kernel, linux-gpio,
bcm-kernel-feedback-list, bjorn.andersson, catalin.marinas,
a.kesavan, linux-arm-kernel
> +/**
> + * devm_gpiochip_add_data() - Resource manager piochip_add_data()
^
missing g.
> + * @dev: the device pointer on which irq_chip belongs to.
> + * @chip: the chip to register, with chip->base initialized
> + * Context: potentially before irqs will work
> + *
> + * Returns a negative errno if the chip can't be registered, such as
> + * because the chip->base is invalid or already associated with a
> + * different chip. Otherwise it returns zero as a success code.
> + *
> + * The gpio chip automatically be released when the device is unbound.
^
will
Andrew
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 02/61] gpio: Add resource management devm_gpio_chip_{add_data,remove}
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
2016-02-22 14:07 ` [PATCH 01/61] gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:07 ` [PATCH 03/61] gpio: Add missing devm_gpio_ wrapper in devres.txt Laxman Dewangan
` (59 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Add devm wrappers for the gpiochip_add_data() and gpiochip_remove().
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
Documentation/driver-model/devres.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 831a536..8d8f944 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -252,6 +252,8 @@ GPIO
devm_gpiod_get_index_optional()
devm_gpiod_get_optional()
devm_gpiod_put()
+ devm_gpiochip_add_data()
+ devm_gpiochip_remove()
IIO
devm_iio_device_alloc()
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 03/61] gpio: Add missing devm_gpio_ wrapper in devres.txt
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
2016-02-22 14:07 ` [PATCH 01/61] gpio: Add devm_ apis for gpiochip_add_data and gpiochip_remove Laxman Dewangan
2016-02-22 14:07 ` [PATCH 02/61] gpio: Add resource management devm_gpio_chip_{add_data,remove} Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:07 ` [PATCH 04/61] gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration Laxman Dewangan
` (58 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Add following missing devm wrappers in file devrs.txt under
list of managed interfaces.
devm_gpio_request()
devm_gpio_request_one()
devm_gpio_free()
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
Documentation/driver-model/devres.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 8d8f944..73b98df 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -254,6 +254,9 @@ GPIO
devm_gpiod_put()
devm_gpiochip_add_data()
devm_gpiochip_remove()
+ devm_gpio_request()
+ devm_gpio_request_one()
+ devm_gpio_free()
IIO
devm_iio_device_alloc()
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 04/61] gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (2 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 03/61] gpio: Add missing devm_gpio_ wrapper in devres.txt Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:07 ` [PATCH 05/61] gpio: adnp: " Laxman Dewangan
` (57 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexander Shiyan <shc_work@mail.ru>
---
drivers/gpio/gpio-74xx-mmio.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index 372b0e0..0475e8e 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -140,15 +140,7 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
- return gpiochip_add_data(&priv->gc, priv);
-}
-
-static int mmio_74xx_gpio_remove(struct platform_device *pdev)
-{
- struct mmio_74xx_gpio_priv *priv = platform_get_drvdata(pdev);
-
- gpiochip_remove(&priv->gc);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
}
static struct platform_driver mmio_74xx_gpio_driver = {
@@ -157,7 +149,6 @@ static struct platform_driver mmio_74xx_gpio_driver = {
.of_match_table = mmio_74xx_gpio_ids,
},
.probe = mmio_74xx_gpio_probe,
- .remove = mmio_74xx_gpio_remove,
};
module_platform_driver(mmio_74xx_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 05/61] gpio: adnp: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (3 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 04/61] gpio: 74xx-mmio: Use devm_gpiochip_add_data() for gpio registration Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:07 ` [PATCH 06/61] gpio: adp5520: " Laxman Dewangan
` (56 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
---
drivers/gpio/gpio-adnp.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index fb5b47b..8ff7b0d 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -265,7 +265,7 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios)
chip->of_node = chip->parent->of_node;
chip->owner = THIS_MODULE;
- err = gpiochip_add_data(chip, adnp);
+ err = devm_gpiochip_add_data(&adnp->client->dev, chip, adnp);
if (err)
return err;
@@ -520,14 +520,6 @@ static int adnp_i2c_probe(struct i2c_client *client,
return 0;
}
-static int adnp_i2c_remove(struct i2c_client *client)
-{
- struct adnp *adnp = i2c_get_clientdata(client);
-
- gpiochip_remove(&adnp->gpio);
- return 0;
-}
-
static const struct i2c_device_id adnp_i2c_id[] = {
{ "gpio-adnp" },
{ },
@@ -546,7 +538,6 @@ static struct i2c_driver adnp_i2c_driver = {
.of_match_table = adnp_of_match,
},
.probe = adnp_i2c_probe,
- .remove = adnp_i2c_remove,
.id_table = adnp_i2c_id,
};
module_i2c_driver(adnp_i2c_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 06/61] gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (4 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 05/61] gpio: adnp: " Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-23 7:49 ` Michael Hennerich
2016-02-22 14:07 ` [PATCH 07/61] gpio: adp5588: " Laxman Dewangan
` (55 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from error path.
Also remove the need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
drivers/gpio/gpio-adp5520.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c
index 4fa7ff1..abf1996 100644
--- a/drivers/gpio/gpio-adp5520.c
+++ b/drivers/gpio/gpio-adp5520.c
@@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
goto err;
}
- ret = gpiochip_add_data(&dev->gpio_chip, dev);
+ ret = devm_gpiochip_add_data(&pdev->dev, &dev->gpio_chip, dev);
if (ret)
goto err;
@@ -164,22 +164,11 @@ err:
return ret;
}
-static int adp5520_gpio_remove(struct platform_device *pdev)
-{
- struct adp5520_gpio *dev;
-
- dev = platform_get_drvdata(pdev);
- gpiochip_remove(&dev->gpio_chip);
-
- return 0;
-}
-
static struct platform_driver adp5520_gpio_driver = {
.driver = {
.name = "adp5520-gpio",
},
.probe = adp5520_gpio_probe,
- .remove = adp5520_gpio_remove,
};
module_platform_driver(adp5520_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 06/61] gpio: adp5520: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 ` [PATCH 06/61] gpio: adp5520: " Laxman Dewangan
@ 2016-02-23 7:49 ` Michael Hennerich
0 siblings, 0 replies; 78+ messages in thread
From: Michael Hennerich @ 2016-02-23 7:49 UTC (permalink / raw)
To: Laxman Dewangan, linus.walleij, gnurou, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On 02/22/2016 03:07 PM, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> call for gpiochip_remove() from error path.
>
> Also remove the need of driver callback .remove.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/gpio/gpio-adp5520.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c
> index 4fa7ff1..abf1996 100644
> --- a/drivers/gpio/gpio-adp5520.c
> +++ b/drivers/gpio/gpio-adp5520.c
> @@ -153,7 +153,7 @@ static int adp5520_gpio_probe(struct platform_device *pdev)
> goto err;
> }
>
> - ret = gpiochip_add_data(&dev->gpio_chip, dev);
> + ret = devm_gpiochip_add_data(&pdev->dev, &dev->gpio_chip, dev);
> if (ret)
> goto err;
>
> @@ -164,22 +164,11 @@ err:
> return ret;
> }
>
> -static int adp5520_gpio_remove(struct platform_device *pdev)
> -{
> - struct adp5520_gpio *dev;
> -
> - dev = platform_get_drvdata(pdev);
> - gpiochip_remove(&dev->gpio_chip);
> -
> - return 0;
> -}
> -
> static struct platform_driver adp5520_gpio_driver = {
> .driver = {
> .name = "adp5520-gpio",
> },
> .probe = adp5520_gpio_probe,
> - .remove = adp5520_gpio_remove,
> };
>
> module_platform_driver(adp5520_gpio_driver);
>
--
Greetings,
Michael
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 07/61] gpio: adp5588: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (5 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 06/61] gpio: adp5520: " Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-23 7:49 ` Michael Hennerich
2016-02-22 14:07 ` [PATCH 08/61] gpio: amdpt: " Laxman Dewangan
` (54 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: linux-tegra, linux-doc, gregkh, patches, linux-kernel, linux-gpio,
ldewangan, bcm-kernel-feedback-list, bjorn.andersson,
catalin.marinas, a.kesavan, linux-arm-kernel
Use devm_gpiochip_add_data() for GPIO registration and remove the
call for gpiochip_remove() from remove callback.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
drivers/gpio/gpio-adp5588.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index 19a0eba..c0f718b 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -414,7 +414,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
}
}
- ret = gpiochip_add_data(&dev->gpio_chip, dev);
+ ret = devm_gpiochip_add_data(&client->dev, &dev->gpio_chip, dev);
if (ret)
goto err_irq;
@@ -457,8 +457,6 @@ static int adp5588_gpio_remove(struct i2c_client *client)
if (dev->irq_base)
free_irq(dev->client->irq, dev);
- gpiochip_remove(&dev->gpio_chip);
-
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 07/61] gpio: adp5588: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 ` [PATCH 07/61] gpio: adp5588: " Laxman Dewangan
@ 2016-02-23 7:49 ` Michael Hennerich
0 siblings, 0 replies; 78+ messages in thread
From: Michael Hennerich @ 2016-02-23 7:49 UTC (permalink / raw)
To: Laxman Dewangan, linus.walleij, gnurou, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On 02/22/2016 03:07 PM, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> call for gpiochip_remove() from remove callback.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> ---
> drivers/gpio/gpio-adp5588.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
> index 19a0eba..c0f718b 100644
> --- a/drivers/gpio/gpio-adp5588.c
> +++ b/drivers/gpio/gpio-adp5588.c
> @@ -414,7 +414,7 @@ static int adp5588_gpio_probe(struct i2c_client *client,
> }
> }
>
> - ret = gpiochip_add_data(&dev->gpio_chip, dev);
> + ret = devm_gpiochip_add_data(&client->dev, &dev->gpio_chip, dev);
> if (ret)
> goto err_irq;
>
> @@ -457,8 +457,6 @@ static int adp5588_gpio_remove(struct i2c_client *client)
> if (dev->irq_base)
> free_irq(dev->client->irq, dev);
>
> - gpiochip_remove(&dev->gpio_chip);
> -
> return 0;
> }
>
>
--
Greetings,
Michael
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 08/61] gpio: amdpt: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (6 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 07/61] gpio: adp5588: " Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 14:07 ` [PATCH 09/61] gpio: arizona: " Laxman Dewangan
` (53 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-amdpt.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index c248404..857eec5 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -212,7 +212,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
#if defined(CONFIG_OF_GPIO)
pt_gpio->gc.of_node = pdev->dev.of_node;
#endif
- ret = gpiochip_add_data(&pt_gpio->gc, pt_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &pt_gpio->gc, pt_gpio);
if (ret) {
dev_err(&pdev->dev, "Failed to register GPIO lib\n");
return ret;
@@ -228,15 +228,6 @@ static int pt_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int pt_gpio_remove(struct platform_device *pdev)
-{
- struct pt_gpio_chip *pt_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&pt_gpio->gc);
-
- return 0;
-}
-
static const struct acpi_device_id pt_gpio_acpi_match[] = {
{ "AMDF030", 0 },
{ },
@@ -249,7 +240,6 @@ static struct platform_driver pt_gpio_driver = {
.acpi_match_table = ACPI_PTR(pt_gpio_acpi_match),
},
.probe = pt_gpio_probe,
- .remove = pt_gpio_remove,
};
module_platform_driver(pt_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 09/61] gpio: arizona: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (7 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 08/61] gpio: amdpt: " Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 16:28 ` Charles Keepax
2016-02-22 14:07 ` [PATCH 10/61] gpio: ath79: " Laxman Dewangan
` (52 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
---
drivers/gpio/gpio-arizona.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index e910c1f..9913704 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -132,7 +132,8 @@ static int arizona_gpio_probe(struct platform_device *pdev)
else
arizona_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&arizona_gpio->gpio_chip, arizona_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &arizona_gpio->gpio_chip,
+ arizona_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
ret);
@@ -147,18 +148,9 @@ err:
return ret;
}
-static int arizona_gpio_remove(struct platform_device *pdev)
-{
- struct arizona_gpio *arizona_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&arizona_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver arizona_gpio_driver = {
.driver.name = "arizona-gpio",
.probe = arizona_gpio_probe,
- .remove = arizona_gpio_remove,
};
module_platform_driver(arizona_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 09/61] gpio: arizona: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 ` [PATCH 09/61] gpio: arizona: " Laxman Dewangan
@ 2016-02-22 16:28 ` Charles Keepax
0 siblings, 0 replies; 78+ messages in thread
From: Charles Keepax @ 2016-02-22 16:28 UTC (permalink / raw)
To: Laxman Dewangan
Cc: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding,
bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On Mon, Feb 22, 2016 at 07:37:58PM +0530, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> need of driver callback .remove.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: patches@opensource.wolfsonmicro.com
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 10/61] gpio: ath79: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (8 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 09/61] gpio: arizona: " Laxman Dewangan
@ 2016-02-22 14:07 ` Laxman Dewangan
2016-02-22 20:13 ` Alban
2016-02-22 14:08 ` [PATCH 11/61] gpio: bcm-kona: " Laxman Dewangan
` (51 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:07 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Alban Bedel <albeu@free.fr>
---
drivers/gpio/gpio-ath79.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index d13dd13..a6aad59 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -182,7 +182,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
ctrl->chip.direction_output = ar934x_gpio_direction_output;
}
- err = gpiochip_add_data(&ctrl->chip, ctrl);
+ err = devm_gpiochip_add_data(&pdev->dev, &ctrl->chip, ctrl);
if (err) {
dev_err(&pdev->dev,
"cannot add AR71xx GPIO chip, error=%d", err);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 10/61] gpio: ath79: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 ` [PATCH 10/61] gpio: ath79: " Laxman Dewangan
@ 2016-02-22 20:13 ` Alban
2016-02-23 14:58 ` Laxman Dewangan
0 siblings, 1 reply; 78+ messages in thread
From: Alban @ 2016-02-22 20:13 UTC (permalink / raw)
To: Laxman Dewangan
Cc: Aban Bedel, linus.walleij, gnurou, michael.hennerich, corbet,
rjui, shc_work, support.opensource, swarren, thierry.reding,
bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On Mon, 22 Feb 2016 19:37:59 +0530
Laxman Dewangan <ldewangan@nvidia.com> wrote:
> Use devm_gpiochip_add_data() for GPIO registration.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Alban Bedel <albeu@free.fr>
> ---
> drivers/gpio/gpio-ath79.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
> index d13dd13..a6aad59 100644
> --- a/drivers/gpio/gpio-ath79.c
> +++ b/drivers/gpio/gpio-ath79.c
> @@ -182,7 +182,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
> ctrl->chip.direction_output = ar934x_gpio_direction_output;
> }
>
> - err = gpiochip_add_data(&ctrl->chip, ctrl);
> + err = devm_gpiochip_add_data(&pdev->dev, &ctrl->chip, ctrl);
> if (err) {
> dev_err(&pdev->dev,
> "cannot add AR71xx GPIO chip, error=%d", err);
With the patches already applied to the devel branch a few more changes
will be needed to remove the calls to gpiochip_remove() in the probe
error path and the remove callback.
Alban
^ permalink raw reply [flat|nested] 78+ messages in thread
* Re: [PATCH 10/61] gpio: ath79: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 20:13 ` Alban
@ 2016-02-23 14:58 ` Laxman Dewangan
0 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-23 14:58 UTC (permalink / raw)
To: Alban
Cc: linus.walleij, gnurou, michael.hennerich, corbet, rjui, shc_work,
support.opensource, swarren, thierry.reding, bjorn.andersson,
a.kesavan, gregkh, catalin.marinas, linux-doc, linux-kernel,
linux-gpio, patches, bcm-kernel-feedback-list, linux-arm-kernel,
linux-tegra
On Tuesday 23 February 2016 01:43 AM, Alban wrote:
> On Mon, 22 Feb 2016 19:37:59 +0530
> Laxman Dewangan <ldewangan@nvidia.com> wrote:
>
>> Use devm_gpiochip_add_data() for GPIO registration.
>>
>> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
>> Cc: Alban Bedel <albeu@free.fr>
>> ---
>> drivers/gpio/gpio-ath79.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
>> index d13dd13..a6aad59 100644
>> --- a/drivers/gpio/gpio-ath79.c
>> +++ b/drivers/gpio/gpio-ath79.c
>> @@ -182,7 +182,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
>> ctrl->chip.direction_output = ar934x_gpio_direction_output;
>> }
>>
>> - err = gpiochip_add_data(&ctrl->chip, ctrl);
>> + err = devm_gpiochip_add_data(&pdev->dev, &ctrl->chip, ctrl);
>> if (err) {
>> dev_err(&pdev->dev,
>> "cannot add AR71xx GPIO chip, error=%d", err);
> With the patches already applied to the devel branch a few more changes
> will be needed to remove the calls to gpiochip_remove() in the probe
> error path and the remove callback.
>
OK, I will drop this patch when provide the git pointer to Linus.
We can work on this later.
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 11/61] gpio: bcm-kona: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (9 preceding siblings ...)
2016-02-22 14:07 ` [PATCH 10/61] gpio: ath79: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 17:17 ` Ray Jui
2016-02-22 14:08 ` [PATCH 12/61] gpio: clps711x: " Laxman Dewangan
` (50 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Ray Jui <rjui@broadcom.com>
---
drivers/gpio/gpio-bcm-kona.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index b6c5abe..2fd38d5 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -630,7 +630,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
bcm_kona_gpio_reset(kona_gpio);
- ret = gpiochip_add_data(chip, kona_gpio);
+ ret = devm_gpiochip_add_data(dev, chip, kona_gpio);
if (ret < 0) {
dev_err(dev, "Couldn't add GPIO chip -- %d\n", ret);
goto err_irq_domain;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 11/61] gpio: bcm-kona: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:08 ` [PATCH 11/61] gpio: bcm-kona: " Laxman Dewangan
@ 2016-02-22 17:17 ` Ray Jui
0 siblings, 0 replies; 78+ messages in thread
From: Ray Jui @ 2016-02-22 17:17 UTC (permalink / raw)
To: Laxman Dewangan, linus.walleij, gnurou, michael.hennerich, corbet,
albeu, rjui, shc_work, support.opensource, swarren,
thierry.reding
Cc: bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On 2/22/2016 6:08 AM, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Ray Jui <rjui@broadcom.com>
> ---
> drivers/gpio/gpio-bcm-kona.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
> index b6c5abe..2fd38d5 100644
> --- a/drivers/gpio/gpio-bcm-kona.c
> +++ b/drivers/gpio/gpio-bcm-kona.c
> @@ -630,7 +630,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
>
> bcm_kona_gpio_reset(kona_gpio);
>
> - ret = gpiochip_add_data(chip, kona_gpio);
> + ret = devm_gpiochip_add_data(dev, chip, kona_gpio);
> if (ret < 0) {
> dev_err(dev, "Couldn't add GPIO chip -- %d\n", ret);
> goto err_irq_domain;
>
Acked-by: Ray Jui <ray.jui@broadcom.com>
Thanks!
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 12/61] gpio: clps711x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (10 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 11/61] gpio: bcm-kona: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 13/61] gpio: crystalcove: " Laxman Dewangan
` (49 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-clps711x.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-clps711x.c b/drivers/gpio/gpio-clps711x.c
index c84f955..5a69025 100644
--- a/drivers/gpio/gpio-clps711x.c
+++ b/drivers/gpio/gpio-clps711x.c
@@ -67,15 +67,7 @@ static int clps711x_gpio_probe(struct platform_device *pdev)
gc->owner = THIS_MODULE;
platform_set_drvdata(pdev, gc);
- return gpiochip_add_data(gc, NULL);
-}
-
-static int clps711x_gpio_remove(struct platform_device *pdev)
-{
- struct gpio_chip *gc = platform_get_drvdata(pdev);
-
- gpiochip_remove(gc);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, gc, NULL);
}
static const struct of_device_id __maybe_unused clps711x_gpio_ids[] = {
@@ -90,7 +82,6 @@ static struct platform_driver clps711x_gpio_driver = {
.of_match_table = of_match_ptr(clps711x_gpio_ids),
},
.probe = clps711x_gpio_probe,
- .remove = clps711x_gpio_remove,
};
module_platform_driver(clps711x_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 13/61] gpio: crystalcove: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (11 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 12/61] gpio: clps711x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 14/61] gpio: cs5535: " Laxman Dewangan
` (48 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
call of gpiochip_remove() from error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-crystalcove.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
index 7865ef0..7c446d1 100644
--- a/drivers/gpio/gpio-crystalcove.c
+++ b/drivers/gpio/gpio-crystalcove.c
@@ -345,7 +345,7 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
cg->chip.dbg_show = crystalcove_gpio_dbg_show;
cg->regmap = pmic->regmap;
- retval = gpiochip_add_data(&cg->chip, cg);
+ retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
if (retval) {
dev_warn(&pdev->dev, "add gpio chip error: %d\n", retval);
return retval;
@@ -359,14 +359,10 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
if (retval) {
dev_warn(&pdev->dev, "request irq failed: %d\n", retval);
- goto out_remove_gpio;
+ return retval;
}
return 0;
-
-out_remove_gpio:
- gpiochip_remove(&cg->chip);
- return retval;
}
static int crystalcove_gpio_remove(struct platform_device *pdev)
@@ -374,7 +370,6 @@ static int crystalcove_gpio_remove(struct platform_device *pdev)
struct crystalcove_gpio *cg = platform_get_drvdata(pdev);
int irq = platform_get_irq(pdev, 0);
- gpiochip_remove(&cg->chip);
if (irq >= 0)
free_irq(irq, cg);
return 0;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 14/61] gpio: cs5535: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (12 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 13/61] gpio: crystalcove: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 15/61] gpio: da9052: " Laxman Dewangan
` (47 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-cs5535.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/gpio/gpio-cs5535.c b/drivers/gpio/gpio-cs5535.c
index eccb712..90278b1 100644
--- a/drivers/gpio/gpio-cs5535.c
+++ b/drivers/gpio/gpio-cs5535.c
@@ -320,13 +320,13 @@ static int cs5535_gpio_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (!res) {
dev_err(&pdev->dev, "can't fetch device resource info\n");
- goto done;
+ return err;
}
if (!devm_request_region(&pdev->dev, res->start, resource_size(res),
pdev->name)) {
dev_err(&pdev->dev, "can't request region\n");
- goto done;
+ return err;
}
/* set up the driver-specific struct */
@@ -348,19 +348,10 @@ static int cs5535_gpio_probe(struct platform_device *pdev)
mask_orig, mask);
/* finally, register with the generic GPIO API */
- err = gpiochip_add_data(&cs5535_gpio_chip.chip, &cs5535_gpio_chip);
+ err = devm_gpiochip_add_data(&pdev->dev, &cs5535_gpio_chip.chip,
+ &cs5535_gpio_chip);
if (err)
- goto done;
-
- return 0;
-
-done:
- return err;
-}
-
-static int cs5535_gpio_remove(struct platform_device *pdev)
-{
- gpiochip_remove(&cs5535_gpio_chip.chip);
+ return err;
return 0;
}
@@ -370,7 +361,6 @@ static struct platform_driver cs5535_gpio_driver = {
.name = DRV_NAME,
},
.probe = cs5535_gpio_probe,
- .remove = cs5535_gpio_remove,
};
module_platform_driver(cs5535_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 15/61] gpio: da9052: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (13 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 14/61] gpio: cs5535: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 16/61] gpio: da9055: " Laxman Dewangan
` (46 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-da9052.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index f9b3247..e29553b 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -214,7 +214,7 @@ static int da9052_gpio_probe(struct platform_device *pdev)
if (pdata && pdata->gpio_base)
gpio->gp.base = pdata->gpio_base;
- ret = gpiochip_add_data(&gpio->gp, gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gp, gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -225,17 +225,8 @@ static int da9052_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int da9052_gpio_remove(struct platform_device *pdev)
-{
- struct da9052_gpio *gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&gpio->gp);
- return 0;
-}
-
static struct platform_driver da9052_gpio_driver = {
.probe = da9052_gpio_probe,
- .remove = da9052_gpio_remove,
.driver = {
.name = "da9052-gpio",
},
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 16/61] gpio: da9055: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (14 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 15/61] gpio: da9052: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 17/61] gpio: dln2: " Laxman Dewangan
` (45 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Support Opensource <support.opensource@diasemi.com>
---
drivers/gpio/gpio-da9055.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c
index 18210fb..2c2c18d 100644
--- a/drivers/gpio/gpio-da9055.c
+++ b/drivers/gpio/gpio-da9055.c
@@ -151,31 +151,19 @@ static int da9055_gpio_probe(struct platform_device *pdev)
if (pdata && pdata->gpio_base)
gpio->gp.base = pdata->gpio_base;
- ret = gpiochip_add_data(&gpio->gp, gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gp, gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
- goto err_mem;
+ return ret;
}
platform_set_drvdata(pdev, gpio);
return 0;
-
-err_mem:
- return ret;
-}
-
-static int da9055_gpio_remove(struct platform_device *pdev)
-{
- struct da9055_gpio *gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&gpio->gp);
- return 0;
}
static struct platform_driver da9055_gpio_driver = {
.probe = da9055_gpio_probe,
- .remove = da9055_gpio_remove,
.driver = {
.name = "da9055-gpio",
},
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 17/61] gpio: dln2: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (15 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 16/61] gpio: da9055: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 18/61] gpio: ep93xx: " Laxman Dewangan
` (44 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-dln2.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/drivers/gpio/gpio-dln2.c b/drivers/gpio/gpio-dln2.c
index e11a7d1..f7a60a4 100644
--- a/drivers/gpio/gpio-dln2.c
+++ b/drivers/gpio/gpio-dln2.c
@@ -479,40 +479,32 @@ static int dln2_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, dln2);
- ret = gpiochip_add_data(&dln2->gpio, dln2);
+ ret = devm_gpiochip_add_data(dev, &dln2->gpio, dln2);
if (ret < 0) {
dev_err(dev, "failed to add gpio chip: %d\n", ret);
- goto out;
+ return ret;
}
ret = gpiochip_irqchip_add(&dln2->gpio, &dln2_gpio_irqchip, 0,
handle_simple_irq, IRQ_TYPE_NONE);
if (ret < 0) {
dev_err(dev, "failed to add irq chip: %d\n", ret);
- goto out_gpiochip_remove;
+ return ret;
}
ret = dln2_register_event_cb(pdev, DLN2_GPIO_CONDITION_MET_EV,
dln2_gpio_event);
if (ret) {
dev_err(dev, "failed to register event cb: %d\n", ret);
- goto out_gpiochip_remove;
+ return ret;
}
return 0;
-
-out_gpiochip_remove:
- gpiochip_remove(&dln2->gpio);
-out:
- return ret;
}
static int dln2_gpio_remove(struct platform_device *pdev)
{
- struct dln2_gpio *dln2 = platform_get_drvdata(pdev);
-
dln2_unregister_event_cb(pdev, DLN2_GPIO_CONDITION_MET_EV);
- gpiochip_remove(&dln2->gpio);
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 18/61] gpio: ep93xx: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (16 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 17/61] gpio: dln2: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 19/61] gpio: f7188x: " Laxman Dewangan
` (43 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-ep93xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c
index ad27907..d054219 100644
--- a/drivers/gpio/gpio-ep93xx.c
+++ b/drivers/gpio/gpio-ep93xx.c
@@ -339,7 +339,7 @@ static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev,
gc->to_irq = ep93xx_gpio_to_irq;
}
- return gpiochip_add_data(gc, NULL);
+ return devm_gpiochip_add_data(dev, gc, NULL);
}
static int ep93xx_gpio_probe(struct platform_device *pdev)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 19/61] gpio: f7188x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (17 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 18/61] gpio: ep93xx: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 20/61] gpio: ge: " Laxman Dewangan
` (42 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: linux-tegra, linux-doc, gregkh, patches, linux-kernel, linux-gpio,
ldewangan, bcm-kernel-feedback-list, bjorn.andersson,
catalin.marinas, a.kesavan, linux-arm-kernel
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-f7188x.c | 26 ++------------------------
1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/gpio/gpio-f7188x.c b/drivers/gpio/gpio-f7188x.c
index 0417798..daac2d4 100644
--- a/drivers/gpio/gpio-f7188x.c
+++ b/drivers/gpio/gpio-f7188x.c
@@ -350,37 +350,16 @@ static int f7188x_gpio_probe(struct platform_device *pdev)
bank->chip.parent = &pdev->dev;
bank->data = data;
- err = gpiochip_add_data(&bank->chip, bank);
+ err = devm_gpiochip_add_data(&pdev->dev, &bank->chip, bank);
if (err) {
dev_err(&pdev->dev,
"Failed to register gpiochip %d: %d\n",
i, err);
- goto err_gpiochip;
+ return err;
}
}
return 0;
-
-err_gpiochip:
- for (i = i - 1; i >= 0; i--) {
- struct f7188x_gpio_bank *bank = &data->bank[i];
- gpiochip_remove(&bank->chip);
- }
-
- return err;
-}
-
-static int f7188x_gpio_remove(struct platform_device *pdev)
-{
- int i;
- struct f7188x_gpio_data *data = platform_get_drvdata(pdev);
-
- for (i = 0; i < data->nr_bank; i++) {
- struct f7188x_gpio_bank *bank = &data->bank[i];
- gpiochip_remove(&bank->chip);
- }
-
- return 0;
}
static int __init f7188x_find(int addr, struct f7188x_sio *sio)
@@ -476,7 +455,6 @@ static struct platform_driver f7188x_gpio_driver = {
.name = DRVNAME,
},
.probe = f7188x_gpio_probe,
- .remove = f7188x_gpio_remove,
};
static int __init f7188x_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 20/61] gpio: ge: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (18 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 19/61] gpio: f7188x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 21/61] gpio: generic: " Laxman Dewangan
` (41 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: linux-tegra, linux-doc, gregkh, patches, linux-kernel, linux-gpio,
ldewangan, bcm-kernel-feedback-list, bjorn.andersson,
catalin.marinas, a.kesavan, linux-arm-kernel
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-ge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index cbbec83..8650b29 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -89,7 +89,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
gc->of_node = pdev->dev.of_node;
/* This function adds a memory mapped GPIO chip */
- ret = gpiochip_add_data(gc, NULL);
+ ret = devm_gpiochip_add_data(&pdev->dev, gc, NULL);
if (ret)
goto err0;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 21/61] gpio: generic: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (19 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 20/61] gpio: ge: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 22/61] gpio: iop: " Laxman Dewangan
` (40 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-generic.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c
index 2a4f233..54cddfa 100644
--- a/drivers/gpio/gpio-generic.c
+++ b/drivers/gpio/gpio-generic.c
@@ -628,15 +628,7 @@ static int bgpio_pdev_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gc);
- return gpiochip_add_data(gc, NULL);
-}
-
-static int bgpio_pdev_remove(struct platform_device *pdev)
-{
- struct gpio_chip *gc = platform_get_drvdata(pdev);
-
- gpiochip_remove(gc);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, gc, NULL);
}
static const struct platform_device_id bgpio_id_table[] = {
@@ -657,7 +649,6 @@ static struct platform_driver bgpio_driver = {
},
.id_table = bgpio_id_table,
.probe = bgpio_pdev_probe,
- .remove = bgpio_pdev_remove,
};
module_platform_driver(bgpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 22/61] gpio: iop: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (20 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 21/61] gpio: generic: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
[not found] ` <1456150130-2668-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
` (39 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-iop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-iop.c b/drivers/gpio/gpio-iop.c
index fb65e58..860c535 100644
--- a/drivers/gpio/gpio-iop.c
+++ b/drivers/gpio/gpio-iop.c
@@ -114,7 +114,7 @@ static int iop3xx_gpio_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
- return gpiochip_add_data(&iop3xx_chip, NULL);
+ return devm_gpiochip_add_data(&pdev->dev, &iop3xx_chip, NULL);
}
static struct platform_driver iop3xx_gpio_driver = {
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
[parent not found: <1456150130-2668-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* [PATCH 23/61] gpio: janz-ttl: Use devm_gpiochip_add_data() for gpio registration
[not found] ` <1456150130-2668-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2016-02-22 14:08 ` Laxman Dewangan
0 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
gnurou-Re5JQEeQqe8AvxtiuMwx3w,
michael.hennerich-OyLXuOCK7orQT0dZR+AlfA, corbet-T1hC0tSOHrs,
albeu-GANU6spQydw, rjui-dY08KVG/lbpWk0Htik3J/w,
shc_work-JGs/UdohzUI, support.opensource-WBD+wuPFNBhBDgjK7y7TUQ,
swarren-3lzwWm7+Weoh9ZMKESR00Q,
thierry.reding-Re5JQEeQqe8AvxtiuMwx3w
Cc: ldewangan-DDmLM1+adcrQT0dZR+AlfA,
bjorn.andersson-/MT0OVThwyLZJqsBc5GL+g,
a.kesavan-Sze3O3UU22JBDgjK7y7TUQ,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
catalin.marinas-5wv7dgnIgG8, linux-doc-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
patches-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E,
bcm-kernel-feedback-list-dY08KVG/lbpWk0Htik3J/w,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/gpio/gpio-janz-ttl.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c
index 482aa03..a8d0a6b 100644
--- a/drivers/gpio/gpio-janz-ttl.c
+++ b/drivers/gpio/gpio-janz-ttl.c
@@ -182,7 +182,7 @@ static int ttl_probe(struct platform_device *pdev)
gpio->base = -1;
gpio->ngpio = 20;
- ret = gpiochip_add_data(gpio, NULL);
+ ret = devm_gpiochip_add_data(dev, gpio, NULL);
if (ret) {
dev_err(dev, "unable to add GPIO chip\n");
return ret;
@@ -191,21 +191,11 @@ static int ttl_probe(struct platform_device *pdev)
return 0;
}
-static int ttl_remove(struct platform_device *pdev)
-{
- struct ttl_module *mod = platform_get_drvdata(pdev);
-
- gpiochip_remove(&mod->gpio);
-
- return 0;
-}
-
static struct platform_driver ttl_driver = {
.driver = {
.name = DRV_NAME,
},
.probe = ttl_probe,
- .remove = ttl_remove,
};
module_platform_driver(ttl_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 24/61] gpio: kempld: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (22 preceding siblings ...)
[not found] ` <1456150130-2668-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 25/61] gpio: lp3943: " Laxman Dewangan
` (37 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-kempld.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c
index 0111774..701f151 100644
--- a/drivers/gpio/gpio-kempld.c
+++ b/drivers/gpio/gpio-kempld.c
@@ -178,7 +178,7 @@ static int kempld_gpio_probe(struct platform_device *pdev)
return -ENODEV;
}
- ret = gpiochip_add_data(chip, gpio);
+ ret = devm_gpiochip_add_data(dev, chip, gpio);
if (ret) {
dev_err(dev, "Could not register GPIO chip\n");
return ret;
@@ -190,20 +190,11 @@ static int kempld_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int kempld_gpio_remove(struct platform_device *pdev)
-{
- struct kempld_gpio_data *gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&gpio->chip);
- return 0;
-}
-
static struct platform_driver kempld_gpio_driver = {
.driver = {
.name = "kempld-gpio",
},
.probe = kempld_gpio_probe,
- .remove = kempld_gpio_remove,
};
module_platform_driver(kempld_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 25/61] gpio: lp3943: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (23 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 24/61] gpio: kempld: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 26/61] gpio: lpc32xx: " Laxman Dewangan
` (36 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-lp3943.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-lp3943.c b/drivers/gpio/gpio-lp3943.c
index 1c8e2ae..6dc6725 100644
--- a/drivers/gpio/gpio-lp3943.c
+++ b/drivers/gpio/gpio-lp3943.c
@@ -204,15 +204,8 @@ static int lp3943_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, lp3943_gpio);
- return gpiochip_add_data(&lp3943_gpio->chip, lp3943_gpio);
-}
-
-static int lp3943_gpio_remove(struct platform_device *pdev)
-{
- struct lp3943_gpio *lp3943_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&lp3943_gpio->chip);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &lp3943_gpio->chip,
+ lp3943_gpio);
}
static const struct of_device_id lp3943_gpio_of_match[] = {
@@ -223,7 +216,6 @@ MODULE_DEVICE_TABLE(of, lp3943_gpio_of_match);
static struct platform_driver lp3943_gpio_driver = {
.probe = lp3943_gpio_probe,
- .remove = lp3943_gpio_remove,
.driver = {
.name = "lp3943-gpio",
.of_match_table = lp3943_gpio_of_match,
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 26/61] gpio: lpc32xx: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (24 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 25/61] gpio: lp3943: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 27/61] gpio: lynxpoint: " Laxman Dewangan
` (35 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-lpc32xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
index 4cecf4c..d39014d 100644
--- a/drivers/gpio/gpio-lpc32xx.c
+++ b/drivers/gpio/gpio-lpc32xx.c
@@ -547,7 +547,7 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev)
lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3;
lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node;
}
- gpiochip_add_data(&lpc32xx_gpiochip[i].chip,
+ devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
&lpc32xx_gpiochip[i]);
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 27/61] gpio: lynxpoint: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (25 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 26/61] gpio: lpc32xx: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 28/61] gpio: mc9s08dz60: " Laxman Dewangan
` (34 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-lynxpoint.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c
index 1310777..9df015e 100644
--- a/drivers/gpio/gpio-lynxpoint.c
+++ b/drivers/gpio/gpio-lynxpoint.c
@@ -370,7 +370,7 @@ static int lp_gpio_probe(struct platform_device *pdev)
gc->can_sleep = false;
gc->parent = dev;
- ret = gpiochip_add_data(gc, lg);
+ ret = devm_gpiochip_add_data(dev, gc, lg);
if (ret) {
dev_err(dev, "failed adding lp-gpio chip\n");
return ret;
@@ -439,9 +439,7 @@ MODULE_DEVICE_TABLE(acpi, lynxpoint_gpio_acpi_match);
static int lp_gpio_remove(struct platform_device *pdev)
{
- struct lp_gpio *lg = platform_get_drvdata(pdev);
pm_runtime_disable(&pdev->dev);
- gpiochip_remove(&lg->chip);
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 28/61] gpio: mc9s08dz60: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (26 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 27/61] gpio: lynxpoint: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 29/61] gpio: moxart: " Laxman Dewangan
` (33 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-mc9s08dz60.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/gpio/gpio-mc9s08dz60.c b/drivers/gpio/gpio-mc9s08dz60.c
index ba22fb9..14f252f 100644
--- a/drivers/gpio/gpio-mc9s08dz60.c
+++ b/drivers/gpio/gpio-mc9s08dz60.c
@@ -103,17 +103,7 @@ static int mc9s08dz60_probe(struct i2c_client *client,
mc9s->client = client;
i2c_set_clientdata(client, mc9s);
- return gpiochip_add_data(&mc9s->chip, mc9s);
-}
-
-static int mc9s08dz60_remove(struct i2c_client *client)
-{
- struct mc9s08dz60 *mc9s;
-
- mc9s = i2c_get_clientdata(client);
-
- gpiochip_remove(&mc9s->chip);
- return 0;
+ return devm_gpiochip_add_data(&client->dev, &mc9s->chip, mc9s);
}
static const struct i2c_device_id mc9s08dz60_id[] = {
@@ -128,7 +118,6 @@ static struct i2c_driver mc9s08dz60_i2c_driver = {
.name = "mc9s08dz60",
},
.probe = mc9s08dz60_probe,
- .remove = mc9s08dz60_remove,
.id_table = mc9s08dz60_id,
};
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 29/61] gpio: moxart: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (27 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 28/61] gpio: mc9s08dz60: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 30/61] gpio: mvebu: " Laxman Dewangan
` (32 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-moxart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-moxart.c b/drivers/gpio/gpio-moxart.c
index ca60453..869002b 100644
--- a/drivers/gpio/gpio-moxart.c
+++ b/drivers/gpio/gpio-moxart.c
@@ -63,7 +63,7 @@ static int moxart_gpio_probe(struct platform_device *pdev)
gc->parent = dev;
gc->owner = THIS_MODULE;
- ret = gpiochip_add_data(gc, NULL);
+ ret = devm_gpiochip_add_data(dev, gc, NULL);
if (ret) {
dev_err(dev, "%s: gpiochip_add failed\n",
dev->of_node->full_name);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 30/61] gpio: mvebu: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (28 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 29/61] gpio: moxart: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 31/61] gpio: mxc: " Laxman Dewangan
` (31 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-mvebu.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index a5eacc1..11c6582 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -756,7 +756,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
BUG();
}
- gpiochip_add_data(&mvchip->chip, mvchip);
+ devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip);
/* Some gpio controllers do not provide irq support */
if (!of_irq_count(np))
@@ -777,16 +777,14 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
mvchip->irqbase = irq_alloc_descs(-1, 0, ngpios, -1);
if (mvchip->irqbase < 0) {
dev_err(&pdev->dev, "no irqs\n");
- err = mvchip->irqbase;
- goto err_gpiochip_add;
+ return mvchip->irqbase;
}
gc = irq_alloc_generic_chip("mvebu_gpio_irq", 2, mvchip->irqbase,
mvchip->membase, handle_level_irq);
if (!gc) {
dev_err(&pdev->dev, "Cannot allocate generic irq_chip\n");
- err = -ENOMEM;
- goto err_gpiochip_add;
+ return -ENOMEM;
}
gc->private = mvchip;
@@ -828,9 +826,6 @@ err_generic_chip:
IRQ_LEVEL | IRQ_NOPROBE);
kfree(gc);
-err_gpiochip_add:
- gpiochip_remove(&mvchip->chip);
-
return err;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 31/61] gpio: mxc: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (29 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 30/61] gpio: mvebu: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 32/61] gpio: octeon: " Laxman Dewangan
` (30 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-mxc.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 7fd21cb..1b342a3 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -462,14 +462,14 @@ static int mxc_gpio_probe(struct platform_device *pdev)
port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
pdev->id * 32;
- err = gpiochip_add_data(&port->gc, port);
+ err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
if (err)
goto out_bgio;
irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id());
if (irq_base < 0) {
err = irq_base;
- goto out_gpiochip_remove;
+ goto out_bgio;
}
port->domain = irq_domain_add_legacy(np, 32, irq_base, 0,
@@ -492,8 +492,6 @@ out_irqdomain_remove:
irq_domain_remove(port->domain);
out_irqdesc_free:
irq_free_descs(irq_base, 32);
-out_gpiochip_remove:
- gpiochip_remove(&port->gc);
out_bgio:
dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
return err;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 32/61] gpio: octeon: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (30 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 31/61] gpio: mxc: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 33/61] gpio: pca953x: " Laxman Dewangan
` (29 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-octeon.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-octeon.c b/drivers/gpio/gpio-octeon.c
index 7665ebc..47aead1 100644
--- a/drivers/gpio/gpio-octeon.c
+++ b/drivers/gpio/gpio-octeon.c
@@ -117,7 +117,7 @@ static int octeon_gpio_probe(struct platform_device *pdev)
chip->get = octeon_gpio_get;
chip->direction_output = octeon_gpio_dir_out;
chip->set = octeon_gpio_set;
- err = gpiochip_add_data(chip, gpio);
+ err = devm_gpiochip_add_data(&pdev->dev, chip, gpio);
if (err)
goto out;
@@ -126,13 +126,6 @@ out:
return err;
}
-static int octeon_gpio_remove(struct platform_device *pdev)
-{
- struct gpio_chip *chip = dev_get_platdata(&pdev->dev);
- gpiochip_remove(chip);
- return 0;
-}
-
static struct of_device_id octeon_gpio_match[] = {
{
.compatible = "cavium,octeon-3860-gpio",
@@ -147,7 +140,6 @@ static struct platform_driver octeon_gpio_driver = {
.of_match_table = octeon_gpio_match,
},
.probe = octeon_gpio_probe,
- .remove = octeon_gpio_remove,
};
module_platform_driver(octeon_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 33/61] gpio: pca953x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (31 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 32/61] gpio: octeon: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 34/61] gpio: pcf857x: " Laxman Dewangan
` (28 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-pca953x.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 23196c5..b7fe5d5 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -754,7 +754,7 @@ static int pca953x_probe(struct i2c_client *client,
if (ret)
return ret;
- ret = gpiochip_add_data(&chip->gpio_chip, chip);
+ ret = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
if (ret)
return ret;
@@ -789,8 +789,6 @@ static int pca953x_remove(struct i2c_client *client)
}
}
- gpiochip_remove(&chip->gpio_chip);
-
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 34/61] gpio: pcf857x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (32 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 33/61] gpio: pca953x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 35/61] gpio: palmas: " Laxman Dewangan
` (27 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-pcf857x.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c
index 709cd3f..169c09a 100644
--- a/drivers/gpio/gpio-pcf857x.c
+++ b/drivers/gpio/gpio-pcf857x.c
@@ -372,7 +372,7 @@ static int pcf857x_probe(struct i2c_client *client,
gpio->out = ~n_latch;
gpio->status = gpio->out;
- status = gpiochip_add_data(&gpio->chip, gpio);
+ status = devm_gpiochip_add_data(&client->dev, &gpio->chip, gpio);
if (status < 0)
goto fail;
@@ -383,7 +383,7 @@ static int pcf857x_probe(struct i2c_client *client,
IRQ_TYPE_NONE);
if (status) {
dev_err(&client->dev, "cannot add irqchip\n");
- goto fail_irq;
+ goto fail;
}
status = devm_request_threaded_irq(&client->dev, client->irq,
@@ -391,7 +391,7 @@ static int pcf857x_probe(struct i2c_client *client,
IRQF_TRIGGER_FALLING | IRQF_SHARED,
dev_name(&client->dev), gpio);
if (status)
- goto fail_irq;
+ goto fail;
gpiochip_set_chained_irqchip(&gpio->chip, &pcf857x_irq_chip,
client->irq, NULL);
@@ -413,9 +413,6 @@ static int pcf857x_probe(struct i2c_client *client,
return 0;
-fail_irq:
- gpiochip_remove(&gpio->chip);
-
fail:
dev_dbg(&client->dev, "probe error %d for '%s'\n", status,
client->name);
@@ -440,7 +437,6 @@ static int pcf857x_remove(struct i2c_client *client)
}
}
- gpiochip_remove(&gpio->chip);
return status;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 35/61] gpio: palmas: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (33 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 34/61] gpio: pcf857x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 36/61] gpio: rc5t583: " Laxman Dewangan
` (26 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-palmas.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index fdfb3b1..6f27b3d 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -195,7 +195,8 @@ static int palmas_gpio_probe(struct platform_device *pdev)
else
palmas_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&palmas_gpio->gpio_chip, palmas_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &palmas_gpio->gpio_chip,
+ palmas_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -205,20 +206,11 @@ static int palmas_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int palmas_gpio_remove(struct platform_device *pdev)
-{
- struct palmas_gpio *palmas_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&palmas_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver palmas_gpio_driver = {
.driver.name = "palmas-gpio",
.driver.owner = THIS_MODULE,
.driver.of_match_table = of_palmas_gpio_match,
.probe = palmas_gpio_probe,
- .remove = palmas_gpio_remove,
};
static int __init palmas_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 36/61] gpio: rc5t583: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (34 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 35/61] gpio: palmas: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 37/61] gpio: rdc321x: " Laxman Dewangan
` (25 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-rc5t583.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-rc5t583.c b/drivers/gpio/gpio-rc5t583.c
index 1e2d210..1d6100f 100644
--- a/drivers/gpio/gpio-rc5t583.c
+++ b/drivers/gpio/gpio-rc5t583.c
@@ -136,15 +136,8 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, rc5t583_gpio);
- return gpiochip_add_data(&rc5t583_gpio->gpio_chip, rc5t583_gpio);
-}
-
-static int rc5t583_gpio_remove(struct platform_device *pdev)
-{
- struct rc5t583_gpio *rc5t583_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&rc5t583_gpio->gpio_chip);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &rc5t583_gpio->gpio_chip,
+ rc5t583_gpio);
}
static struct platform_driver rc5t583_gpio_driver = {
@@ -152,7 +145,6 @@ static struct platform_driver rc5t583_gpio_driver = {
.name = "rc5t583-gpio",
},
.probe = rc5t583_gpio_probe,
- .remove = rc5t583_gpio_remove,
};
static int __init rc5t583_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 37/61] gpio: rdc321x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (35 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 36/61] gpio: rc5t583: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 38/61] gpio: sch: " Laxman Dewangan
` (24 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-rdc321x.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c
index 96ddee3..ec945b9 100644
--- a/drivers/gpio/gpio-rdc321x.c
+++ b/drivers/gpio/gpio-rdc321x.c
@@ -194,23 +194,14 @@ static int rdc321x_gpio_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "registering %d GPIOs\n",
rdc321x_gpio_dev->chip.ngpio);
- return gpiochip_add_data(&rdc321x_gpio_dev->chip, rdc321x_gpio_dev);
-}
-
-static int rdc321x_gpio_remove(struct platform_device *pdev)
-{
- struct rdc321x_gpio *rdc321x_gpio_dev = platform_get_drvdata(pdev);
-
- gpiochip_remove(&rdc321x_gpio_dev->chip);
-
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &rdc321x_gpio_dev->chip,
+ rdc321x_gpio_dev);
}
static struct platform_driver rdc321x_gpio_driver = {
.driver.name = "rdc321x-gpio",
.driver.owner = THIS_MODULE,
.probe = rdc321x_gpio_probe,
- .remove = rdc321x_gpio_remove,
};
module_platform_driver(rdc321x_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 38/61] gpio: sch: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (36 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 37/61] gpio: rdc321x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 39/61] gpio: spear-spics: " Laxman Dewangan
` (23 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-sch.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-sch.c b/drivers/gpio/gpio-sch.c
index 5314ee4..e85e753 100644
--- a/drivers/gpio/gpio-sch.c
+++ b/drivers/gpio/gpio-sch.c
@@ -215,15 +215,7 @@ static int sch_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, sch);
- return gpiochip_add_data(&sch->chip, sch);
-}
-
-static int sch_gpio_remove(struct platform_device *pdev)
-{
- struct sch_gpio *sch = platform_get_drvdata(pdev);
-
- gpiochip_remove(&sch->chip);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &sch->chip, sch);
}
static struct platform_driver sch_gpio_driver = {
@@ -231,7 +223,6 @@ static struct platform_driver sch_gpio_driver = {
.name = "sch_gpio",
},
.probe = sch_gpio_probe,
- .remove = sch_gpio_remove,
};
module_platform_driver(sch_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 39/61] gpio: spear-spics: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (37 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 38/61] gpio: sch: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 40/61] gpio: sta2x11: " Laxman Dewangan
` (22 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-spear-spics.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-spear-spics.c b/drivers/gpio/gpio-spear-spics.c
index 50fb090..7ffd164 100644
--- a/drivers/gpio/gpio-spear-spics.c
+++ b/drivers/gpio/gpio-spear-spics.c
@@ -165,7 +165,7 @@ static int spics_gpio_probe(struct platform_device *pdev)
spics->chip.owner = THIS_MODULE;
spics->last_off = -1;
- ret = gpiochip_add_data(&spics->chip, spics);
+ ret = devm_gpiochip_add_data(&pdev->dev, &spics->chip, spics);
if (ret) {
dev_err(&pdev->dev, "unable to add gpio chip\n");
return ret;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 40/61] gpio: sta2x11: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (38 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 39/61] gpio: spear-spics: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 41/61] gpio: stp-xway: " Laxman Dewangan
` (21 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-sta2x11.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c
index 83af1cb..0d5b8c5 100644
--- a/drivers/gpio/gpio-sta2x11.c
+++ b/drivers/gpio/gpio-sta2x11.c
@@ -409,7 +409,7 @@ static int gsta_probe(struct platform_device *dev)
goto err_free_descs;
}
- err = gpiochip_add_data(&chip->gpio, chip);
+ err = devm_gpiochip_add_data(&dev->dev, &chip->gpio, chip);
if (err < 0) {
dev_err(&dev->dev, "sta2x11 gpio: Can't register (%i)\n",
-err);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 41/61] gpio: stp-xway: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (39 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 40/61] gpio: sta2x11: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 42/61] gpio: sx150x: " Laxman Dewangan
` (20 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-stp-xway.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c
index d11dd48..19e654f 100644
--- a/drivers/gpio/gpio-stp-xway.c
+++ b/drivers/gpio/gpio-stp-xway.c
@@ -258,7 +258,7 @@ static int xway_stp_probe(struct platform_device *pdev)
ret = xway_stp_hw_init(chip);
if (!ret)
- ret = gpiochip_add_data(&chip->gc, chip);
+ ret = devm_gpiochip_add_data(&pdev->dev, &chip->gc, chip);
if (!ret)
dev_info(&pdev->dev, "Init done\n");
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 42/61] gpio: sx150x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (40 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 41/61] gpio: stp-xway: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 43/61] gpio: syscon: " Laxman Dewangan
` (19 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-sx150x.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index e6cff1c..d387eb5 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -687,7 +687,7 @@ static int sx150x_probe(struct i2c_client *client,
if (rc < 0)
return rc;
- rc = gpiochip_add_data(&chip->gpio_chip, chip);
+ rc = devm_gpiochip_add_data(&client->dev, &chip->gpio_chip, chip);
if (rc)
return rc;
@@ -696,25 +696,12 @@ static int sx150x_probe(struct i2c_client *client,
pdata->irq_summary,
pdata->irq_base);
if (rc < 0)
- goto probe_fail_post_gpiochip_add;
+ return rc;
}
i2c_set_clientdata(client, chip);
return 0;
-probe_fail_post_gpiochip_add:
- gpiochip_remove(&chip->gpio_chip);
- return rc;
-}
-
-static int sx150x_remove(struct i2c_client *client)
-{
- struct sx150x_chip *chip;
-
- chip = i2c_get_clientdata(client);
- gpiochip_remove(&chip->gpio_chip);
-
- return 0;
}
static struct i2c_driver sx150x_driver = {
@@ -723,7 +710,6 @@ static struct i2c_driver sx150x_driver = {
.of_match_table = of_match_ptr(sx150x_of_match),
},
.probe = sx150x_probe,
- .remove = sx150x_remove,
.id_table = sx150x_id,
};
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 43/61] gpio: syscon: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (41 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 42/61] gpio: sx150x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 44/61] gpio: tb10x: " Laxman Dewangan
` (18 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-syscon.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index e5c5b62..24b6d64 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -238,15 +238,7 @@ static int syscon_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
- return gpiochip_add_data(&priv->chip, priv);
-}
-
-static int syscon_gpio_remove(struct platform_device *pdev)
-{
- struct syscon_gpio_priv *priv = platform_get_drvdata(pdev);
-
- gpiochip_remove(&priv->chip);
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv);
}
static struct platform_driver syscon_gpio_driver = {
@@ -255,7 +247,6 @@ static struct platform_driver syscon_gpio_driver = {
.of_match_table = syscon_gpio_ids,
},
.probe = syscon_gpio_probe,
- .remove = syscon_gpio_remove,
};
module_platform_driver(syscon_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 44/61] gpio: tb10x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (42 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 43/61] gpio: syscon: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 45/61] gpio: tc3589x: " Laxman Dewangan
` (17 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-tb10x.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/drivers/gpio/gpio-tb10x.c b/drivers/gpio/gpio-tb10x.c
index 5eaec20..80b6959a 100644
--- a/drivers/gpio/gpio-tb10x.c
+++ b/drivers/gpio/gpio-tb10x.c
@@ -205,10 +205,10 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
tb10x_gpio->gc.can_sleep = false;
- ret = gpiochip_add_data(&tb10x_gpio->gc, tb10x_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tb10x_gpio->gc, tb10x_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not add gpiochip.\n");
- goto fail_gpiochip_registration;
+ return ret;
}
platform_set_drvdata(pdev, tb10x_gpio);
@@ -219,7 +219,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
ret = platform_get_irq(pdev, 0);
if (ret < 0) {
dev_err(&pdev->dev, "No interrupt specified.\n");
- goto fail_get_irq;
+ return ret;
}
tb10x_gpio->gc.to_irq = tb10x_gpio_to_irq;
@@ -229,14 +229,13 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
IRQF_TRIGGER_NONE | IRQF_SHARED,
dev_name(&pdev->dev), tb10x_gpio);
if (ret != 0)
- goto fail_request_irq;
+ return ret;
tb10x_gpio->domain = irq_domain_add_linear(dn,
tb10x_gpio->gc.ngpio,
&irq_generic_chip_ops, NULL);
if (!tb10x_gpio->domain) {
- ret = -ENOMEM;
- goto fail_irq_domain;
+ return -ENOMEM;
}
ret = irq_alloc_domain_generic_chips(tb10x_gpio->domain,
@@ -244,7 +243,7 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
handle_edge_irq, IRQ_NOREQUEST, IRQ_NOPROBE,
IRQ_GC_INIT_MASK_CACHE);
if (ret)
- goto fail_irq_domain;
+ return ret;
gc = tb10x_gpio->domain->gc->gc[0];
gc->reg_base = tb10x_gpio->base;
@@ -258,14 +257,6 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
}
return 0;
-
-fail_irq_domain:
-fail_request_irq:
-fail_get_irq:
- gpiochip_remove(&tb10x_gpio->gc);
-fail_gpiochip_registration:
-fail_ioremap:
- return ret;
}
static int tb10x_gpio_remove(struct platform_device *pdev)
@@ -278,7 +269,6 @@ static int tb10x_gpio_remove(struct platform_device *pdev)
kfree(tb10x_gpio->domain->gc);
irq_domain_remove(tb10x_gpio->domain);
}
- gpiochip_remove(&tb10x_gpio->gc);
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 45/61] gpio: tc3589x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (43 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 44/61] gpio: tb10x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 46/61] gpio: tegra: " Laxman Dewangan
` (16 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-tc3589x.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 05a27ec..4f566e6 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -272,7 +272,8 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
return ret;
}
- ret = gpiochip_add_data(&tc3589x_gpio->chip, tc3589x_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tc3589x_gpio->chip,
+ tc3589x_gpio);
if (ret) {
dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
return ret;
@@ -299,20 +300,10 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int tc3589x_gpio_remove(struct platform_device *pdev)
-{
- struct tc3589x_gpio *tc3589x_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&tc3589x_gpio->chip);
-
- return 0;
-}
-
static struct platform_driver tc3589x_gpio_driver = {
.driver.name = "tc3589x-gpio",
.driver.owner = THIS_MODULE,
.probe = tc3589x_gpio_probe,
- .remove = tc3589x_gpio_remove,
};
static int __init tc3589x_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 46/61] gpio: tegra: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (44 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 45/61] gpio: tc3589x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
[not found] ` <1456150130-2668-47-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-02-22 14:08 ` [PATCH 47/61] gpio: timberdale " Laxman Dewangan
` (15 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
---
drivers/gpio/gpio-tegra.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 9a1a7e2..790bb11 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -545,7 +545,7 @@ static int tegra_gpio_probe(struct platform_device *pdev)
tegra_gpio_chip.of_node = pdev->dev.of_node;
- ret = gpiochip_add_data(&tegra_gpio_chip, NULL);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tegra_gpio_chip, NULL);
if (ret < 0) {
irq_domain_remove(irq_domain);
return ret;
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 47/61] gpio: timberdale Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (45 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 46/61] gpio: tegra: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 48/61] gpio: tps6586x: " Laxman Dewangan
` (14 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-timberdale.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c
index a6de10c..f0164ec 100644
--- a/drivers/gpio/gpio-timberdale.c
+++ b/drivers/gpio/gpio-timberdale.c
@@ -279,7 +279,7 @@ static int timbgpio_probe(struct platform_device *pdev)
gc->ngpio = pdata->nr_pins;
gc->can_sleep = false;
- err = gpiochip_add_data(gc, tgpio);
+ err = devm_gpiochip_add_data(&pdev->dev, gc, tgpio);
if (err)
return err;
@@ -320,8 +320,6 @@ static int timbgpio_remove(struct platform_device *pdev)
irq_set_handler_data(irq, NULL);
}
- gpiochip_remove(&tgpio->gpio);
-
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 48/61] gpio: tps6586x: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (46 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 47/61] gpio: timberdale " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 49/61] gpio: tps65910: " Laxman Dewangan
` (13 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-tps6586x.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index 87de548..c88bdc8 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -117,7 +117,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
else
tps6586x_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&tps6586x_gpio->gpio_chip, tps6586x_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tps6586x_gpio->gpio_chip,
+ tps6586x_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -128,19 +129,10 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int tps6586x_gpio_remove(struct platform_device *pdev)
-{
- struct tps6586x_gpio *tps6586x_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&tps6586x_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver tps6586x_gpio_driver = {
.driver.name = "tps6586x-gpio",
.driver.owner = THIS_MODULE,
.probe = tps6586x_gpio_probe,
- .remove = tps6586x_gpio_remove,
};
static int __init tps6586x_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 49/61] gpio: tps65910: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (47 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 48/61] gpio: tps6586x: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 50/61] gpio: tps65912: " Laxman Dewangan
` (12 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-tps65910.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index e81eee7..cdbd7c7 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -170,7 +170,8 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
}
skip_init:
- ret = gpiochip_add_data(&tps65910_gpio->gpio_chip, tps65910_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tps65910_gpio->gpio_chip,
+ tps65910_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -181,19 +182,10 @@ skip_init:
return ret;
}
-static int tps65910_gpio_remove(struct platform_device *pdev)
-{
- struct tps65910_gpio *tps65910_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&tps65910_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver tps65910_gpio_driver = {
.driver.name = "tps65910-gpio",
.driver.owner = THIS_MODULE,
.probe = tps65910_gpio_probe,
- .remove = tps65910_gpio_remove,
};
static int __init tps65910_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 50/61] gpio: tps65912: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (48 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 49/61] gpio: tps65910: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 51/61] gpio: ts4800: " Laxman Dewangan
` (11 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-tps65912.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c
index 4f2029c..e72302d 100644
--- a/drivers/gpio/gpio-tps65912.c
+++ b/drivers/gpio/gpio-tps65912.c
@@ -106,7 +106,8 @@ static int tps65912_gpio_probe(struct platform_device *pdev)
if (pdata && pdata->gpio_base)
tps65912_gpio->gpio_chip.base = pdata->gpio_base;
- ret = gpiochip_add_data(&tps65912_gpio->gpio_chip, tps65912_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &tps65912_gpio->gpio_chip,
+ tps65912_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register gpiochip, %d\n", ret);
return ret;
@@ -117,20 +118,11 @@ static int tps65912_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int tps65912_gpio_remove(struct platform_device *pdev)
-{
- struct tps65912_gpio_data *tps65912_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&tps65912_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver tps65912_gpio_driver = {
.driver = {
.name = "tps65912-gpio",
},
.probe = tps65912_gpio_probe,
- .remove = tps65912_gpio_remove,
};
static int __init tps65912_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 51/61] gpio: ts4800: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (49 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 50/61] gpio: tps65912: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 52/61] gpio: ts5500: " Laxman Dewangan
` (10 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-ts4800.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-ts4800.c b/drivers/gpio/gpio-ts4800.c
index c4908a4..b8762d9 100644
--- a/drivers/gpio/gpio-ts4800.c
+++ b/drivers/gpio/gpio-ts4800.c
@@ -61,16 +61,7 @@ static int ts4800_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, chip);
- return gpiochip_add_data(chip, NULL);
-}
-
-static int ts4800_gpio_remove(struct platform_device *pdev)
-{
- struct gpio_chip *chip = platform_get_drvdata(pdev);
-
- gpiochip_remove(chip);
-
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, chip, NULL);
}
static const struct of_device_id ts4800_gpio_of_match[] = {
@@ -84,7 +75,6 @@ static struct platform_driver ts4800_gpio_driver = {
.of_match_table = ts4800_gpio_of_match,
},
.probe = ts4800_gpio_probe,
- .remove = ts4800_gpio_remove,
};
module_platform_driver_probe(ts4800_gpio_driver, ts4800_gpio_probe);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 52/61] gpio: ts5500: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (50 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 51/61] gpio: ts4800: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 53/61] gpio: twl6040: " Laxman Dewangan
` (9 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and clean the
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-ts5500.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c
index 5f94508..6cfeba0 100644
--- a/drivers/gpio/gpio-ts5500.c
+++ b/drivers/gpio/gpio-ts5500.c
@@ -409,7 +409,7 @@ static int ts5500_dio_probe(struct platform_device *pdev)
break;
}
- ret = gpiochip_add_data(&priv->gpio_chip, priv);
+ ret = devm_gpiochip_add_data(dev, &priv->gpio_chip, priv);
if (ret) {
dev_err(dev, "failed to register the gpio chip\n");
return ret;
@@ -418,13 +418,10 @@ static int ts5500_dio_probe(struct platform_device *pdev)
ret = ts5500_enable_irq(priv);
if (ret) {
dev_err(dev, "invalid interrupt %d\n", priv->hwirq);
- goto cleanup;
+ return ret;
}
return 0;
-cleanup:
- gpiochip_remove(&priv->gpio_chip);
- return ret;
}
static int ts5500_dio_remove(struct platform_device *pdev)
@@ -432,7 +429,7 @@ static int ts5500_dio_remove(struct platform_device *pdev)
struct ts5500_priv *priv = platform_get_drvdata(pdev);
ts5500_disable_irq(priv);
- gpiochip_remove(&priv->gpio_chip);
+
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 53/61] gpio: twl6040: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (51 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 52/61] gpio: ts5500: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 54/61] gpio: ucb1400: " Laxman Dewangan
` (8 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-twl6040.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index 8e9e985..b780314 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -100,7 +100,7 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
#endif
- ret = gpiochip_add_data(&twl6040gpo_chip, NULL);
+ ret = devm_gpiochip_add_data(&pdev->dev, &twl6040gpo_chip, NULL);
if (ret < 0) {
dev_err(&pdev->dev, "could not register gpiochip, %d\n", ret);
twl6040gpo_chip.ngpio = 0;
@@ -109,12 +109,6 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
return ret;
}
-static int gpo_twl6040_remove(struct platform_device *pdev)
-{
- gpiochip_remove(&twl6040gpo_chip);
- return 0;
-}
-
/* Note: this hardware lives inside an I2C-based multi-function device. */
MODULE_ALIAS("platform:twl6040-gpo");
@@ -123,7 +117,6 @@ static struct platform_driver gpo_twl6040_driver = {
.name = "twl6040-gpo",
},
.probe = gpo_twl6040_probe,
- .remove = gpo_twl6040_remove,
};
module_platform_driver(gpo_twl6040_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 54/61] gpio: ucb1400: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (52 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 53/61] gpio: twl6040: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 55/61] gpio: viperboard: " Laxman Dewangan
` (7 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-ucb1400.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c
index 2c5cd46..5dbe31b 100644
--- a/drivers/gpio/gpio-ucb1400.c
+++ b/drivers/gpio/gpio-ucb1400.c
@@ -67,7 +67,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
ucb->gc.set = ucb1400_gpio_set;
ucb->gc.can_sleep = true;
- err = gpiochip_add_data(&ucb->gc, ucb);
+ err = devm_gpiochip_add_data(&dev->dev, &ucb->gc, ucb);
if (err)
goto err;
@@ -90,7 +90,6 @@ static int ucb1400_gpio_remove(struct platform_device *dev)
return err;
}
- gpiochip_remove(&ucb->gc);
return err;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 55/61] gpio: viperboard: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (53 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 54/61] gpio: ucb1400: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 56/61] gpio: vx855: " Laxman Dewangan
` (6 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-viperboard.c | 24 ++++--------------------
1 file changed, 4 insertions(+), 20 deletions(-)
diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
index 1170b03..dec47aa 100644
--- a/drivers/gpio/gpio-viperboard.c
+++ b/drivers/gpio/gpio-viperboard.c
@@ -410,10 +410,10 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
vb_gpio->gpioa.get = vprbrd_gpioa_get;
vb_gpio->gpioa.direction_input = vprbrd_gpioa_direction_input;
vb_gpio->gpioa.direction_output = vprbrd_gpioa_direction_output;
- ret = gpiochip_add_data(&vb_gpio->gpioa, vb_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &vb_gpio->gpioa, vb_gpio);
if (ret < 0) {
dev_err(vb_gpio->gpioa.parent, "could not add gpio a");
- goto err_gpioa;
+ return ret;
}
/* registering gpio b */
@@ -427,37 +427,21 @@ static int vprbrd_gpio_probe(struct platform_device *pdev)
vb_gpio->gpiob.get = vprbrd_gpiob_get;
vb_gpio->gpiob.direction_input = vprbrd_gpiob_direction_input;
vb_gpio->gpiob.direction_output = vprbrd_gpiob_direction_output;
- ret = gpiochip_add_data(&vb_gpio->gpiob, vb_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &vb_gpio->gpiob, vb_gpio);
if (ret < 0) {
dev_err(vb_gpio->gpiob.parent, "could not add gpio b");
- goto err_gpiob;
+ return ret;
}
platform_set_drvdata(pdev, vb_gpio);
return ret;
-
-err_gpiob:
- gpiochip_remove(&vb_gpio->gpioa);
-
-err_gpioa:
- return ret;
-}
-
-static int vprbrd_gpio_remove(struct platform_device *pdev)
-{
- struct vprbrd_gpio *vb_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&vb_gpio->gpiob);
-
- return 0;
}
static struct platform_driver vprbrd_gpio_driver = {
.driver.name = "viperboard-gpio",
.driver.owner = THIS_MODULE,
.probe = vprbrd_gpio_probe,
- .remove = vprbrd_gpio_remove,
};
static int __init vprbrd_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 56/61] gpio: vx855: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (54 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 55/61] gpio: viperboard: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 57/61] gpio: wm8350: " Laxman Dewangan
` (5 subsequent siblings)
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-vx855.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/drivers/gpio/gpio-vx855.c b/drivers/gpio/gpio-vx855.c
index 764999c..8cdb9f7 100644
--- a/drivers/gpio/gpio-vx855.c
+++ b/drivers/gpio/gpio-vx855.c
@@ -259,16 +259,7 @@ static int vx855gpio_probe(struct platform_device *pdev)
vx855gpio_gpio_setup(vg);
- return gpiochip_add_data(&vg->gpio, vg);
-}
-
-static int vx855gpio_remove(struct platform_device *pdev)
-{
- struct vx855_gpio *vg = platform_get_drvdata(pdev);
-
- gpiochip_remove(&vg->gpio);
-
- return 0;
+ return devm_gpiochip_add_data(&pdev->dev, &vg->gpio, vg);
}
static struct platform_driver vx855gpio_driver = {
@@ -276,7 +267,6 @@ static struct platform_driver vx855gpio_driver = {
.name = MODULE_NAME,
},
.probe = vx855gpio_probe,
- .remove = vx855gpio_remove,
};
module_platform_driver(vx855gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 57/61] gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (55 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 56/61] gpio: vx855: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 16:29 ` Charles Keepax
2016-02-22 14:08 ` [PATCH 58/61] " Laxman Dewangan
` (4 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
---
drivers/gpio/gpio-wm831x.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 9839007..18cb0f5 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -259,7 +259,8 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
else
wm831x_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&wm831x_gpio->gpio_chip, wm831x_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip,
+ wm831x_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -270,19 +271,10 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int wm831x_gpio_remove(struct platform_device *pdev)
-{
- struct wm831x_gpio *wm831x_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&wm831x_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver wm831x_gpio_driver = {
.driver.name = "wm831x-gpio",
.driver.owner = THIS_MODULE,
.probe = wm831x_gpio_probe,
- .remove = wm831x_gpio_remove,
};
static int __init wm831x_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 57/61] gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:08 ` [PATCH 57/61] gpio: wm8350: " Laxman Dewangan
@ 2016-02-22 16:29 ` Charles Keepax
0 siblings, 0 replies; 78+ messages in thread
From: Charles Keepax @ 2016-02-22 16:29 UTC (permalink / raw)
To: Laxman Dewangan
Cc: gnurou, patches, catalin.marinas, shc_work, michael.hennerich,
corbet, linux-tegra, rjui, linus.walleij, swarren, linux-doc,
linux-kernel, linux-gpio, thierry.reding, albeu, bjorn.andersson,
gregkh, a.kesavan, bcm-kernel-feedback-list, linux-arm-kernel,
support.opensource
On Mon, Feb 22, 2016 at 07:38:46PM +0530, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> need of driver callback .remove.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: patches@opensource.wolfsonmicro.com
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 58/61] gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (56 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 57/61] gpio: wm8350: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 16:29 ` Charles Keepax
2016-02-22 14:08 ` [PATCH 59/61] gpio: wm8994: " Laxman Dewangan
` (3 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
---
drivers/gpio/gpio-wm8350.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c
index 0a306b4..07d45a3 100644
--- a/drivers/gpio/gpio-wm8350.c
+++ b/drivers/gpio/gpio-wm8350.c
@@ -125,7 +125,8 @@ static int wm8350_gpio_probe(struct platform_device *pdev)
else
wm8350_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&wm8350_gpio->gpio_chip, wm8350_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &wm8350_gpio->gpio_chip,
+ wm8350_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n", ret);
return ret;
@@ -136,19 +137,10 @@ static int wm8350_gpio_probe(struct platform_device *pdev)
return ret;
}
-static int wm8350_gpio_remove(struct platform_device *pdev)
-{
- struct wm8350_gpio_data *wm8350_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&wm8350_gpio->gpio_chip);
- return 0;
-}
-
static struct platform_driver wm8350_gpio_driver = {
.driver.name = "wm8350-gpio",
.driver.owner = THIS_MODULE,
.probe = wm8350_gpio_probe,
- .remove = wm8350_gpio_remove,
};
static int __init wm8350_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 58/61] gpio: wm8350: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:08 ` [PATCH 58/61] " Laxman Dewangan
@ 2016-02-22 16:29 ` Charles Keepax
0 siblings, 0 replies; 78+ messages in thread
From: Charles Keepax @ 2016-02-22 16:29 UTC (permalink / raw)
To: Laxman Dewangan
Cc: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding,
bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On Mon, Feb 22, 2016 at 07:38:47PM +0530, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> need of driver callback .remove.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: patches@opensource.wolfsonmicro.com
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 59/61] gpio: wm8994: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (57 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 58/61] " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 16:29 ` Charles Keepax
2016-02-22 14:08 ` [PATCH 60/61] gpio: xgene-sb: " Laxman Dewangan
` (2 subsequent siblings)
61 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: patches@opensource.wolfsonmicro.com
---
drivers/gpio/gpio-wm8994.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index 3ae4c15..b089df9 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -261,34 +261,23 @@ static int wm8994_gpio_probe(struct platform_device *pdev)
else
wm8994_gpio->gpio_chip.base = -1;
- ret = gpiochip_add_data(&wm8994_gpio->gpio_chip, wm8994_gpio);
+ ret = devm_gpiochip_add_data(&pdev->dev, &wm8994_gpio->gpio_chip,
+ wm8994_gpio);
if (ret < 0) {
dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
ret);
- goto err;
+ return ret;
}
platform_set_drvdata(pdev, wm8994_gpio);
return ret;
-
-err:
- return ret;
-}
-
-static int wm8994_gpio_remove(struct platform_device *pdev)
-{
- struct wm8994_gpio *wm8994_gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&wm8994_gpio->gpio_chip);
- return 0;
}
static struct platform_driver wm8994_gpio_driver = {
.driver.name = "wm8994-gpio",
.driver.owner = THIS_MODULE,
.probe = wm8994_gpio_probe,
- .remove = wm8994_gpio_remove,
};
static int __init wm8994_gpio_init(void)
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 59/61] gpio: wm8994: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:08 ` [PATCH 59/61] gpio: wm8994: " Laxman Dewangan
@ 2016-02-22 16:29 ` Charles Keepax
0 siblings, 0 replies; 78+ messages in thread
From: Charles Keepax @ 2016-02-22 16:29 UTC (permalink / raw)
To: Laxman Dewangan
Cc: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding,
bjorn.andersson, a.kesavan, gregkh, catalin.marinas, linux-doc,
linux-kernel, linux-gpio, patches, bcm-kernel-feedback-list,
linux-arm-kernel, linux-tegra
On Mon, Feb 22, 2016 at 07:38:48PM +0530, Laxman Dewangan wrote:
> Use devm_gpiochip_add_data() for GPIO registration and remove the
> need of driver callback .remove.
>
> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: patches@opensource.wolfsonmicro.com
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 78+ messages in thread
* [PATCH 60/61] gpio: xgene-sb: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (58 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 59/61] gpio: wm8994: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:08 ` [PATCH 61/61] gpio: xgene: " Laxman Dewangan
2016-02-22 14:44 ` [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Linus Walleij
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-xgene-sb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xgene-sb.c b/drivers/gpio/gpio-xgene-sb.c
index 282004d..e665770 100644
--- a/drivers/gpio/gpio-xgene-sb.c
+++ b/drivers/gpio/gpio-xgene-sb.c
@@ -116,7 +116,7 @@ static int xgene_gpio_sb_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, priv);
- ret = gpiochip_add_data(&priv->gc, priv);
+ ret = devm_gpiochip_add_data(&pdev->dev, &priv->gc, priv);
if (ret)
dev_err(&pdev->dev, "failed to register X-Gene GPIO Standby driver\n");
else
@@ -138,7 +138,6 @@ static int xgene_gpio_sb_remove(struct platform_device *pdev)
acpi_gpiochip_free_interrupts(&priv->gc);
}
- gpiochip_remove(&priv->gc);
return 0;
}
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* [PATCH 61/61] gpio: xgene: Use devm_gpiochip_add_data() for gpio registration
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (59 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 60/61] gpio: xgene-sb: " Laxman Dewangan
@ 2016-02-22 14:08 ` Laxman Dewangan
2016-02-22 14:44 ` [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Linus Walleij
61 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-22 14:08 UTC (permalink / raw)
To: linus.walleij, gnurou, michael.hennerich, corbet, albeu, rjui,
shc_work, support.opensource, swarren, thierry.reding
Cc: ldewangan, bjorn.andersson, a.kesavan, gregkh, catalin.marinas,
linux-doc, linux-kernel, linux-gpio, patches,
bcm-kernel-feedback-list, linux-arm-kernel, linux-tegra
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/gpio/gpio-xgene.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 592e9cd..c0aa387 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -193,7 +193,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpio);
- err = gpiochip_add_data(&gpio->chip, gpio);
+ err = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
if (err) {
dev_err(&pdev->dev,
"failed to register gpiochip.\n");
@@ -207,14 +207,6 @@ err:
return err;
}
-static int xgene_gpio_remove(struct platform_device *pdev)
-{
- struct xgene_gpio *gpio = platform_get_drvdata(pdev);
-
- gpiochip_remove(&gpio->chip);
- return 0;
-}
-
static const struct of_device_id xgene_gpio_of_match[] = {
{ .compatible = "apm,xgene-gpio", },
{},
@@ -228,7 +220,6 @@ static struct platform_driver xgene_gpio_driver = {
.pm = XGENE_GPIO_PM_OPS,
},
.probe = xgene_gpio_probe,
- .remove = xgene_gpio_remove,
};
module_platform_driver(xgene_gpio_driver);
--
2.1.4
^ permalink raw reply related [flat|nested] 78+ messages in thread
* Re: [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data()
2016-02-22 14:07 [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Laxman Dewangan
` (60 preceding siblings ...)
2016-02-22 14:08 ` [PATCH 61/61] gpio: xgene: " Laxman Dewangan
@ 2016-02-22 14:44 ` Linus Walleij
2016-02-23 9:01 ` Laxman Dewangan
61 siblings, 1 reply; 78+ messages in thread
From: Linus Walleij @ 2016-02-22 14:44 UTC (permalink / raw)
To: Laxman Dewangan
Cc: Alexandre Courbot, Michael Hennerich, Jon Corbet, Alban Bedel,
Ray Jui, Alexander Shiyan, Support Opensource, Stephen Warren,
Thierry Reding, Andersson, Björn, Abhilash Kesavan, Greg KH,
Catalin Marinas, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
open list:WOLFSON MICROELECTRONICS DRIVERS,
bcm-kernel-feedback-list
On Mon, Feb 22, 2016 at 3:07 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> Add resource management APIs for gpiochip_add_data() and
> gpiochip_remove() and use these APIs from different HW drivers.
>
> This is based on discussion on patch to use the new APIs.
> gpio: Add devm_ apis for gpio_chip_add and remove
Awesome!
Do you have a git I can just pull these off so I don't have to apply
then all one-by-one?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 78+ messages in thread
* Re: [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data()
2016-02-22 14:44 ` [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data() Linus Walleij
@ 2016-02-23 9:01 ` Laxman Dewangan
2016-02-23 15:15 ` Laxman Dewangan
0 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-23 9:01 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Courbot, Michael Hennerich, Jon Corbet, Alban Bedel,
Ray Jui, Alexander Shiyan, Support Opensource, Stephen Warren,
Thierry Reding, "Andersson, Björn", Abhilash Kesavan,
Greg KH, Catalin Marinas, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
WOLFSON MICROELECTRONICS DRIVERS, bcm-kernel-feedback-list
On Monday 22 February 2016 08:14 PM, Linus Walleij wrote:
> On Mon, Feb 22, 2016 at 3:07 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>
>> Add resource management APIs for gpiochip_add_data() and
>> gpiochip_remove() and use these APIs from different HW drivers.
>>
>> This is based on discussion on patch to use the new APIs.
>> gpio: Add devm_ apis for gpio_chip_add and remove
> Awesome!
>
> Do you have a git I can just pull these off so I don't have to apply
> then all one-by-one?
Nop, I do not have the git repo for sharing as of now at this time.
Trying to learn to how to create.
^ permalink raw reply [flat|nested] 78+ messages in thread
* Re: [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data()
2016-02-23 9:01 ` Laxman Dewangan
@ 2016-02-23 15:15 ` Laxman Dewangan
2016-02-25 13:24 ` Linus Walleij
0 siblings, 1 reply; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-23 15:15 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Courbot, Michael Hennerich, Jon Corbet, Alban Bedel,
Ray Jui, Alexander Shiyan, Support Opensource, Stephen Warren,
Thierry Reding, "Andersson, Björn", Abhilash Kesavan,
Greg KH, Catalin Marinas, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
WOLFSON MICROELECTRONICS DRIVERS, bcm-kernel-feedback-list
Hi Linus,
On Tuesday 23 February 2016 02:31 PM, Laxman Dewangan wrote:
>
> On Monday 22 February 2016 08:14 PM, Linus Walleij wrote:
>> On Mon, Feb 22, 2016 at 3:07 PM, Laxman Dewangan
>> <ldewangan@nvidia.com> wrote:
>>
>>> Add resource management APIs for gpiochip_add_data() and
>>> gpiochip_remove() and use these APIs from different HW drivers.
>>>
>>> This is based on discussion on patch to use the new APIs.
>>> gpio: Add devm_ apis for gpio_chip_add and remove
>> Awesome!
>>
>> Do you have a git I can just pull these off so I don't have to apply
>> then all one-by-one?
>
>
> Nop, I do not have the git repo for sharing as of now at this time.
> Trying to learn to how to create.
>
I have made the repo in git hub as
https://github.com/ldewangan/linux-upstream.git
branch name is devm_gpiochip.
https://github.com/ldewangan/linux-upstream/tree/devm_gpiochip
I am not sure that it will work or not but I have pushed all changes to
this repo/branch.
This is on top of your repo
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
branch gpio-fornext
I collected acked by and also added in patch.
Thanks,
Laxman
^ permalink raw reply [flat|nested] 78+ messages in thread
* Re: [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data()
2016-02-23 15:15 ` Laxman Dewangan
@ 2016-02-25 13:24 ` Linus Walleij
2016-02-28 14:32 ` Laxman Dewangan
0 siblings, 1 reply; 78+ messages in thread
From: Linus Walleij @ 2016-02-25 13:24 UTC (permalink / raw)
To: Laxman Dewangan
Cc: Alexandre Courbot, Michael Hennerich, Jon Corbet, Alban Bedel,
Ray Jui, Alexander Shiyan, Support Opensource, Stephen Warren,
Thierry Reding, Andersson, Björn, Abhilash Kesavan, Greg KH,
Catalin Marinas, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
WOLFSON MICROELECTRONICS DRIVERS, bcm-kernel-feedback-list
On Tue, Feb 23, 2016 at 4:15 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
> I have made the repo in git hub as
> https://github.com/ldewangan/linux-upstream.git
Awesome.
> branch name is devm_gpiochip.
> https://github.com/ldewangan/linux-upstream/tree/devm_gpiochip
I've pulled this branch into my tree on a separate branch for
testing. I pushed the tree to kernel.org so that the zeroday
autobuilders can have a go at it.
If everything goes well I plan to merge this for v4.6, then we
can merge the changes in pin control and other subsystems
for v4.7.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 78+ messages in thread
* Re: [PATCH 00/61] gpio: Add and use devm_gpiochip_add_data()
2016-02-25 13:24 ` Linus Walleij
@ 2016-02-28 14:32 ` Laxman Dewangan
0 siblings, 0 replies; 78+ messages in thread
From: Laxman Dewangan @ 2016-02-28 14:32 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexandre Courbot, Michael Hennerich, Jon Corbet, Alban Bedel,
Ray Jui, Alexander Shiyan, Support Opensource, Stephen Warren,
Thierry Reding, "Andersson, Björn", Abhilash Kesavan,
Greg KH, Catalin Marinas, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
WOLFSON MICROELECTRONICS DRIVERS, bcm-kernel-feedback-list
On Thursday 25 February 2016 06:54 PM, Linus Walleij wrote:
> On Tue, Feb 23, 2016 at 4:15 PM, Laxman Dewangan <ldewangan@nvidia.com> wrote:
>
>> I have made the repo in git hub as
>> https://github.com/ldewangan/linux-upstream.git
> Awesome.
>
>> branch name is devm_gpiochip.
>> https://github.com/ldewangan/linux-upstream/tree/devm_gpiochip
> I've pulled this branch into my tree on a separate branch for
> testing. I pushed the tree to kernel.org so that the zeroday
> autobuilders can have a go at it.
Thanks you very much for taking care.
>
> If everything goes well I plan to merge this for v4.6, then we
> can merge the changes in pin control and other subsystems
> for v4.7.
Yes, once this is there, we can grep all over subsystem and push the change.
I am seeing lots of code reduction on pincontrol driver side once we
have devm_ for pincontrol register and gpiochip_add_data().
Thanks,
Laxman
^ permalink raw reply [flat|nested] 78+ messages in thread