All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data()
@ 2018-04-30  7:38 Thierry Reding
  2018-04-30  7:38 ` [PATCH 02/12] gpio: dwapb: " Thierry Reding
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-74xx-mmio.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index 0475e8ec96d0..49616ec815ee 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -105,27 +105,22 @@ static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
 
 static int mmio_74xx_gpio_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id;
 	struct mmio_74xx_gpio_priv *priv;
 	struct resource *res;
 	void __iomem *dat;
 	int err;
 
-	of_id = of_match_device(mmio_74xx_gpio_ids, &pdev->dev);
-	if (!of_id)
-		return -ENODEV;
-
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
+	priv->flags = (uintptr_t)of_device_get_match_data(&pdev->dev);
+
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dat = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(dat))
 		return PTR_ERR(dat);
 
-	priv->flags = (uintptr_t) of_id->data;
-
 	err = bgpio_init(&priv->gc, &pdev->dev,
 			 DIV_ROUND_UP(MMIO_74XX_BIT_CNT(priv->flags), 8),
 			 dat, NULL, NULL, NULL, NULL, 0);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 02/12] gpio: dwapb: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 03/12] gpio: ge: " Thierry Reding
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-dwapb.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 226977f78482..c25fa72d499f 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -684,13 +684,7 @@ static int dwapb_gpio_probe(struct platform_device *pdev)
 
 	gpio->flags = 0;
 	if (dev->of_node) {
-		const struct of_device_id *of_devid;
-
-		of_devid = of_match_device(dwapb_of_match, dev);
-		if (of_devid) {
-			if (of_devid->data)
-				gpio->flags = (uintptr_t)of_devid->data;
-		}
+		gpio->flags = (uintptr_t)of_device_get_match_data(dev);
 	} else if (has_acpi_companion(dev)) {
 		const struct acpi_device_id *acpi_id;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 03/12] gpio: ge: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
  2018-04-30  7:38 ` [PATCH 02/12] gpio: dwapb: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 04/12] gpio: ingenic: " Thierry Reding
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-ge.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 1fe2d3418f2f..4c43562434cf 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -52,8 +52,6 @@ MODULE_DEVICE_TABLE(of, gef_gpio_ids);
 
 static int __init gef_gpio_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id =
-		of_match_device(gef_gpio_ids, &pdev->dev);
 	struct gpio_chip *gc;
 	void __iomem *regs;
 	int ret;
@@ -82,7 +80,7 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 	}
 
 	gc->base = -1;
-	gc->ngpio = (u16)(uintptr_t)of_id->data;
+	gc->ngpio = (u16)of_device_get_match_data(&pdev->dev);
 	gc->of_gpio_n_cells = 2;
 	gc->of_node = pdev->dev.of_node;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 04/12] gpio: ingenic: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
  2018-04-30  7:38 ` [PATCH 02/12] gpio: dwapb: " Thierry Reding
  2018-04-30  7:38 ` [PATCH 03/12] gpio: ge: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 05/12] gpio: mxs: " Thierry Reding
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-ingenic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-ingenic.c b/drivers/gpio/gpio-ingenic.c
index 15fb2bc796a8..e738e384a5ca 100644
--- a/drivers/gpio/gpio-ingenic.c
+++ b/drivers/gpio/gpio-ingenic.c
@@ -285,8 +285,6 @@ MODULE_DEVICE_TABLE(of, ingenic_gpio_of_match);
 static int ingenic_gpio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	const struct of_device_id *of_id = of_match_device(
-			ingenic_gpio_of_match, dev);
 	struct ingenic_gpio_chip *jzgc;
 	u32 bank;
 	int err;
@@ -323,7 +321,7 @@ static int ingenic_gpio_probe(struct platform_device *pdev)
 	jzgc->gc.parent = dev;
 	jzgc->gc.of_node = dev->of_node;
 	jzgc->gc.owner = THIS_MODULE;
-	jzgc->version = (enum jz_version)of_id->data;
+	jzgc->version = (enum jz_version)of_device_get_match_data(dev);
 
 	jzgc->gc.set = ingenic_gpio_set;
 	jzgc->gc.get = ingenic_gpio_get;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 05/12] gpio: mxs: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (2 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 04/12] gpio: ingenic: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 06/12] gpio: palmas: " Thierry Reding
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-mxs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index 435def22445d..5ad8d4db74db 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -290,8 +290,6 @@ MODULE_DEVICE_TABLE(of, mxs_gpio_dt_ids);
 
 static int mxs_gpio_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id =
-			of_match_device(mxs_gpio_dt_ids, &pdev->dev);
 	struct device_node *np = pdev->dev.of_node;
 	struct device_node *parent;
 	static void __iomem *base;
@@ -306,7 +304,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
 	port->id = of_alias_get_id(np, "gpio");
 	if (port->id < 0)
 		return port->id;
