* [PATCH 1/4] gpio: ath79: order headers alphabetically
@ 2024-08-21 12:14 Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 2/4] gpio: ath79: add missing header Bartosz Golaszewski
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-08-21 12:14 UTC (permalink / raw)
To: Alban Bedel, Linus Walleij; +Cc: linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Put all headers in alphabetical order.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-ath79.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index 6211d99a5770..be2952fdae3b 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -9,12 +9,12 @@
*/
#include <linux/gpio/driver.h>
-#include <linux/platform_device.h>
-#include <linux/platform_data/gpio-ath79.h>
-#include <linux/of.h>
#include <linux/interrupt.h>
-#include <linux/module.h>
#include <linux/irq.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_data/gpio-ath79.h>
+#include <linux/platform_device.h>
#define AR71XX_GPIO_REG_OE 0x00
#define AR71XX_GPIO_REG_IN 0x04
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] gpio: ath79: add missing header
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
@ 2024-08-21 12:14 ` Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 3/4] gpio: ath79: use generic device property getters Bartosz Golaszewski
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-08-21 12:14 UTC (permalink / raw)
To: Alban Bedel, Linus Walleij; +Cc: linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Include mod_devicetable.h for struct of_device_id and its helpers.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-ath79.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index be2952fdae3b..7f9e66d75c8b 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -11,6 +11,7 @@
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/gpio-ath79.h>
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] gpio: ath79: use generic device property getters
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 2/4] gpio: ath79: add missing header Bartosz Golaszewski
@ 2024-08-21 12:14 ` Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 4/4] gpio: ath79: remove support for platform data Bartosz Golaszewski
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-08-21 12:14 UTC (permalink / raw)
To: Alban Bedel, Linus Walleij; +Cc: linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Don't use specialized OF accessors if we can avoid it: switch to using
the generic device property helpers.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-ath79.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index 7f9e66d75c8b..211faffbef32 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -8,12 +8,12 @@
* Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
*/
+#include <linux/device.h>
#include <linux/gpio/driver.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/of.h>
#include <linux/platform_data/gpio-ath79.h>
#include <linux/platform_device.h>
@@ -239,12 +239,12 @@ static int ath79_gpio_probe(struct platform_device *pdev)
return -ENOMEM;
if (np) {
- err = of_property_read_u32(np, "ngpios", &ath79_gpio_count);
+ err = device_property_read_u32(dev, "ngpios", &ath79_gpio_count);
if (err) {
dev_err(dev, "ngpios property is not valid\n");
return err;
}
- oe_inverted = of_device_is_compatible(np, "qca,ar9340-gpio");
+ oe_inverted = device_is_compatible(dev, "qca,ar9340-gpio");
} else if (pdata) {
ath79_gpio_count = pdata->ngpios;
oe_inverted = pdata->oe_inverted;
@@ -276,7 +276,7 @@ static int ath79_gpio_probe(struct platform_device *pdev)
}
/* Optional interrupt setup */
- if (!np || of_property_read_bool(np, "interrupt-controller")) {
+ if (device_property_read_bool(dev, "interrupt-controller")) {
girq = &ctrl->gc.irq;
gpio_irq_chip_set_chip(girq, &ath79_gpio_irqchip);
girq->parent_handler = ath79_gpio_irq_handler;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] gpio: ath79: remove support for platform data
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 2/4] gpio: ath79: add missing header Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 3/4] gpio: ath79: use generic device property getters Bartosz Golaszewski
@ 2024-08-21 12:14 ` Bartosz Golaszewski
2024-08-26 8:23 ` [PATCH 1/4] gpio: ath79: order headers alphabetically Linus Walleij
2024-09-02 9:10 ` Bartosz Golaszewski
4 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-08-21 12:14 UTC (permalink / raw)
To: Alban Bedel, Linus Walleij; +Cc: linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
There are no more board files defining platform data for this driver so
remove the header and support from the driver.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpio-ath79.c | 22 ++++++----------------
include/linux/platform_data/gpio-ath79.h | 16 ----------------
2 files changed, 6 insertions(+), 32 deletions(-)
delete mode 100644 include/linux/platform_data/gpio-ath79.h
diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index 211faffbef32..de4cc12e5e03 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -14,7 +14,6 @@
#include <linux/irq.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
-#include <linux/platform_data/gpio-ath79.h>
#include <linux/platform_device.h>
#define AR71XX_GPIO_REG_OE 0x00
@@ -225,9 +224,7 @@ MODULE_DEVICE_TABLE(of, ath79_gpio_of_match);
static int ath79_gpio_probe(struct platform_device *pdev)
{
- struct ath79_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct device *dev = &pdev->dev;
- struct device_node *np = dev->of_node;
struct ath79_gpio_ctrl *ctrl;
struct gpio_irq_chip *girq;
u32 ath79_gpio_count;
@@ -238,21 +235,14 @@ static int ath79_gpio_probe(struct platform_device *pdev)
if (!ctrl)
return -ENOMEM;
- if (np) {
- err = device_property_read_u32(dev, "ngpios", &ath79_gpio_count);
- if (err) {
- dev_err(dev, "ngpios property is not valid\n");
- return err;
- }
- oe_inverted = device_is_compatible(dev, "qca,ar9340-gpio");
- } else if (pdata) {
- ath79_gpio_count = pdata->ngpios;
- oe_inverted = pdata->oe_inverted;
- } else {
- dev_err(dev, "No DT node or platform data found\n");
- return -EINVAL;
+ err = device_property_read_u32(dev, "ngpios", &ath79_gpio_count);
+ if (err) {
+ dev_err(dev, "ngpios property is not valid\n");
+ return err;
}
+ oe_inverted = device_is_compatible(dev, "qca,ar9340-gpio");
+
if (ath79_gpio_count >= 32) {
dev_err(dev, "ngpios must be less than 32\n");
return -EINVAL;
diff --git a/include/linux/platform_data/gpio-ath79.h b/include/linux/platform_data/gpio-ath79.h
deleted file mode 100644
index 3ea6dd942c27..000000000000
--- a/include/linux/platform_data/gpio-ath79.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Atheros AR7XXX/AR9XXX GPIO controller platform data
- *
- * Copyright (C) 2015 Alban Bedel <albeu@free.fr>
- */
-
-#ifndef __LINUX_PLATFORM_DATA_GPIO_ATH79_H
-#define __LINUX_PLATFORM_DATA_GPIO_ATH79_H
-
-struct ath79_gpio_platform_data {
- unsigned ngpios;
- bool oe_inverted;
-};
-
-#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] gpio: ath79: order headers alphabetically
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
` (2 preceding siblings ...)
2024-08-21 12:14 ` [PATCH 4/4] gpio: ath79: remove support for platform data Bartosz Golaszewski
@ 2024-08-26 8:23 ` Linus Walleij
2024-09-02 9:10 ` Bartosz Golaszewski
4 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2024-08-26 8:23 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Alban Bedel, linux-kernel, linux-gpio, Bartosz Golaszewski
On Wed, Aug 21, 2024 at 2:15 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Put all headers in alphabetical order.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
The series:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] gpio: ath79: order headers alphabetically
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
` (3 preceding siblings ...)
2024-08-26 8:23 ` [PATCH 1/4] gpio: ath79: order headers alphabetically Linus Walleij
@ 2024-09-02 9:10 ` Bartosz Golaszewski
4 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2024-09-02 9:10 UTC (permalink / raw)
To: Alban Bedel, Linus Walleij, Bartosz Golaszewski
Cc: Bartosz Golaszewski, linux-kernel, linux-gpio
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Wed, 21 Aug 2024 14:14:53 +0200, Bartosz Golaszewski wrote:
> Put all headers in alphabetical order.
>
>
Applied, thanks!
[1/4] gpio: ath79: order headers alphabetically
commit: 7b4b93e260c684d346998a3dddc5335957b8be78
[2/4] gpio: ath79: add missing header
commit: 4acde50b4d15373b55ff23424526378efa681dc6
[3/4] gpio: ath79: use generic device property getters
commit: 10a968b21b89c647faa26b1f06ea82aa2eef1f9a
[4/4] gpio: ath79: remove support for platform data
commit: c4a315eaf8eff0d3234600e13db7e7c71c0b3405
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-09-02 9:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 12:14 [PATCH 1/4] gpio: ath79: order headers alphabetically Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 2/4] gpio: ath79: add missing header Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 3/4] gpio: ath79: use generic device property getters Bartosz Golaszewski
2024-08-21 12:14 ` [PATCH 4/4] gpio: ath79: remove support for platform data Bartosz Golaszewski
2024-08-26 8:23 ` [PATCH 1/4] gpio: ath79: order headers alphabetically Linus Walleij
2024-09-02 9:10 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox