gpio: ath79: order headers alphabetically
Subsystems (2)
PATCH 1/4 gpio: ath79: order headers alphabetically
From: Bartosz Golaszewski <[email protected]>
Put all headers in alphabetical order.
--- drivers/gpio/gpio-ath79.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpio/gpio-ath79.c +4 -4
@@ -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
Signature · 1 line
2.43.0
PATCH 2/4 gpio: ath79: add missing header
From: Bartosz Golaszewski <[email protected]>
Include mod_devicetable.h for struct of_device_id and its helpers.
--- drivers/gpio/gpio-ath79.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-ath79.c +1 -0
@@ -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>
Signature · 1 line
2.43.0
PATCH 3/4 gpio: ath79: use generic device property getters
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
Don't use specialized OF accessors if we can avoid it: switch to using the generic device property helpers.
--- drivers/gpio/gpio-ath79.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpio/gpio-ath79.c +4 -4
@@ -8,12 +8,12 @@* Copyright (C) 2008 Imre Kaloz <[email protected]> */ +#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;
Signature · 1 line
2.43.0
PATCH 4/4 gpio: ath79: remove support for platform data
In reply to Bartosz GolaszewskiFrom: Bartosz Golaszewski <[email protected]>
There are no more board files defining platform data for this driver so remove the header and support from the driver.
--- 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
drivers/gpio/gpio-ath79.c +6 -16
@@ -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 ;
include/linux/platform_data/gpio-ath79.h deleted +0 -16
@@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* Atheros AR7XXX/AR9XXX GPIO controller platform data -* -* Copyright (C) 2015 Alban Bedel <[email protected]> -*/ - -#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
Signature · 1 line
2.43.0
Quoted 5 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
Put all headers in alphabetical order.
Signed-off-by Bartosz Golaszewski <[email protected]>
The series:
Yours,
Linus Walleij
Bartosz Golaszewski
AppliedFrom: Bartosz Golaszewski <[email protected]>
Quoted 3 lines · Bartosz Golaszewski
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: c4a315eaf8eff0d3234600e13db7e7c71c0b3405Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>