-	port->devid = (enum mxs_gpio_id) of_id->data;
+	port->devid = (enum mxs_gpio_id)of_device_get_match_data(&pdev->dev);
 	port->dev = &pdev->dev;
 	port->irq = platform_get_irq(pdev, 0);
 	if (port->irq < 0)
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 06/12] gpio: palmas: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (3 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 05/12] gpio: mxs: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 07/12] gpio: pca953x: " Thierry Reding
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-palmas.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index 3d818195e351..ceb2fef2c8ae 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -159,13 +159,9 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 	struct palmas_platform_data *palmas_pdata;
 	struct palmas_gpio *palmas_gpio;
 	int ret;
-	const struct of_device_id *match;
 	const struct palmas_device_data *dev_data;
 
-	match = of_match_device(of_palmas_gpio_match, &pdev->dev);
-	if (!match)
-		return -ENODEV;
-	dev_data = match->data;
+	dev_data = of_device_get_match_data(&pdev->dev);
 	if (!dev_data)
 		dev_data = &palmas_dev_data;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 07/12] gpio: pca953x: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (4 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 06/12] gpio: palmas: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 08/12] gpio: pxa: " Thierry Reding
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-pca953x.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index d2ead4b1cf61..9a06b8a4f5be 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -810,13 +810,11 @@ static int pca953x_probe(struct i2c_client *client,
 		chip->driver_data = i2c_id->driver_data;
 	} else {
 		const struct acpi_device_id *acpi_id;
-		const struct of_device_id *match;
+		struct device *dev = &client->dev;
 
-		match = of_match_device(pca953x_dt_ids, &client->dev);
-		if (match) {
-			chip->driver_data = (int)(uintptr_t)match->data;
-		} else {
-			acpi_id = acpi_match_device(pca953x_acpi_ids, &client->dev);
+		chip->driver_data = (uintptr_t)of_device_get_match_data(dev);
+		if (!chip->driver_data) {
+			acpi_id = acpi_match_device(pca953x_acpi_ids, dev);
 			if (!acpi_id) {
 				ret = -ENODEV;
 				goto err_exit;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 08/12] gpio: pxa: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (5 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 07/12] gpio: pca953x: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 09/12] gpio: syscon: " Thierry Reding
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-pxa.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index f480fb896963..3c1f65bc0fa8 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -579,15 +579,9 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev,
 			     struct pxa_gpio_chip *pchip)
 {
 	int nr_gpios;
-	const struct of_device_id *of_id =
-				of_match_device(pxa_gpio_dt_ids, &pdev->dev);
 	const struct pxa_gpio_id *gpio_id;
 
-	if (!of_id || !of_id->data) {
-		dev_err(&pdev->dev, "Failed to find gpio controller\n");
-		return -EFAULT;
-	}
-	gpio_id = of_id->data;
+	gpio_id = of_device_get_match_data(&pdev->dev);
 	gpio_type = gpio_id->type;
 
 	nr_gpios = gpio_id->gpio_nums;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 09/12] gpio: syscon: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (6 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 08/12] gpio: pxa: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 10/12] gpio: ts4900: " Thierry Reding
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-syscon.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 537cec7583fc..2512acd99027 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -182,20 +182,15 @@ MODULE_DEVICE_TABLE(of, syscon_gpio_ids);
 static int syscon_gpio_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
-	const struct of_device_id *of_id;
 	struct syscon_gpio_priv *priv;
 	struct device_node *np = dev->of_node;
 	int ret;
 
-	of_id = of_match_device(syscon_gpio_ids, dev);
-	if (!of_id)
-		return -ENODEV;
-
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
 	if (!priv)
 		return -ENOMEM;
 
-	priv->data = of_id->data;
+	priv->data = of_device_get_match_data(dev);
 
 	if (priv->data->compatible) {
 		priv->syscon = syscon_regmap_lookup_by_compatible(
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 10/12] gpio: ts4900: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (7 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 09/12] gpio: syscon: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 11/12] gpio: vf610: " Thierry Reding
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-ts4900.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-ts4900.c b/drivers/gpio/gpio-ts4900.c
index 5bd21725e604..1da8d0586329 100644
--- a/drivers/gpio/gpio-ts4900.c
+++ b/drivers/gpio/gpio-ts4900.c
@@ -128,15 +128,10 @@ MODULE_DEVICE_TABLE(of, ts4900_gpio_of_match_table);
 static int ts4900_gpio_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
-	const struct of_device_id *match;
 	struct ts4900_gpio_priv *priv;
 	u32 ngpio;
 	int ret;
 
-	match = of_match_device(ts4900_gpio_of_match_table, &client->dev);
-	if (!match)
-		return -EINVAL;
-
 	if (of_property_read_u32(client->dev.of_node, "ngpios", &ngpio))
 		ngpio = DEFAULT_PIN_NUMBER;
 
@@ -148,7 +143,7 @@ static int ts4900_gpio_probe(struct i2c_client *client,
 	priv->gpio_chip.label = "ts4900-gpio";
 	priv->gpio_chip.ngpio = ngpio;
 	priv->gpio_chip.parent = &client->dev;
-	priv->input_bit = (uintptr_t)match->data;
+	priv->input_bit = (uintptr_t)of_device_get_match_data(&client->dev);
 
 	priv->regmap = devm_regmap_init_i2c(client, &ts4900_regmap_config);
 	if (IS_ERR(priv->regmap)) {
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 11/12] gpio: vf610: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (8 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 10/12] gpio: ts4900: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-04-30  7:38 ` [PATCH 12/12] gpio: xlp: " Thierry Reding
  2018-05-02 12:44 ` [PATCH 01/12] gpio: 74xx-mmio: " Linus Walleij
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-vf610.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 4610cc2938ad..d4ad6d0e02a2 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -254,8 +254,6 @@ static struct irq_chip vf610_gpio_irq_chip = {
 
 static int vf610_gpio_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id = of_match_device(vf610_gpio_dt_ids,
-							   &pdev->dev);
 	struct device *dev = &pdev->dev;
 	struct device_node *np = dev->of_node;
 	struct vf610_gpio_port *port;
@@ -267,7 +265,7 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	if (!port)
 		return -ENOMEM;
 
-	port->sdata = of_id->data;
+	port->sdata = of_device_get_match_data(dev);
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	port->base = devm_ioremap_resource(dev, iores);
 	if (IS_ERR(port->base))
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 12/12] gpio: xlp: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (9 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 11/12] gpio: vf610: " Thierry Reding
@ 2018-04-30  7:38 ` Thierry Reding
  2018-05-02 12:44 ` [PATCH 01/12] gpio: 74xx-mmio: " Linus Walleij
  11 siblings, 0 replies; 13+ messages in thread
From: Thierry Reding @ 2018-04-30  7:38 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, linux-kernel

From: Thierry Reding <treding@nvidia.com>

Use of_device_get_match_data() instead of open-coding it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-xlp.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index e74bd43a6974..8e4275eaa7d7 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -322,14 +322,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
 		return irq;
 
 	if (pdev->dev.of_node) {
-		const struct of_device_id *of_id;
-
-		of_id = of_match_device(xlp_gpio_of_ids, &pdev->dev);
-		if (!of_id) {
-			dev_err(&pdev->dev, "Unable to match OF ID\n");
-			return -ENODEV;
-		}
-		soc_type = (uintptr_t) of_id->data;
+		soc_type = (uintptr_t)of_device_get_match_data(&pdev->dev);
 	} else {
 		const struct acpi_device_id *acpi_id;
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data()
  2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
                   ` (10 preceding siblings ...)
  2018-04-30  7:38 ` [PATCH 12/12] gpio: xlp: " Thierry Reding
@ 2018-05-02 12:44 ` Linus Walleij
  11 siblings, 0 replies; 13+ messages in thread
From: Linus Walleij @ 2018-05-02 12:44 UTC (permalink / raw)
  To: Thierry Reding; +Cc: open list:GPIO SUBSYSTEM, linux-kernel

On Mon, Apr 30, 2018 at 9:38 AM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Use of_device_get_match_data() instead of open-coding it.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

All 12 patches applied!

Thanks for your cleanup efforts, much much appreciated!

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-05-02 12:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-30  7:38 [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data() Thierry Reding
2018-04-30  7:38 ` [PATCH 02/12] gpio: dwapb: " Thierry Reding
2018-04-30  7:38 ` [PATCH 03/12] gpio: ge: " Thierry Reding
2018-04-30  7:38 ` [PATCH 04/12] gpio: ingenic: " Thierry Reding
2018-04-30  7:38 ` [PATCH 05/12] gpio: mxs: " Thierry Reding
2018-04-30  7:38 ` [PATCH 06/12] gpio: palmas: " Thierry Reding
2018-04-30  7:38 ` [PATCH 07/12] gpio: pca953x: " Thierry Reding
2018-04-30  7:38 ` [PATCH 08/12] gpio: pxa: " Thierry Reding
2018-04-30  7:38 ` [PATCH 09/12] gpio: syscon: " Thierry Reding
2018-04-30  7:38 ` [PATCH 10/12] gpio: ts4900: " Thierry Reding
2018-04-30  7:38 ` [PATCH 11/12] gpio: vf610: " Thierry Reding
2018-04-30  7:38 ` [PATCH 12/12] gpio: xlp: " Thierry Reding
2018-05-02 12:44 ` [PATCH 01/12] gpio: 74xx-mmio: " Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.