All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-02 21:08 ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove these assignment all at once.

For the details one may look into the of_gpio_dev_init() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-adnp.c            | 1 -
 drivers/gpio/gpio-amdpt.c           | 4 +---
 drivers/gpio/gpio-bd70528.c         | 4 +---
 drivers/gpio/gpio-bd71828.c         | 1 -
 drivers/gpio/gpio-brcmstb.c         | 1 -
 drivers/gpio/gpio-davinci.c         | 1 -
 drivers/gpio/gpio-eic-sprd.c        | 1 -
 drivers/gpio/gpio-em.c              | 1 -
 drivers/gpio/gpio-ge.c              | 1 -
 drivers/gpio/gpio-grgpio.c          | 1 -
 drivers/gpio/gpio-gw-pld.c          | 1 -
 drivers/gpio/gpio-mt7621.c          | 1 -
 drivers/gpio/gpio-mvebu.c           | 1 -
 drivers/gpio/gpio-omap.c            | 3 ---
 drivers/gpio/gpio-palmas.c          | 4 +---
 drivers/gpio/gpio-pmic-eic-sprd.c   | 1 -
 drivers/gpio/gpio-raspberrypi-exp.c | 1 -
 drivers/gpio/gpio-rda.c             | 2 --
 drivers/gpio/gpio-rockchip.c        | 3 ---
 drivers/gpio/gpio-sama5d2-piobu.c   | 1 -
 drivers/gpio/gpio-sprd.c            | 1 -
 drivers/gpio/gpio-stmpe.c           | 1 -
 drivers/gpio/gpio-tc3589x.c         | 1 -
 drivers/gpio/gpio-tegra186.c        | 1 -
 drivers/gpio/gpio-tps65218.c        | 3 ---
 drivers/gpio/gpio-vf610.c           | 1 -
 drivers/gpio/gpio-xlp.c             | 1 -
 27 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index 8eedfc6451df..cc349d4e4973 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -458,7 +458,6 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios,
 	chip->ngpio = num_gpios;
 	chip->label = adnp->client->name;
 	chip->parent = &adnp->client->dev;
-	chip->of_node = chip->parent->of_node;
 	chip->owner = THIS_MODULE;
 
 	if (is_irq_controller) {
diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index bbf53e289141..afe59fb79821 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -104,9 +104,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
 	pt_gpio->gc.request          = pt_gpio_request;
 	pt_gpio->gc.free             = pt_gpio_free;
 	pt_gpio->gc.ngpio            = PT_TOTAL_GPIO;
-#if defined(CONFIG_OF_GPIO)
-	pt_gpio->gc.of_node          = dev->of_node;
-#endif
+
 	ret = gpiochip_add_data(&pt_gpio->gc, pt_gpio);
 	if (ret) {
 		dev_err(dev, "Failed to register GPIO lib\n");
diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
index 397a50d6bc65..6874efc18f41 100644
--- a/drivers/gpio/gpio-bd70528.c
+++ b/drivers/gpio/gpio-bd70528.c
@@ -201,9 +201,7 @@ static int bd70528_probe(struct platform_device *pdev)
 	bdgpio->gpio.set = bd70528_gpio_set;
 	bdgpio->gpio.ngpio = 4;
 	bdgpio->gpio.base = -1;
-#ifdef CONFIG_OF_GPIO
-	bdgpio->gpio.of_node = dev->parent->of_node;
-#endif
+
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-bd71828.c b/drivers/gpio/gpio-bd71828.c
index c8e382b53f2f..b2ccc320c7b5 100644
--- a/drivers/gpio/gpio-bd71828.c
+++ b/drivers/gpio/gpio-bd71828.c
@@ -121,7 +121,6 @@ static int bd71828_probe(struct platform_device *pdev)
 	 * "gpio-reserved-ranges" and exclude them from control
 	 */
 	bdgpio->gpio.ngpio = 4;
-	bdgpio->gpio.of_node = dev->parent->of_node;
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 895a79936248..176c264bb959 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -703,7 +703,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
 			goto fail;
 		}
 
-		gc->of_node = np;
 		gc->owner = THIS_MODULE;
 		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
 		if (!gc->label) {
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index cb5afaa7ed48..f960587f86a3 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -254,7 +254,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)
 #ifdef CONFIG_OF_GPIO
 	chips->chip.of_gpio_n_cells = 2;
 	chips->chip.parent = dev;
-	chips->chip.of_node = dev->of_node;
 	chips->chip.request = gpiochip_generic_request;
 	chips->chip.free = gpiochip_generic_free;
 #endif
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 865ab2b34fdd..8d722e026e9c 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -609,7 +609,6 @@ static int sprd_eic_probe(struct platform_device *pdev)
 	sprd_eic->chip.ngpio = pdata->num_eics;
 	sprd_eic->chip.base = -1;
 	sprd_eic->chip.parent = &pdev->dev;
-	sprd_eic->chip.of_node = pdev->dev.of_node;
 	sprd_eic->chip.direction_input = sprd_eic_direction_input;
 	switch (sprd_eic->type) {
 	case SPRD_EIC_DEBOUNCE:
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 90b336e6ee27..858e6ebbb584 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -306,7 +306,6 @@ static int em_gio_probe(struct platform_device *pdev)
 	}
 
 	gpio_chip = &p->gpio_chip;
-	gpio_chip->of_node = dev->of_node;
 	gpio_chip->direction_input = em_gio_direction_input;
 	gpio_chip->get = em_gio_get;
 	gpio_chip->direction_output = em_gio_direction_output;
diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 636952769bc8..f6a3de99f7db 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -82,7 +82,6 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 	gc->base = -1;
 	gc->ngpio = (u16)(uintptr_t)of_device_get_match_data(&pdev->dev);
 	gc->of_gpio_n_cells = 2;
-	gc->of_node = pdev->dev.of_node;
 
 	/* This function adds a memory mapped GPIO chip */
 	ret = devm_gpiochip_add_data(&pdev->dev, gc, NULL);
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index f954359c9544..23d447e17a67 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -358,7 +358,6 @@ static int grgpio_probe(struct platform_device *ofdev)
 	priv->imask = gc->read_reg(regs + GRGPIO_IMASK);
 	priv->dev = &ofdev->dev;
 
-	gc->of_node = np;
 	gc->owner = THIS_MODULE;
 	gc->to_irq = grgpio_to_irq;
 	gc->label = devm_kasprintf(&ofdev->dev, GFP_KERNEL, "%pOF", np);
diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c
index 242112ff60ee..77a3fbd46111 100644
--- a/drivers/gpio/gpio-gw-pld.c
+++ b/drivers/gpio/gpio-gw-pld.c
@@ -82,7 +82,6 @@ static int gw_pld_probe(struct i2c_client *client,
 	gw->chip.base = -1;
 	gw->chip.can_sleep = true;
 	gw->chip.parent = dev;
-	gw->chip.of_node = np;
 	gw->chip.owner = THIS_MODULE;
 	gw->chip.label = dev_name(dev);
 	gw->chip.ngpio = 8;
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index c3658a597a80..52b49e7a0a80 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -217,7 +217,6 @@ mediatek_gpio_bank_probe(struct device *dev,
 	memset(rg, 0, sizeof(*rg));
 
 	spin_lock_init(&rg->lock);
-	rg->chip.of_node = node;
 	rg->bank = bank;
 
 	dat = mtk->base + GPIO_REG_DATA + (rg->bank * GPIO_BANK_STRIDE);
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 8f429d9f3661..4c1f9e1091b7 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -1183,7 +1183,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 	mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
 	mvchip->chip.ngpio = ngpios;
 	mvchip->chip.can_sleep = false;
-	mvchip->chip.of_node = np;
 	mvchip->chip.dbg_show = mvebu_gpio_dbg_show;
 
 	if (soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 415e8df89d6f..e099c39e0355 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1419,9 +1419,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	bank->is_mpuio = pdata->is_mpuio;
 	bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
 	bank->regs = pdata->regs;
-#ifdef CONFIG_OF_GPIO
-	bank->chip.of_node = of_node_get(node);
-#endif
 
 	if (node) {
 		if (!of_property_read_bool(node, "ti,gpio-always-on"))
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e8e9029ba5bd..bac10c2faf56 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -170,9 +170,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 	palmas_gpio->gpio_chip.set	= palmas_gpio_set;
 	palmas_gpio->gpio_chip.get	= palmas_gpio_get;
 	palmas_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
+
 	palmas_pdata = dev_get_platdata(palmas->dev);
 	if (palmas_pdata && palmas_pdata->gpio_base)
 		palmas_gpio->gpio_chip.base = palmas_pdata->gpio_base;
diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c
index 938285190566..e518490c4b68 100644
--- a/drivers/gpio/gpio-pmic-eic-sprd.c
+++ b/drivers/gpio/gpio-pmic-eic-sprd.c
@@ -331,7 +331,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
 	pmic_eic->chip.ngpio = SPRD_PMIC_EIC_NR;
 	pmic_eic->chip.base = -1;
 	pmic_eic->chip.parent = &pdev->dev;
-	pmic_eic->chip.of_node = pdev->dev.of_node;
 	pmic_eic->chip.direction_input = sprd_pmic_eic_direction_input;
 	pmic_eic->chip.request = sprd_pmic_eic_request;
 	pmic_eic->chip.free = sprd_pmic_eic_free;
diff --git a/drivers/gpio/gpio-raspberrypi-exp.c b/drivers/gpio/gpio-raspberrypi-exp.c
index 64a552ecc2ad..3c414e0005fc 100644
--- a/drivers/gpio/gpio-raspberrypi-exp.c
+++ b/drivers/gpio/gpio-raspberrypi-exp.c
@@ -221,7 +221,6 @@ static int rpi_exp_gpio_probe(struct platform_device *pdev)
 	rpi_gpio->gc.parent = dev;
 	rpi_gpio->gc.label = MODULE_NAME;
 	rpi_gpio->gc.owner = THIS_MODULE;
-	rpi_gpio->gc.of_node = np;
 	rpi_gpio->gc.base = -1;
 	rpi_gpio->gc.ngpio = NUM_GPIO;
 
diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
index 463846431183..0d03f525dcd3 100644
--- a/drivers/gpio/gpio-rda.c
+++ b/drivers/gpio/gpio-rda.c
@@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
 	rda_gpio->chip.label = dev_name(dev);
 	rda_gpio->chip.ngpio = ngpios;
 	rda_gpio->chip.base = -1;
-	rda_gpio->chip.parent = dev;
-	rda_gpio->chip.of_node = np;
 
 	if (rda_gpio->irq >= 0) {
 		rda_gpio->irq_chip.name = "rda-gpio",
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index ce63cbd14d69..577abef578e1 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -566,9 +566,6 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
 	gc->ngpio = bank->nr_pins;
 	gc->label = bank->name;
 	gc->parent = bank->dev;
-#ifdef CONFIG_OF_GPIO
-	gc->of_node = of_node_get(bank->of_node);
-#endif
 
 	ret = gpiochip_add_data(gc, bank);
 	if (ret) {
diff --git a/drivers/gpio/gpio-sama5d2-piobu.c b/drivers/gpio/gpio-sama5d2-piobu.c
index b7c950658170..3e95da717fc9 100644
--- a/drivers/gpio/gpio-sama5d2-piobu.c
+++ b/drivers/gpio/gpio-sama5d2-piobu.c
@@ -192,7 +192,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, piobu);
 	piobu->chip.label = pdev->name;
 	piobu->chip.parent = &pdev->dev;
-	piobu->chip.of_node = pdev->dev.of_node;
 	piobu->chip.owner = THIS_MODULE,
 	piobu->chip.get_direction = sama5d2_piobu_get_direction,
 	piobu->chip.direction_input = sama5d2_piobu_direction_input,
diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 9dd9dabb579e..9bff63990eee 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -237,7 +237,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
 	sprd_gpio->chip.ngpio = SPRD_GPIO_NR;
 	sprd_gpio->chip.base = -1;
 	sprd_gpio->chip.parent = &pdev->dev;
-	sprd_gpio->chip.of_node = pdev->dev.of_node;
 	sprd_gpio->chip.request = sprd_gpio_request;
 	sprd_gpio->chip.free = sprd_gpio_free;
 	sprd_gpio->chip.get = sprd_gpio_get;
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index dd4d58b4ae49..0fa4f0a93378 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -477,7 +477,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 	stmpe_gpio->chip = template_chip;
 	stmpe_gpio->chip.ngpio = stmpe->num_gpios;
 	stmpe_gpio->chip.parent = &pdev->dev;
-	stmpe_gpio->chip.of_node = np;
 	stmpe_gpio->chip.base = -1;
 
 	if (IS_ENABLED(CONFIG_DEBUG_FS))
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 8d158492488f..443fe975bf13 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -319,7 +319,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
 	tc3589x_gpio->chip.parent = &pdev->dev;
 	tc3589x_gpio->chip.base = -1;
-	tc3589x_gpio->chip.of_node = np;
 
 	girq = &tc3589x_gpio->chip.irq;
 	girq->chip = &tc3589x_gpio_irq_chip;
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index c026e7141e4e..7d90df8c097e 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -748,7 +748,6 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 	gpio->gpio.names = (const char * const *)names;
 
 #if defined(CONFIG_OF_GPIO)
-	gpio->gpio.of_node = pdev->dev.of_node;
 	gpio->gpio.of_gpio_n_cells = 2;
 	gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
 #endif /* CONFIG_OF_GPIO */
diff --git a/drivers/gpio/gpio-tps65218.c b/drivers/gpio/gpio-tps65218.c
index 912382be48e1..e1d425a18854 100644
--- a/drivers/gpio/gpio-tps65218.c
+++ b/drivers/gpio/gpio-tps65218.c
@@ -196,9 +196,6 @@ static int tps65218_gpio_probe(struct platform_device *pdev)
 	tps65218_gpio->tps65218 = tps65218;
 	tps65218_gpio->gpio_chip = template_chip;
 	tps65218_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65218_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &tps65218_gpio->gpio_chip,
 				      tps65218_gpio);
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index e0f2b67558e7..20780c35da1b 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -298,7 +298,6 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	}
 
 	gc = &port->gc;
-	gc->of_node = np;
 	gc->parent = dev;
 	gc->label = "vf610-gpio";
 	gc->ngpio = VF610_GPIO_PER_PORT;
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 0d94d3aef752..9bb0d1c17f67 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -374,7 +374,6 @@ static int xlp_gpio_probe(struct platform_device *pdev)
 	gc->base = 0;
 	gc->parent = &pdev->dev;
 	gc->ngpio = ngpio;
-	gc->of_node = pdev->dev.of_node;
 	gc->direction_output = xlp_gpio_dir_output;
 	gc->direction_input = xlp_gpio_dir_input;
 	gc->set = xlp_gpio_set;
-- 
2.33.0


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

* [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-02 21:08 ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove these assignment all at once.

For the details one may look into the of_gpio_dev_init() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-adnp.c            | 1 -
 drivers/gpio/gpio-amdpt.c           | 4 +---
 drivers/gpio/gpio-bd70528.c         | 4 +---
 drivers/gpio/gpio-bd71828.c         | 1 -
 drivers/gpio/gpio-brcmstb.c         | 1 -
 drivers/gpio/gpio-davinci.c         | 1 -
 drivers/gpio/gpio-eic-sprd.c        | 1 -
 drivers/gpio/gpio-em.c              | 1 -
 drivers/gpio/gpio-ge.c              | 1 -
 drivers/gpio/gpio-grgpio.c          | 1 -
 drivers/gpio/gpio-gw-pld.c          | 1 -
 drivers/gpio/gpio-mt7621.c          | 1 -
 drivers/gpio/gpio-mvebu.c           | 1 -
 drivers/gpio/gpio-omap.c            | 3 ---
 drivers/gpio/gpio-palmas.c          | 4 +---
 drivers/gpio/gpio-pmic-eic-sprd.c   | 1 -
 drivers/gpio/gpio-raspberrypi-exp.c | 1 -
 drivers/gpio/gpio-rda.c             | 2 --
 drivers/gpio/gpio-rockchip.c        | 3 ---
 drivers/gpio/gpio-sama5d2-piobu.c   | 1 -
 drivers/gpio/gpio-sprd.c            | 1 -
 drivers/gpio/gpio-stmpe.c           | 1 -
 drivers/gpio/gpio-tc3589x.c         | 1 -
 drivers/gpio/gpio-tegra186.c        | 1 -
 drivers/gpio/gpio-tps65218.c        | 3 ---
 drivers/gpio/gpio-vf610.c           | 1 -
 drivers/gpio/gpio-xlp.c             | 1 -
 27 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index 8eedfc6451df..cc349d4e4973 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -458,7 +458,6 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios,
 	chip->ngpio = num_gpios;
 	chip->label = adnp->client->name;
 	chip->parent = &adnp->client->dev;
-	chip->of_node = chip->parent->of_node;
 	chip->owner = THIS_MODULE;
 
 	if (is_irq_controller) {
diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index bbf53e289141..afe59fb79821 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -104,9 +104,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
 	pt_gpio->gc.request          = pt_gpio_request;
 	pt_gpio->gc.free             = pt_gpio_free;
 	pt_gpio->gc.ngpio            = PT_TOTAL_GPIO;
-#if defined(CONFIG_OF_GPIO)
-	pt_gpio->gc.of_node          = dev->of_node;
-#endif
+
 	ret = gpiochip_add_data(&pt_gpio->gc, pt_gpio);
 	if (ret) {
 		dev_err(dev, "Failed to register GPIO lib\n");
diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
index 397a50d6bc65..6874efc18f41 100644
--- a/drivers/gpio/gpio-bd70528.c
+++ b/drivers/gpio/gpio-bd70528.c
@@ -201,9 +201,7 @@ static int bd70528_probe(struct platform_device *pdev)
 	bdgpio->gpio.set = bd70528_gpio_set;
 	bdgpio->gpio.ngpio = 4;
 	bdgpio->gpio.base = -1;
-#ifdef CONFIG_OF_GPIO
-	bdgpio->gpio.of_node = dev->parent->of_node;
-#endif
+
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-bd71828.c b/drivers/gpio/gpio-bd71828.c
index c8e382b53f2f..b2ccc320c7b5 100644
--- a/drivers/gpio/gpio-bd71828.c
+++ b/drivers/gpio/gpio-bd71828.c
@@ -121,7 +121,6 @@ static int bd71828_probe(struct platform_device *pdev)
 	 * "gpio-reserved-ranges" and exclude them from control
 	 */
 	bdgpio->gpio.ngpio = 4;
-	bdgpio->gpio.of_node = dev->parent->of_node;
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 895a79936248..176c264bb959 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -703,7 +703,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
 			goto fail;
 		}
 
-		gc->of_node = np;
 		gc->owner = THIS_MODULE;
 		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
 		if (!gc->label) {
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index cb5afaa7ed48..f960587f86a3 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -254,7 +254,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)
 #ifdef CONFIG_OF_GPIO
 	chips->chip.of_gpio_n_cells = 2;
 	chips->chip.parent = dev;
-	chips->chip.of_node = dev->of_node;
 	chips->chip.request = gpiochip_generic_request;
 	chips->chip.free = gpiochip_generic_free;
 #endif
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 865ab2b34fdd..8d722e026e9c 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -609,7 +609,6 @@ static int sprd_eic_probe(struct platform_device *pdev)
 	sprd_eic->chip.ngpio = pdata->num_eics;
 	sprd_eic->chip.base = -1;
 	sprd_eic->chip.parent = &pdev->dev;
-	sprd_eic->chip.of_node = pdev->dev.of_node;
 	sprd_eic->chip.direction_input = sprd_eic_direction_input;
 	switch (sprd_eic->type) {
 	case SPRD_EIC_DEBOUNCE:
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 90b336e6ee27..858e6ebbb584 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -306,7 +306,6 @@ static int em_gio_probe(struct platform_device *pdev)
 	}
 
 	gpio_chip = &p->gpio_chip;
-	gpio_chip->of_node = dev->of_node;
 	gpio_chip->direction_input = em_gio_direction_input;
 	gpio_chip->get = em_gio_get;
 	gpio_chip->direction_output = em_gio_direction_output;
diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 636952769bc8..f6a3de99f7db 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -82,7 +82,6 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 	gc->base = -1;
 	gc->ngpio = (u16)(uintptr_t)of_device_get_match_data(&pdev->dev);
 	gc->of_gpio_n_cells = 2;
-	gc->of_node = pdev->dev.of_node;
 
 	/* This function adds a memory mapped GPIO chip */
 	ret = devm_gpiochip_add_data(&pdev->dev, gc, NULL);
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index f954359c9544..23d447e17a67 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -358,7 +358,6 @@ static int grgpio_probe(struct platform_device *ofdev)
 	priv->imask = gc->read_reg(regs + GRGPIO_IMASK);
 	priv->dev = &ofdev->dev;
 
-	gc->of_node = np;
 	gc->owner = THIS_MODULE;
 	gc->to_irq = grgpio_to_irq;
 	gc->label = devm_kasprintf(&ofdev->dev, GFP_KERNEL, "%pOF", np);
diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c
index 242112ff60ee..77a3fbd46111 100644
--- a/drivers/gpio/gpio-gw-pld.c
+++ b/drivers/gpio/gpio-gw-pld.c
@@ -82,7 +82,6 @@ static int gw_pld_probe(struct i2c_client *client,
 	gw->chip.base = -1;
 	gw->chip.can_sleep = true;
 	gw->chip.parent = dev;
-	gw->chip.of_node = np;
 	gw->chip.owner = THIS_MODULE;
 	gw->chip.label = dev_name(dev);
 	gw->chip.ngpio = 8;
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index c3658a597a80..52b49e7a0a80 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -217,7 +217,6 @@ mediatek_gpio_bank_probe(struct device *dev,
 	memset(rg, 0, sizeof(*rg));
 
 	spin_lock_init(&rg->lock);
-	rg->chip.of_node = node;
 	rg->bank = bank;
 
 	dat = mtk->base + GPIO_REG_DATA + (rg->bank * GPIO_BANK_STRIDE);
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 8f429d9f3661..4c1f9e1091b7 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -1183,7 +1183,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 	mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
 	mvchip->chip.ngpio = ngpios;
 	mvchip->chip.can_sleep = false;
-	mvchip->chip.of_node = np;
 	mvchip->chip.dbg_show = mvebu_gpio_dbg_show;
 
 	if (soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 415e8df89d6f..e099c39e0355 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1419,9 +1419,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	bank->is_mpuio = pdata->is_mpuio;
 	bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
 	bank->regs = pdata->regs;
-#ifdef CONFIG_OF_GPIO
-	bank->chip.of_node = of_node_get(node);
-#endif
 
 	if (node) {
 		if (!of_property_read_bool(node, "ti,gpio-always-on"))
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e8e9029ba5bd..bac10c2faf56 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -170,9 +170,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 	palmas_gpio->gpio_chip.set	= palmas_gpio_set;
 	palmas_gpio->gpio_chip.get	= palmas_gpio_get;
 	palmas_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
+
 	palmas_pdata = dev_get_platdata(palmas->dev);
 	if (palmas_pdata && palmas_pdata->gpio_base)
 		palmas_gpio->gpio_chip.base = palmas_pdata->gpio_base;
diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c
index 938285190566..e518490c4b68 100644
--- a/drivers/gpio/gpio-pmic-eic-sprd.c
+++ b/drivers/gpio/gpio-pmic-eic-sprd.c
@@ -331,7 +331,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
 	pmic_eic->chip.ngpio = SPRD_PMIC_EIC_NR;
 	pmic_eic->chip.base = -1;
 	pmic_eic->chip.parent = &pdev->dev;
-	pmic_eic->chip.of_node = pdev->dev.of_node;
 	pmic_eic->chip.direction_input = sprd_pmic_eic_direction_input;
 	pmic_eic->chip.request = sprd_pmic_eic_request;
 	pmic_eic->chip.free = sprd_pmic_eic_free;
diff --git a/drivers/gpio/gpio-raspberrypi-exp.c b/drivers/gpio/gpio-raspberrypi-exp.c
index 64a552ecc2ad..3c414e0005fc 100644
--- a/drivers/gpio/gpio-raspberrypi-exp.c
+++ b/drivers/gpio/gpio-raspberrypi-exp.c
@@ -221,7 +221,6 @@ static int rpi_exp_gpio_probe(struct platform_device *pdev)
 	rpi_gpio->gc.parent = dev;
 	rpi_gpio->gc.label = MODULE_NAME;
 	rpi_gpio->gc.owner = THIS_MODULE;
-	rpi_gpio->gc.of_node = np;
 	rpi_gpio->gc.base = -1;
 	rpi_gpio->gc.ngpio = NUM_GPIO;
 
diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
index 463846431183..0d03f525dcd3 100644
--- a/drivers/gpio/gpio-rda.c
+++ b/drivers/gpio/gpio-rda.c
@@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
 	rda_gpio->chip.label = dev_name(dev);
 	rda_gpio->chip.ngpio = ngpios;
 	rda_gpio->chip.base = -1;
-	rda_gpio->chip.parent = dev;
-	rda_gpio->chip.of_node = np;
 
 	if (rda_gpio->irq >= 0) {
 		rda_gpio->irq_chip.name = "rda-gpio",
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index ce63cbd14d69..577abef578e1 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -566,9 +566,6 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
 	gc->ngpio = bank->nr_pins;
 	gc->label = bank->name;
 	gc->parent = bank->dev;
-#ifdef CONFIG_OF_GPIO
-	gc->of_node = of_node_get(bank->of_node);
-#endif
 
 	ret = gpiochip_add_data(gc, bank);
 	if (ret) {
diff --git a/drivers/gpio/gpio-sama5d2-piobu.c b/drivers/gpio/gpio-sama5d2-piobu.c
index b7c950658170..3e95da717fc9 100644
--- a/drivers/gpio/gpio-sama5d2-piobu.c
+++ b/drivers/gpio/gpio-sama5d2-piobu.c
@@ -192,7 +192,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, piobu);
 	piobu->chip.label = pdev->name;
 	piobu->chip.parent = &pdev->dev;
-	piobu->chip.of_node = pdev->dev.of_node;
 	piobu->chip.owner = THIS_MODULE,
 	piobu->chip.get_direction = sama5d2_piobu_get_direction,
 	piobu->chip.direction_input = sama5d2_piobu_direction_input,
diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 9dd9dabb579e..9bff63990eee 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -237,7 +237,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
 	sprd_gpio->chip.ngpio = SPRD_GPIO_NR;
 	sprd_gpio->chip.base = -1;
 	sprd_gpio->chip.parent = &pdev->dev;
-	sprd_gpio->chip.of_node = pdev->dev.of_node;
 	sprd_gpio->chip.request = sprd_gpio_request;
 	sprd_gpio->chip.free = sprd_gpio_free;
 	sprd_gpio->chip.get = sprd_gpio_get;
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index dd4d58b4ae49..0fa4f0a93378 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -477,7 +477,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 	stmpe_gpio->chip = template_chip;
 	stmpe_gpio->chip.ngpio = stmpe->num_gpios;
 	stmpe_gpio->chip.parent = &pdev->dev;
-	stmpe_gpio->chip.of_node = np;
 	stmpe_gpio->chip.base = -1;
 
 	if (IS_ENABLED(CONFIG_DEBUG_FS))
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 8d158492488f..443fe975bf13 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -319,7 +319,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
 	tc3589x_gpio->chip.parent = &pdev->dev;
 	tc3589x_gpio->chip.base = -1;
-	tc3589x_gpio->chip.of_node = np;
 
 	girq = &tc3589x_gpio->chip.irq;
 	girq->chip = &tc3589x_gpio_irq_chip;
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index c026e7141e4e..7d90df8c097e 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -748,7 +748,6 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 	gpio->gpio.names = (const char * const *)names;
 
 #if defined(CONFIG_OF_GPIO)
-	gpio->gpio.of_node = pdev->dev.of_node;
 	gpio->gpio.of_gpio_n_cells = 2;
 	gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
 #endif /* CONFIG_OF_GPIO */
diff --git a/drivers/gpio/gpio-tps65218.c b/drivers/gpio/gpio-tps65218.c
index 912382be48e1..e1d425a18854 100644
--- a/drivers/gpio/gpio-tps65218.c
+++ b/drivers/gpio/gpio-tps65218.c
@@ -196,9 +196,6 @@ static int tps65218_gpio_probe(struct platform_device *pdev)
 	tps65218_gpio->tps65218 = tps65218;
 	tps65218_gpio->gpio_chip = template_chip;
 	tps65218_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65218_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &tps65218_gpio->gpio_chip,
 				      tps65218_gpio);
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index e0f2b67558e7..20780c35da1b 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -298,7 +298,6 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	}
 
 	gc = &port->gc;
-	gc->of_node = np;
 	gc->parent = dev;
 	gc->label = "vf610-gpio";
 	gc->ngpio = VF610_GPIO_PER_PORT;
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 0d94d3aef752..9bb0d1c17f67 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -374,7 +374,6 @@ static int xlp_gpio_probe(struct platform_device *pdev)
 	gc->base = 0;
 	gc->parent = &pdev->dev;
 	gc->ngpio = ngpio;
-	gc->of_node = pdev->dev.of_node;
 	gc->direction_output = xlp_gpio_dir_output;
 	gc->direction_input = xlp_gpio_dir_input;
 	gc->set = xlp_gpio_set;
-- 
2.33.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-02 21:08 ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove these assignment all at once.

For the details one may look into the of_gpio_dev_init() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-adnp.c            | 1 -
 drivers/gpio/gpio-amdpt.c           | 4 +---
 drivers/gpio/gpio-bd70528.c         | 4 +---
 drivers/gpio/gpio-bd71828.c         | 1 -
 drivers/gpio/gpio-brcmstb.c         | 1 -
 drivers/gpio/gpio-davinci.c         | 1 -
 drivers/gpio/gpio-eic-sprd.c        | 1 -
 drivers/gpio/gpio-em.c              | 1 -
 drivers/gpio/gpio-ge.c              | 1 -
 drivers/gpio/gpio-grgpio.c          | 1 -
 drivers/gpio/gpio-gw-pld.c          | 1 -
 drivers/gpio/gpio-mt7621.c          | 1 -
 drivers/gpio/gpio-mvebu.c           | 1 -
 drivers/gpio/gpio-omap.c            | 3 ---
 drivers/gpio/gpio-palmas.c          | 4 +---
 drivers/gpio/gpio-pmic-eic-sprd.c   | 1 -
 drivers/gpio/gpio-raspberrypi-exp.c | 1 -
 drivers/gpio/gpio-rda.c             | 2 --
 drivers/gpio/gpio-rockchip.c        | 3 ---
 drivers/gpio/gpio-sama5d2-piobu.c   | 1 -
 drivers/gpio/gpio-sprd.c            | 1 -
 drivers/gpio/gpio-stmpe.c           | 1 -
 drivers/gpio/gpio-tc3589x.c         | 1 -
 drivers/gpio/gpio-tegra186.c        | 1 -
 drivers/gpio/gpio-tps65218.c        | 3 ---
 drivers/gpio/gpio-vf610.c           | 1 -
 drivers/gpio/gpio-xlp.c             | 1 -
 27 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/gpio/gpio-adnp.c b/drivers/gpio/gpio-adnp.c
index 8eedfc6451df..cc349d4e4973 100644
--- a/drivers/gpio/gpio-adnp.c
+++ b/drivers/gpio/gpio-adnp.c
@@ -458,7 +458,6 @@ static int adnp_gpio_setup(struct adnp *adnp, unsigned int num_gpios,
 	chip->ngpio = num_gpios;
 	chip->label = adnp->client->name;
 	chip->parent = &adnp->client->dev;
-	chip->of_node = chip->parent->of_node;
 	chip->owner = THIS_MODULE;
 
 	if (is_irq_controller) {
diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index bbf53e289141..afe59fb79821 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -104,9 +104,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
 	pt_gpio->gc.request          = pt_gpio_request;
 	pt_gpio->gc.free             = pt_gpio_free;
 	pt_gpio->gc.ngpio            = PT_TOTAL_GPIO;
-#if defined(CONFIG_OF_GPIO)
-	pt_gpio->gc.of_node          = dev->of_node;
-#endif
+
 	ret = gpiochip_add_data(&pt_gpio->gc, pt_gpio);
 	if (ret) {
 		dev_err(dev, "Failed to register GPIO lib\n");
diff --git a/drivers/gpio/gpio-bd70528.c b/drivers/gpio/gpio-bd70528.c
index 397a50d6bc65..6874efc18f41 100644
--- a/drivers/gpio/gpio-bd70528.c
+++ b/drivers/gpio/gpio-bd70528.c
@@ -201,9 +201,7 @@ static int bd70528_probe(struct platform_device *pdev)
 	bdgpio->gpio.set = bd70528_gpio_set;
 	bdgpio->gpio.ngpio = 4;
 	bdgpio->gpio.base = -1;
-#ifdef CONFIG_OF_GPIO
-	bdgpio->gpio.of_node = dev->parent->of_node;
-#endif
+
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-bd71828.c b/drivers/gpio/gpio-bd71828.c
index c8e382b53f2f..b2ccc320c7b5 100644
--- a/drivers/gpio/gpio-bd71828.c
+++ b/drivers/gpio/gpio-bd71828.c
@@ -121,7 +121,6 @@ static int bd71828_probe(struct platform_device *pdev)
 	 * "gpio-reserved-ranges" and exclude them from control
 	 */
 	bdgpio->gpio.ngpio = 4;
-	bdgpio->gpio.of_node = dev->parent->of_node;
 	bdgpio->regmap = dev_get_regmap(dev->parent, NULL);
 	if (!bdgpio->regmap)
 		return -ENODEV;
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index 895a79936248..176c264bb959 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -703,7 +703,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
 			goto fail;
 		}
 
-		gc->of_node = np;
 		gc->owner = THIS_MODULE;
 		gc->label = devm_kasprintf(dev, GFP_KERNEL, "%pOF", dev->of_node);
 		if (!gc->label) {
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c
index cb5afaa7ed48..f960587f86a3 100644
--- a/drivers/gpio/gpio-davinci.c
+++ b/drivers/gpio/gpio-davinci.c
@@ -254,7 +254,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)
 #ifdef CONFIG_OF_GPIO
 	chips->chip.of_gpio_n_cells = 2;
 	chips->chip.parent = dev;
-	chips->chip.of_node = dev->of_node;
 	chips->chip.request = gpiochip_generic_request;
 	chips->chip.free = gpiochip_generic_free;
 #endif
diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c
index 865ab2b34fdd..8d722e026e9c 100644
--- a/drivers/gpio/gpio-eic-sprd.c
+++ b/drivers/gpio/gpio-eic-sprd.c
@@ -609,7 +609,6 @@ static int sprd_eic_probe(struct platform_device *pdev)
 	sprd_eic->chip.ngpio = pdata->num_eics;
 	sprd_eic->chip.base = -1;
 	sprd_eic->chip.parent = &pdev->dev;
-	sprd_eic->chip.of_node = pdev->dev.of_node;
 	sprd_eic->chip.direction_input = sprd_eic_direction_input;
 	switch (sprd_eic->type) {
 	case SPRD_EIC_DEBOUNCE:
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c
index 90b336e6ee27..858e6ebbb584 100644
--- a/drivers/gpio/gpio-em.c
+++ b/drivers/gpio/gpio-em.c
@@ -306,7 +306,6 @@ static int em_gio_probe(struct platform_device *pdev)
 	}
 
 	gpio_chip = &p->gpio_chip;
-	gpio_chip->of_node = dev->of_node;
 	gpio_chip->direction_input = em_gio_direction_input;
 	gpio_chip->get = em_gio_get;
 	gpio_chip->direction_output = em_gio_direction_output;
diff --git a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
index 636952769bc8..f6a3de99f7db 100644
--- a/drivers/gpio/gpio-ge.c
+++ b/drivers/gpio/gpio-ge.c
@@ -82,7 +82,6 @@ static int __init gef_gpio_probe(struct platform_device *pdev)
 	gc->base = -1;
 	gc->ngpio = (u16)(uintptr_t)of_device_get_match_data(&pdev->dev);
 	gc->of_gpio_n_cells = 2;
-	gc->of_node = pdev->dev.of_node;
 
 	/* This function adds a memory mapped GPIO chip */
 	ret = devm_gpiochip_add_data(&pdev->dev, gc, NULL);
diff --git a/drivers/gpio/gpio-grgpio.c b/drivers/gpio/gpio-grgpio.c
index f954359c9544..23d447e17a67 100644
--- a/drivers/gpio/gpio-grgpio.c
+++ b/drivers/gpio/gpio-grgpio.c
@@ -358,7 +358,6 @@ static int grgpio_probe(struct platform_device *ofdev)
 	priv->imask = gc->read_reg(regs + GRGPIO_IMASK);
 	priv->dev = &ofdev->dev;
 
-	gc->of_node = np;
 	gc->owner = THIS_MODULE;
 	gc->to_irq = grgpio_to_irq;
 	gc->label = devm_kasprintf(&ofdev->dev, GFP_KERNEL, "%pOF", np);
diff --git a/drivers/gpio/gpio-gw-pld.c b/drivers/gpio/gpio-gw-pld.c
index 242112ff60ee..77a3fbd46111 100644
--- a/drivers/gpio/gpio-gw-pld.c
+++ b/drivers/gpio/gpio-gw-pld.c
@@ -82,7 +82,6 @@ static int gw_pld_probe(struct i2c_client *client,
 	gw->chip.base = -1;
 	gw->chip.can_sleep = true;
 	gw->chip.parent = dev;
-	gw->chip.of_node = np;
 	gw->chip.owner = THIS_MODULE;
 	gw->chip.label = dev_name(dev);
 	gw->chip.ngpio = 8;
diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c
index c3658a597a80..52b49e7a0a80 100644
--- a/drivers/gpio/gpio-mt7621.c
+++ b/drivers/gpio/gpio-mt7621.c
@@ -217,7 +217,6 @@ mediatek_gpio_bank_probe(struct device *dev,
 	memset(rg, 0, sizeof(*rg));
 
 	spin_lock_init(&rg->lock);
-	rg->chip.of_node = node;
 	rg->bank = bank;
 
 	dat = mtk->base + GPIO_REG_DATA + (rg->bank * GPIO_BANK_STRIDE);
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index 8f429d9f3661..4c1f9e1091b7 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -1183,7 +1183,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 	mvchip->chip.base = id * MVEBU_MAX_GPIO_PER_BANK;
 	mvchip->chip.ngpio = ngpios;
 	mvchip->chip.can_sleep = false;
-	mvchip->chip.of_node = np;
 	mvchip->chip.dbg_show = mvebu_gpio_dbg_show;
 
 	if (soc_variant == MVEBU_GPIO_SOC_VARIANT_A8K)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 415e8df89d6f..e099c39e0355 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1419,9 +1419,6 @@ static int omap_gpio_probe(struct platform_device *pdev)
 	bank->is_mpuio = pdata->is_mpuio;
 	bank->non_wakeup_gpios = pdata->non_wakeup_gpios;
 	bank->regs = pdata->regs;
-#ifdef CONFIG_OF_GPIO
-	bank->chip.of_node = of_node_get(node);
-#endif
 
 	if (node) {
 		if (!of_property_read_bool(node, "ti,gpio-always-on"))
diff --git a/drivers/gpio/gpio-palmas.c b/drivers/gpio/gpio-palmas.c
index e8e9029ba5bd..bac10c2faf56 100644
--- a/drivers/gpio/gpio-palmas.c
+++ b/drivers/gpio/gpio-palmas.c
@@ -170,9 +170,7 @@ static int palmas_gpio_probe(struct platform_device *pdev)
 	palmas_gpio->gpio_chip.set	= palmas_gpio_set;
 	palmas_gpio->gpio_chip.get	= palmas_gpio_get;
 	palmas_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	palmas_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
+
 	palmas_pdata = dev_get_platdata(palmas->dev);
 	if (palmas_pdata && palmas_pdata->gpio_base)
 		palmas_gpio->gpio_chip.base = palmas_pdata->gpio_base;
diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c b/drivers/gpio/gpio-pmic-eic-sprd.c
index 938285190566..e518490c4b68 100644
--- a/drivers/gpio/gpio-pmic-eic-sprd.c
+++ b/drivers/gpio/gpio-pmic-eic-sprd.c
@@ -331,7 +331,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)
 	pmic_eic->chip.ngpio = SPRD_PMIC_EIC_NR;
 	pmic_eic->chip.base = -1;
 	pmic_eic->chip.parent = &pdev->dev;
-	pmic_eic->chip.of_node = pdev->dev.of_node;
 	pmic_eic->chip.direction_input = sprd_pmic_eic_direction_input;
 	pmic_eic->chip.request = sprd_pmic_eic_request;
 	pmic_eic->chip.free = sprd_pmic_eic_free;
diff --git a/drivers/gpio/gpio-raspberrypi-exp.c b/drivers/gpio/gpio-raspberrypi-exp.c
index 64a552ecc2ad..3c414e0005fc 100644
--- a/drivers/gpio/gpio-raspberrypi-exp.c
+++ b/drivers/gpio/gpio-raspberrypi-exp.c
@@ -221,7 +221,6 @@ static int rpi_exp_gpio_probe(struct platform_device *pdev)
 	rpi_gpio->gc.parent = dev;
 	rpi_gpio->gc.label = MODULE_NAME;
 	rpi_gpio->gc.owner = THIS_MODULE;
-	rpi_gpio->gc.of_node = np;
 	rpi_gpio->gc.base = -1;
 	rpi_gpio->gc.ngpio = NUM_GPIO;
 
diff --git a/drivers/gpio/gpio-rda.c b/drivers/gpio/gpio-rda.c
index 463846431183..0d03f525dcd3 100644
--- a/drivers/gpio/gpio-rda.c
+++ b/drivers/gpio/gpio-rda.c
@@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
 	rda_gpio->chip.label = dev_name(dev);
 	rda_gpio->chip.ngpio = ngpios;
 	rda_gpio->chip.base = -1;
-	rda_gpio->chip.parent = dev;
-	rda_gpio->chip.of_node = np;
 
 	if (rda_gpio->irq >= 0) {
 		rda_gpio->irq_chip.name = "rda-gpio",
diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c
index ce63cbd14d69..577abef578e1 100644
--- a/drivers/gpio/gpio-rockchip.c
+++ b/drivers/gpio/gpio-rockchip.c
@@ -566,9 +566,6 @@ static int rockchip_gpiolib_register(struct rockchip_pin_bank *bank)
 	gc->ngpio = bank->nr_pins;
 	gc->label = bank->name;
 	gc->parent = bank->dev;
-#ifdef CONFIG_OF_GPIO
-	gc->of_node = of_node_get(bank->of_node);
-#endif
 
 	ret = gpiochip_add_data(gc, bank);
 	if (ret) {
diff --git a/drivers/gpio/gpio-sama5d2-piobu.c b/drivers/gpio/gpio-sama5d2-piobu.c
index b7c950658170..3e95da717fc9 100644
--- a/drivers/gpio/gpio-sama5d2-piobu.c
+++ b/drivers/gpio/gpio-sama5d2-piobu.c
@@ -192,7 +192,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, piobu);
 	piobu->chip.label = pdev->name;
 	piobu->chip.parent = &pdev->dev;
-	piobu->chip.of_node = pdev->dev.of_node;
 	piobu->chip.owner = THIS_MODULE,
 	piobu->chip.get_direction = sama5d2_piobu_get_direction,
 	piobu->chip.direction_input = sama5d2_piobu_direction_input,
diff --git a/drivers/gpio/gpio-sprd.c b/drivers/gpio/gpio-sprd.c
index 9dd9dabb579e..9bff63990eee 100644
--- a/drivers/gpio/gpio-sprd.c
+++ b/drivers/gpio/gpio-sprd.c
@@ -237,7 +237,6 @@ static int sprd_gpio_probe(struct platform_device *pdev)
 	sprd_gpio->chip.ngpio = SPRD_GPIO_NR;
 	sprd_gpio->chip.base = -1;
 	sprd_gpio->chip.parent = &pdev->dev;
-	sprd_gpio->chip.of_node = pdev->dev.of_node;
 	sprd_gpio->chip.request = sprd_gpio_request;
 	sprd_gpio->chip.free = sprd_gpio_free;
 	sprd_gpio->chip.get = sprd_gpio_get;
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index dd4d58b4ae49..0fa4f0a93378 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -477,7 +477,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
 	stmpe_gpio->chip = template_chip;
 	stmpe_gpio->chip.ngpio = stmpe->num_gpios;
 	stmpe_gpio->chip.parent = &pdev->dev;
-	stmpe_gpio->chip.of_node = np;
 	stmpe_gpio->chip.base = -1;
 
 	if (IS_ENABLED(CONFIG_DEBUG_FS))
diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c
index 8d158492488f..443fe975bf13 100644
--- a/drivers/gpio/gpio-tc3589x.c
+++ b/drivers/gpio/gpio-tc3589x.c
@@ -319,7 +319,6 @@ static int tc3589x_gpio_probe(struct platform_device *pdev)
 	tc3589x_gpio->chip.ngpio = tc3589x->num_gpio;
 	tc3589x_gpio->chip.parent = &pdev->dev;
 	tc3589x_gpio->chip.base = -1;
-	tc3589x_gpio->chip.of_node = np;
 
 	girq = &tc3589x_gpio->chip.irq;
 	girq->chip = &tc3589x_gpio_irq_chip;
diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index c026e7141e4e..7d90df8c097e 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -748,7 +748,6 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 	gpio->gpio.names = (const char * const *)names;
 
 #if defined(CONFIG_OF_GPIO)
-	gpio->gpio.of_node = pdev->dev.of_node;
 	gpio->gpio.of_gpio_n_cells = 2;
 	gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
 #endif /* CONFIG_OF_GPIO */
diff --git a/drivers/gpio/gpio-tps65218.c b/drivers/gpio/gpio-tps65218.c
index 912382be48e1..e1d425a18854 100644
--- a/drivers/gpio/gpio-tps65218.c
+++ b/drivers/gpio/gpio-tps65218.c
@@ -196,9 +196,6 @@ static int tps65218_gpio_probe(struct platform_device *pdev)
 	tps65218_gpio->tps65218 = tps65218;
 	tps65218_gpio->gpio_chip = template_chip;
 	tps65218_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65218_gpio->gpio_chip.of_node = pdev->dev.of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &tps65218_gpio->gpio_chip,
 				      tps65218_gpio);
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index e0f2b67558e7..20780c35da1b 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -298,7 +298,6 @@ static int vf610_gpio_probe(struct platform_device *pdev)
 	}
 
 	gc = &port->gc;
-	gc->of_node = np;
 	gc->parent = dev;
 	gc->label = "vf610-gpio";
 	gc->ngpio = VF610_GPIO_PER_PORT;
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 0d94d3aef752..9bb0d1c17f67 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -374,7 +374,6 @@ static int xlp_gpio_probe(struct platform_device *pdev)
 	gc->base = 0;
 	gc->parent = &pdev->dev;
 	gc->ngpio = ngpio;
-	gc->of_node = pdev->dev.of_node;
 	gc->direction_output = xlp_gpio_dir_output;
 	gc->direction_input = xlp_gpio_dir_input;
 	gc->set = xlp_gpio_set;
-- 
2.33.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH v1 2/3] gpio: Setup parent device and get rid of unnecessary of_node assignment
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
@ 2021-12-02 21:08   ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Some of the drivers do not set parent device. This may lead to obstacles
during debugging or understanding the device relations from the Linux
point of view. Assign parent device for GPIO chips created by these
drivers.

While at it, let GPIO library to assign of_node from the parent device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-bcm-kona.c  | 2 +-
 drivers/gpio/gpio-creg-snps.c | 2 +-
 drivers/gpio/gpio-lpc32xx.c   | 2 +-
 drivers/gpio/gpio-pxa.c       | 8 +++-----
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index d329a143f5ec..e84474494429 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -606,7 +606,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
 
 	kona_gpio->pdev = pdev;
 	platform_set_drvdata(pdev, kona_gpio);
-	chip->of_node = dev->of_node;
+	chip->parent = dev;
 	chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK;
 
 	kona_gpio->irq_domain = irq_domain_add_linear(dev->of_node,
diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c
index 1d0827e79703..789384c6e178 100644
--- a/drivers/gpio/gpio-creg-snps.c
+++ b/drivers/gpio/gpio-creg-snps.c
@@ -163,12 +163,12 @@ static int creg_gpio_probe(struct platform_device *pdev)
 
 	spin_lock_init(&hcg->lock);
 
+	hcg->gc.parent = dev;
 	hcg->gc.label = dev_name(dev);
 	hcg->gc.base = -1;
 	hcg->gc.ngpio = ngpios;
 	hcg->gc.set = creg_gpio_set;
 	hcg->gc.direction_output = creg_gpio_dir_out;
-	hcg->gc.of_node = dev->of_node;
 
 	ret = devm_gpiochip_add_data(dev, &hcg->gc, hcg);
 	if (ret)
diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
index 4e626c4235c2..d2b65cfb336e 100644
--- a/drivers/gpio/gpio-lpc32xx.c
+++ b/drivers/gpio/gpio-lpc32xx.c
@@ -512,10 +512,10 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev)
 		return PTR_ERR(reg_base);
 
 	for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++) {
+		lpc32xx_gpiochip[i].chip.parent = &pdev->dev;
 		if (pdev->dev.of_node) {
 			lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate;
 			lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3;
-			lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node;
 			lpc32xx_gpiochip[i].reg_base = reg_base;
 		}
 		devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 382468e294e1..c7fbfa3ae43b 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -343,8 +343,7 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc,
 }
 #endif
 
-static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
-			      struct device_node *np, void __iomem *regbase)
+static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, void __iomem *regbase)
 {
 	int i, gpio, nbanks = DIV_ROUND_UP(ngpio, 32);
 	struct pxa_gpio_bank *bank;
@@ -354,6 +353,7 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	if (!pchip->banks)
 		return -ENOMEM;
 
+	pchip->chip.parent = pchip->dev;
 	pchip->chip.label = "gpio-pxa";
 	pchip->chip.direction_input  = pxa_gpio_direction_input;
 	pchip->chip.direction_output = pxa_gpio_direction_output;
@@ -365,7 +365,6 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	pchip->chip.free = gpiochip_generic_free;
 
 #ifdef CONFIG_OF_GPIO
-	pchip->chip.of_node = np;
 	pchip->chip.of_xlate = pxa_gpio_of_xlate;
 	pchip->chip.of_gpio_n_cells = 2;
 #endif
@@ -675,8 +674,7 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	}
 
 	/* Initialize GPIO chips */
-	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, pdev->dev.of_node,
-				 gpio_reg_base);
+	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, gpio_reg_base);
 	if (ret) {
 		clk_put(clk);
 		return ret;
-- 
2.33.0


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

* [PATCH v1 2/3] gpio: Setup parent device and get rid of unnecessary of_node assignment
@ 2021-12-02 21:08   ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Some of the drivers do not set parent device. This may lead to obstacles
during debugging or understanding the device relations from the Linux
point of view. Assign parent device for GPIO chips created by these
drivers.

While at it, let GPIO library to assign of_node from the parent device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-bcm-kona.c  | 2 +-
 drivers/gpio/gpio-creg-snps.c | 2 +-
 drivers/gpio/gpio-lpc32xx.c   | 2 +-
 drivers/gpio/gpio-pxa.c       | 8 +++-----
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index d329a143f5ec..e84474494429 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -606,7 +606,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
 
 	kona_gpio->pdev = pdev;
 	platform_set_drvdata(pdev, kona_gpio);
-	chip->of_node = dev->of_node;
+	chip->parent = dev;
 	chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK;
 
 	kona_gpio->irq_domain = irq_domain_add_linear(dev->of_node,
diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c
index 1d0827e79703..789384c6e178 100644
--- a/drivers/gpio/gpio-creg-snps.c
+++ b/drivers/gpio/gpio-creg-snps.c
@@ -163,12 +163,12 @@ static int creg_gpio_probe(struct platform_device *pdev)
 
 	spin_lock_init(&hcg->lock);
 
+	hcg->gc.parent = dev;
 	hcg->gc.label = dev_name(dev);
 	hcg->gc.base = -1;
 	hcg->gc.ngpio = ngpios;
 	hcg->gc.set = creg_gpio_set;
 	hcg->gc.direction_output = creg_gpio_dir_out;
-	hcg->gc.of_node = dev->of_node;
 
 	ret = devm_gpiochip_add_data(dev, &hcg->gc, hcg);
 	if (ret)
diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
index 4e626c4235c2..d2b65cfb336e 100644
--- a/drivers/gpio/gpio-lpc32xx.c
+++ b/drivers/gpio/gpio-lpc32xx.c
@@ -512,10 +512,10 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev)
 		return PTR_ERR(reg_base);
 
 	for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++) {
+		lpc32xx_gpiochip[i].chip.parent = &pdev->dev;
 		if (pdev->dev.of_node) {
 			lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate;
 			lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3;
-			lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node;
 			lpc32xx_gpiochip[i].reg_base = reg_base;
 		}
 		devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 382468e294e1..c7fbfa3ae43b 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -343,8 +343,7 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc,
 }
 #endif
 
-static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
-			      struct device_node *np, void __iomem *regbase)
+static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, void __iomem *regbase)
 {
 	int i, gpio, nbanks = DIV_ROUND_UP(ngpio, 32);
 	struct pxa_gpio_bank *bank;
@@ -354,6 +353,7 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	if (!pchip->banks)
 		return -ENOMEM;
 
+	pchip->chip.parent = pchip->dev;
 	pchip->chip.label = "gpio-pxa";
 	pchip->chip.direction_input  = pxa_gpio_direction_input;
 	pchip->chip.direction_output = pxa_gpio_direction_output;
@@ -365,7 +365,6 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	pchip->chip.free = gpiochip_generic_free;
 
 #ifdef CONFIG_OF_GPIO
-	pchip->chip.of_node = np;
 	pchip->chip.of_xlate = pxa_gpio_of_xlate;
 	pchip->chip.of_gpio_n_cells = 2;
 #endif
@@ -675,8 +674,7 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	}
 
 	/* Initialize GPIO chips */
-	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, pdev->dev.of_node,
-				 gpio_reg_base);
+	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, gpio_reg_base);
 	if (ret) {
 		clk_put(clk);
 		return ret;
-- 
2.33.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v1 2/3] gpio: Setup parent device and get rid of unnecessary of_node assignment
@ 2021-12-02 21:08   ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Some of the drivers do not set parent device. This may lead to obstacles
during debugging or understanding the device relations from the Linux
point of view. Assign parent device for GPIO chips created by these
drivers.

While at it, let GPIO library to assign of_node from the parent device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-bcm-kona.c  | 2 +-
 drivers/gpio/gpio-creg-snps.c | 2 +-
 drivers/gpio/gpio-lpc32xx.c   | 2 +-
 drivers/gpio/gpio-pxa.c       | 8 +++-----
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c
index d329a143f5ec..e84474494429 100644
--- a/drivers/gpio/gpio-bcm-kona.c
+++ b/drivers/gpio/gpio-bcm-kona.c
@@ -606,7 +606,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
 
 	kona_gpio->pdev = pdev;
 	platform_set_drvdata(pdev, kona_gpio);
-	chip->of_node = dev->of_node;
+	chip->parent = dev;
 	chip->ngpio = kona_gpio->num_bank * GPIO_PER_BANK;
 
 	kona_gpio->irq_domain = irq_domain_add_linear(dev->of_node,
diff --git a/drivers/gpio/gpio-creg-snps.c b/drivers/gpio/gpio-creg-snps.c
index 1d0827e79703..789384c6e178 100644
--- a/drivers/gpio/gpio-creg-snps.c
+++ b/drivers/gpio/gpio-creg-snps.c
@@ -163,12 +163,12 @@ static int creg_gpio_probe(struct platform_device *pdev)
 
 	spin_lock_init(&hcg->lock);
 
+	hcg->gc.parent = dev;
 	hcg->gc.label = dev_name(dev);
 	hcg->gc.base = -1;
 	hcg->gc.ngpio = ngpios;
 	hcg->gc.set = creg_gpio_set;
 	hcg->gc.direction_output = creg_gpio_dir_out;
-	hcg->gc.of_node = dev->of_node;
 
 	ret = devm_gpiochip_add_data(dev, &hcg->gc, hcg);
 	if (ret)
diff --git a/drivers/gpio/gpio-lpc32xx.c b/drivers/gpio/gpio-lpc32xx.c
index 4e626c4235c2..d2b65cfb336e 100644
--- a/drivers/gpio/gpio-lpc32xx.c
+++ b/drivers/gpio/gpio-lpc32xx.c
@@ -512,10 +512,10 @@ static int lpc32xx_gpio_probe(struct platform_device *pdev)
 		return PTR_ERR(reg_base);
 
 	for (i = 0; i < ARRAY_SIZE(lpc32xx_gpiochip); i++) {
+		lpc32xx_gpiochip[i].chip.parent = &pdev->dev;
 		if (pdev->dev.of_node) {
 			lpc32xx_gpiochip[i].chip.of_xlate = lpc32xx_of_xlate;
 			lpc32xx_gpiochip[i].chip.of_gpio_n_cells = 3;
-			lpc32xx_gpiochip[i].chip.of_node = pdev->dev.of_node;
 			lpc32xx_gpiochip[i].reg_base = reg_base;
 		}
 		devm_gpiochip_add_data(&pdev->dev, &lpc32xx_gpiochip[i].chip,
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 382468e294e1..c7fbfa3ae43b 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -343,8 +343,7 @@ static int pxa_gpio_of_xlate(struct gpio_chip *gc,
 }
 #endif
 
-static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
-			      struct device_node *np, void __iomem *regbase)
+static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio, void __iomem *regbase)
 {
 	int i, gpio, nbanks = DIV_ROUND_UP(ngpio, 32);
 	struct pxa_gpio_bank *bank;
@@ -354,6 +353,7 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	if (!pchip->banks)
 		return -ENOMEM;
 
+	pchip->chip.parent = pchip->dev;
 	pchip->chip.label = "gpio-pxa";
 	pchip->chip.direction_input  = pxa_gpio_direction_input;
 	pchip->chip.direction_output = pxa_gpio_direction_output;
@@ -365,7 +365,6 @@ static int pxa_init_gpio_chip(struct pxa_gpio_chip *pchip, int ngpio,
 	pchip->chip.free = gpiochip_generic_free;
 
 #ifdef CONFIG_OF_GPIO
-	pchip->chip.of_node = np;
 	pchip->chip.of_xlate = pxa_gpio_of_xlate;
 	pchip->chip.of_gpio_n_cells = 2;
 #endif
@@ -675,8 +674,7 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	}
 
 	/* Initialize GPIO chips */
-	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, pdev->dev.of_node,
-				 gpio_reg_base);
+	ret = pxa_init_gpio_chip(pchip, pxa_last_gpio + 1, gpio_reg_base);
 	if (ret) {
 		clk_put(clk);
 		return ret;
-- 
2.33.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH v1 3/3] gpio: Propagate firmware node from a parent device
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
@ 2021-12-02 21:08   ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

When creating MFD platform devices the firmware node is left unset.
This, in particular, prevents GPIO library to use it for different
purposes. Propagate firmware node from the parent device and let
GPIO library do the right thing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-arizona.c  | 5 ++---
 drivers/gpio/gpio-tps6586x.c | 5 ++---
 drivers/gpio/gpio-tps65910.c | 6 +++---
 drivers/gpio/gpio-twl6040.c  | 5 ++---
 drivers/gpio/gpio-wm831x.c   | 5 ++---
 5 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 2bc173c352ce..02f9ae19cd44 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -151,6 +151,8 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	struct arizona_gpio *arizona_gpio;
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio),
 				    GFP_KERNEL);
 	if (!arizona_gpio)
@@ -159,9 +161,6 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	arizona_gpio->arizona = arizona;
 	arizona_gpio->gpio_chip = template_chip;
 	arizona_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	arizona_gpio->gpio_chip.of_node = arizona->dev->of_node;
-#endif
 
 	switch (arizona->type) {
 	case WM5102:
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index da0304b764a5..c5713524b581 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -77,6 +77,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	struct tps6586x_platform_data *pdata;
 	struct tps6586x_gpio *tps6586x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	pdata = dev_get_platdata(pdev->dev.parent);
 	tps6586x_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps6586x_gpio), GFP_KERNEL);
@@ -97,9 +99,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	tps6586x_gpio->gpio_chip.get	= tps6586x_gpio_get;
 	tps6586x_gpio->gpio_chip.to_irq	= tps6586x_gpio_to_irq;
 
-#ifdef CONFIG_OF_GPIO
-	tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;
-#endif
 	if (pdata && pdata->gpio_base)
 		tps6586x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 7fa8c841081f..321e6945f0be 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -111,6 +111,8 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	int ret;
 	int i;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	tps65910_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps65910_gpio), GFP_KERNEL);
 	if (!tps65910_gpio)
@@ -137,9 +139,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	tps65910_gpio->gpio_chip.set	= tps65910_gpio_set;
 	tps65910_gpio->gpio_chip.get	= tps65910_gpio_get;
 	tps65910_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
-#endif
+
 	if (pdata && pdata->gpio_base)
 		tps65910_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index 648fb418d775..6c3fbf382dba 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -80,6 +80,8 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 	struct twl6040 *twl6040 = dev_get_drvdata(twl6040_core_dev);
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	twl6040gpo_chip.base = -1;
 
 	if (twl6040_get_revid(twl6040) < TWL6041_REV_ES2_0)
@@ -88,9 +90,6 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 		twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */
 
 	twl6040gpo_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
-#endif
 
 	ret = devm_gpiochip_add_data(&pdev->dev, &twl6040gpo_chip, NULL);
 	if (ret < 0) {
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 9cf1e5ebb352..7eaf8a28638c 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -262,6 +262,8 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 	struct wm831x_pdata *pdata = &wm831x->pdata;
 	struct wm831x_gpio *wm831x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	wm831x_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm831x_gpio),
 				   GFP_KERNEL);
 	if (wm831x_gpio == NULL)
@@ -275,9 +277,6 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 		wm831x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
 		wm831x_gpio->gpio_chip.base = -1;
-#ifdef CONFIG_OF_GPIO
-	wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, wm831x_gpio);
 }
-- 
2.33.0


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

* [PATCH v1 3/3] gpio: Propagate firmware node from a parent device
@ 2021-12-02 21:08   ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

When creating MFD platform devices the firmware node is left unset.
This, in particular, prevents GPIO library to use it for different
purposes. Propagate firmware node from the parent device and let
GPIO library do the right thing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-arizona.c  | 5 ++---
 drivers/gpio/gpio-tps6586x.c | 5 ++---
 drivers/gpio/gpio-tps65910.c | 6 +++---
 drivers/gpio/gpio-twl6040.c  | 5 ++---
 drivers/gpio/gpio-wm831x.c   | 5 ++---
 5 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 2bc173c352ce..02f9ae19cd44 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -151,6 +151,8 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	struct arizona_gpio *arizona_gpio;
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio),
 				    GFP_KERNEL);
 	if (!arizona_gpio)
@@ -159,9 +161,6 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	arizona_gpio->arizona = arizona;
 	arizona_gpio->gpio_chip = template_chip;
 	arizona_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	arizona_gpio->gpio_chip.of_node = arizona->dev->of_node;
-#endif
 
 	switch (arizona->type) {
 	case WM5102:
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index da0304b764a5..c5713524b581 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -77,6 +77,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	struct tps6586x_platform_data *pdata;
 	struct tps6586x_gpio *tps6586x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	pdata = dev_get_platdata(pdev->dev.parent);
 	tps6586x_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps6586x_gpio), GFP_KERNEL);
@@ -97,9 +99,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	tps6586x_gpio->gpio_chip.get	= tps6586x_gpio_get;
 	tps6586x_gpio->gpio_chip.to_irq	= tps6586x_gpio_to_irq;
 
-#ifdef CONFIG_OF_GPIO
-	tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;
-#endif
 	if (pdata && pdata->gpio_base)
 		tps6586x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 7fa8c841081f..321e6945f0be 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -111,6 +111,8 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	int ret;
 	int i;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	tps65910_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps65910_gpio), GFP_KERNEL);
 	if (!tps65910_gpio)
@@ -137,9 +139,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	tps65910_gpio->gpio_chip.set	= tps65910_gpio_set;
 	tps65910_gpio->gpio_chip.get	= tps65910_gpio_get;
 	tps65910_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
-#endif
+
 	if (pdata && pdata->gpio_base)
 		tps65910_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index 648fb418d775..6c3fbf382dba 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -80,6 +80,8 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 	struct twl6040 *twl6040 = dev_get_drvdata(twl6040_core_dev);
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	twl6040gpo_chip.base = -1;
 
 	if (twl6040_get_revid(twl6040) < TWL6041_REV_ES2_0)
@@ -88,9 +90,6 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 		twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */
 
 	twl6040gpo_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
-#endif
 
 	ret = devm_gpiochip_add_data(&pdev->dev, &twl6040gpo_chip, NULL);
 	if (ret < 0) {
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 9cf1e5ebb352..7eaf8a28638c 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -262,6 +262,8 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 	struct wm831x_pdata *pdata = &wm831x->pdata;
 	struct wm831x_gpio *wm831x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	wm831x_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm831x_gpio),
 				   GFP_KERNEL);
 	if (wm831x_gpio == NULL)
@@ -275,9 +277,6 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 		wm831x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
 		wm831x_gpio->gpio_chip.base = -1;
-#ifdef CONFIG_OF_GPIO
-	wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, wm831x_gpio);
 }
-- 
2.33.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v1 3/3] gpio: Propagate firmware node from a parent device
@ 2021-12-02 21:08   ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-02 21:08 UTC (permalink / raw)
  To: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra
  Cc: Ray Jui, Florian Fainelli, Scott Branden, Gregory Fong,
	Eugeniy Paltsev, Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

When creating MFD platform devices the firmware node is left unset.
This, in particular, prevents GPIO library to use it for different
purposes. Propagate firmware node from the parent device and let
GPIO library do the right thing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-arizona.c  | 5 ++---
 drivers/gpio/gpio-tps6586x.c | 5 ++---
 drivers/gpio/gpio-tps65910.c | 6 +++---
 drivers/gpio/gpio-twl6040.c  | 5 ++---
 drivers/gpio/gpio-wm831x.c   | 5 ++---
 5 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 2bc173c352ce..02f9ae19cd44 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -151,6 +151,8 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	struct arizona_gpio *arizona_gpio;
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	arizona_gpio = devm_kzalloc(&pdev->dev, sizeof(*arizona_gpio),
 				    GFP_KERNEL);
 	if (!arizona_gpio)
@@ -159,9 +161,6 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	arizona_gpio->arizona = arizona;
 	arizona_gpio->gpio_chip = template_chip;
 	arizona_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	arizona_gpio->gpio_chip.of_node = arizona->dev->of_node;
-#endif
 
 	switch (arizona->type) {
 	case WM5102:
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index da0304b764a5..c5713524b581 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -77,6 +77,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	struct tps6586x_platform_data *pdata;
 	struct tps6586x_gpio *tps6586x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	pdata = dev_get_platdata(pdev->dev.parent);
 	tps6586x_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps6586x_gpio), GFP_KERNEL);
@@ -97,9 +99,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
 	tps6586x_gpio->gpio_chip.get	= tps6586x_gpio_get;
 	tps6586x_gpio->gpio_chip.to_irq	= tps6586x_gpio_to_irq;
 
-#ifdef CONFIG_OF_GPIO
-	tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;
-#endif
 	if (pdata && pdata->gpio_base)
 		tps6586x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-tps65910.c b/drivers/gpio/gpio-tps65910.c
index 7fa8c841081f..321e6945f0be 100644
--- a/drivers/gpio/gpio-tps65910.c
+++ b/drivers/gpio/gpio-tps65910.c
@@ -111,6 +111,8 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	int ret;
 	int i;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	tps65910_gpio = devm_kzalloc(&pdev->dev,
 				sizeof(*tps65910_gpio), GFP_KERNEL);
 	if (!tps65910_gpio)
@@ -137,9 +139,7 @@ static int tps65910_gpio_probe(struct platform_device *pdev)
 	tps65910_gpio->gpio_chip.set	= tps65910_gpio_set;
 	tps65910_gpio->gpio_chip.get	= tps65910_gpio_get;
 	tps65910_gpio->gpio_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	tps65910_gpio->gpio_chip.of_node = tps65910->dev->of_node;
-#endif
+
 	if (pdata && pdata->gpio_base)
 		tps65910_gpio->gpio_chip.base = pdata->gpio_base;
 	else
diff --git a/drivers/gpio/gpio-twl6040.c b/drivers/gpio/gpio-twl6040.c
index 648fb418d775..6c3fbf382dba 100644
--- a/drivers/gpio/gpio-twl6040.c
+++ b/drivers/gpio/gpio-twl6040.c
@@ -80,6 +80,8 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 	struct twl6040 *twl6040 = dev_get_drvdata(twl6040_core_dev);
 	int ret;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	twl6040gpo_chip.base = -1;
 
 	if (twl6040_get_revid(twl6040) < TWL6041_REV_ES2_0)
@@ -88,9 +90,6 @@ static int gpo_twl6040_probe(struct platform_device *pdev)
 		twl6040gpo_chip.ngpio = 1; /* twl6041 have 1 GPO */
 
 	twl6040gpo_chip.parent = &pdev->dev;
-#ifdef CONFIG_OF_GPIO
-	twl6040gpo_chip.of_node = twl6040_core_dev->of_node;
-#endif
 
 	ret = devm_gpiochip_add_data(&pdev->dev, &twl6040gpo_chip, NULL);
 	if (ret < 0) {
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c
index 9cf1e5ebb352..7eaf8a28638c 100644
--- a/drivers/gpio/gpio-wm831x.c
+++ b/drivers/gpio/gpio-wm831x.c
@@ -262,6 +262,8 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 	struct wm831x_pdata *pdata = &wm831x->pdata;
 	struct wm831x_gpio *wm831x_gpio;
 
+	device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
 	wm831x_gpio = devm_kzalloc(&pdev->dev, sizeof(*wm831x_gpio),
 				   GFP_KERNEL);
 	if (wm831x_gpio == NULL)
@@ -275,9 +277,6 @@ static int wm831x_gpio_probe(struct platform_device *pdev)
 		wm831x_gpio->gpio_chip.base = pdata->gpio_base;
 	else
 		wm831x_gpio->gpio_chip.base = -1;
-#ifdef CONFIG_OF_GPIO
-	wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node;
-#endif
 
 	return devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, wm831x_gpio);
 }
-- 
2.33.0


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-03  8:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-03  8:40 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

I have a bad feeling about this but I've gone through the drivers in
this patch and it seems like you don't update any of the drivers that
use multiple child OF nodes so I can't really point out any obvious
bug.

I have another change I'm working on that's related, let me send it shortly.

Bart

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03  8:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-03  8:40 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

I have a bad feeling about this but I've gone through the drivers in
this patch and it seems like you don't update any of the drivers that
use multiple child OF nodes so I can't really point out any obvious
bug.

I have another change I'm working on that's related, let me send it shortly.

Bart

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03  8:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-03  8:40 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

I have a bad feeling about this but I've gone through the drivers in
this patch and it seems like you don't update any of the drivers that
use multiple child OF nodes so I can't really point out any obvious
bug.

I have another change I'm working on that's related, let me send it shortly.

Bart

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03  8:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-03  8:40 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

I have a bad feeling about this but I've gone through the drivers in
this patch and it seems like you don't update any of the drivers that
use multiple child OF nodes so I can't really point out any obvious
bug.

I have another change I'm working on that's related, let me send it shortly.

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-03  8:40   ` Bartosz Golaszewski
  (?)
  (?)
@ 2021-12-03 12:25     ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-03 12:25 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Fri, Dec 03, 2021 at 09:40:55AM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> 
> I have a bad feeling about this but I've gone through the drivers in
> this patch and it seems like you don't update any of the drivers that
> use multiple child OF nodes so I can't really point out any obvious
> bug.

Yes, like I said it's just a series to kick off the conversion.
I left the corner cases to the last.

> I have another change I'm working on that's related, let me send it shortly.

Do you mean it should be attached to the series?

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03 12:25     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-03 12:25 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Fri, Dec 03, 2021 at 09:40:55AM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> 
> I have a bad feeling about this but I've gone through the drivers in
> this patch and it seems like you don't update any of the drivers that
> use multiple child OF nodes so I can't really point out any obvious
> bug.

Yes, like I said it's just a series to kick off the conversion.
I left the corner cases to the last.

> I have another change I'm working on that's related, let me send it shortly.

Do you mean it should be attached to the series?

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03 12:25     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-03 12:25 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Fri, Dec 03, 2021 at 09:40:55AM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> 
> I have a bad feeling about this but I've gone through the drivers in
> this patch and it seems like you don't update any of the drivers that
> use multiple child OF nodes so I can't really point out any obvious
> bug.

Yes, like I said it's just a series to kick off the conversion.
I left the corner cases to the last.

> I have another change I'm working on that's related, let me send it shortly.

Do you mean it should be attached to the series?

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-03 12:25     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-03 12:25 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Fri, Dec 03, 2021 at 09:40:55AM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> 
> I have a bad feeling about this but I've gone through the drivers in
> this patch and it seems like you don't update any of the drivers that
> use multiple child OF nodes so I can't really point out any obvious
> bug.

Yes, like I said it's just a series to kick off the conversion.
I left the corner cases to the last.

> I have another change I'm working on that's related, let me send it shortly.

Do you mean it should be attached to the series?

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-05  0:06   ` Linus Walleij
  -1 siblings, 0 replies; 58+ messages in thread
From: Linus Walleij @ 2021-12-05  0:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This is definitely a patch in the right direction, as Bart says
it can be a bit dangerous, the outliers are those drivers that
assign the .dev to something completely different than the
the dev where the of_node is copied from.

The idea was definitely always to only assign it in the core
*unless* there is a reason to have a completely different
of_node for some reason.

> +++ b/drivers/gpio/gpio-rda.c
> @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
>         rda_gpio->chip.label = dev_name(dev);
>         rda_gpio->chip.ngpio = ngpios;
>         rda_gpio->chip.base = -1;
> -       rda_gpio->chip.parent = dev;
> -       rda_gpio->chip.of_node = np;

Mention in the commit message that in this driver
you also drop the the .parent assignment because the
core will handle it.

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-05  0:06   ` Linus Walleij
  0 siblings, 0 replies; 58+ messages in thread
From: Linus Walleij @ 2021-12-05  0:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This is definitely a patch in the right direction, as Bart says
it can be a bit dangerous, the outliers are those drivers that
assign the .dev to something completely different than the
the dev where the of_node is copied from.

The idea was definitely always to only assign it in the core
*unless* there is a reason to have a completely different
of_node for some reason.

> +++ b/drivers/gpio/gpio-rda.c
> @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
>         rda_gpio->chip.label = dev_name(dev);
>         rda_gpio->chip.ngpio = ngpios;
>         rda_gpio->chip.base = -1;
> -       rda_gpio->chip.parent = dev;
> -       rda_gpio->chip.of_node = np;

Mention in the commit message that in this driver
you also drop the the .parent assignment because the
core will handle it.

Yours,
Linus Walleij

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-05  0:06   ` Linus Walleij
  0 siblings, 0 replies; 58+ messages in thread
From: Linus Walleij @ 2021-12-05  0:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This is definitely a patch in the right direction, as Bart says
it can be a bit dangerous, the outliers are those drivers that
assign the .dev to something completely different than the
the dev where the of_node is copied from.

The idea was definitely always to only assign it in the core
*unless* there is a reason to have a completely different
of_node for some reason.

> +++ b/drivers/gpio/gpio-rda.c
> @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
>         rda_gpio->chip.label = dev_name(dev);
>         rda_gpio->chip.ngpio = ngpios;
>         rda_gpio->chip.base = -1;
> -       rda_gpio->chip.parent = dev;
> -       rda_gpio->chip.of_node = np;

Mention in the commit message that in this driver
you also drop the the .parent assignment because the
core will handle it.

Yours,
Linus Walleij

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-05  0:06   ` Linus Walleij
  0 siblings, 0 replies; 58+ messages in thread
From: Linus Walleij @ 2021-12-05  0:06 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

This is definitely a patch in the right direction, as Bart says
it can be a bit dangerous, the outliers are those drivers that
assign the .dev to something completely different than the
the dev where the of_node is copied from.

The idea was definitely always to only assign it in the core
*unless* there is a reason to have a completely different
of_node for some reason.

> +++ b/drivers/gpio/gpio-rda.c
> @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
>         rda_gpio->chip.label = dev_name(dev);
>         rda_gpio->chip.ngpio = ngpios;
>         rda_gpio->chip.base = -1;
> -       rda_gpio->chip.parent = dev;
> -       rda_gpio->chip.of_node = np;

Mention in the commit message that in this driver
you also drop the the .parent assignment because the
core will handle it.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-05  0:06   ` Linus Walleij
  (?)
  (?)
@ 2021-12-06 13:11     ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-06 13:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This is definitely a patch in the right direction, as Bart says
> it can be a bit dangerous, the outliers are those drivers that
> assign the .dev to something completely different than the
> the dev where the of_node is copied from.

I carefully checked these all and this patch series is only for the cases
when I'm sure it's the same device, which is used as parent, and its of_node
supplied.

> The idea was definitely always to only assign it in the core
> *unless* there is a reason to have a completely different
> of_node for some reason.
> 
> > +++ b/drivers/gpio/gpio-rda.c
> > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> >         rda_gpio->chip.label = dev_name(dev);
> >         rda_gpio->chip.ngpio = ngpios;
> >         rda_gpio->chip.base = -1;
> > -       rda_gpio->chip.parent = dev;
> > -       rda_gpio->chip.of_node = np;
> 
> Mention in the commit message that in this driver
> you also drop the the .parent assignment because the
> core will handle it.

Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
("gpio: bd70528 Drop BD70528 support").

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:11     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-06 13:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This is definitely a patch in the right direction, as Bart says
> it can be a bit dangerous, the outliers are those drivers that
> assign the .dev to something completely different than the
> the dev where the of_node is copied from.

I carefully checked these all and this patch series is only for the cases
when I'm sure it's the same device, which is used as parent, and its of_node
supplied.

> The idea was definitely always to only assign it in the core
> *unless* there is a reason to have a completely different
> of_node for some reason.
> 
> > +++ b/drivers/gpio/gpio-rda.c
> > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> >         rda_gpio->chip.label = dev_name(dev);
> >         rda_gpio->chip.ngpio = ngpios;
> >         rda_gpio->chip.base = -1;
> > -       rda_gpio->chip.parent = dev;
> > -       rda_gpio->chip.of_node = np;
> 
> Mention in the commit message that in this driver
> you also drop the the .parent assignment because the
> core will handle it.

Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
("gpio: bd70528 Drop BD70528 support").

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:11     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-06 13:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This is definitely a patch in the right direction, as Bart says
> it can be a bit dangerous, the outliers are those drivers that
> assign the .dev to something completely different than the
> the dev where the of_node is copied from.

I carefully checked these all and this patch series is only for the cases
when I'm sure it's the same device, which is used as parent, and its of_node
supplied.

> The idea was definitely always to only assign it in the core
> *unless* there is a reason to have a completely different
> of_node for some reason.
> 
> > +++ b/drivers/gpio/gpio-rda.c
> > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> >         rda_gpio->chip.label = dev_name(dev);
> >         rda_gpio->chip.ngpio = ngpios;
> >         rda_gpio->chip.base = -1;
> > -       rda_gpio->chip.parent = dev;
> > -       rda_gpio->chip.of_node = np;
> 
> Mention in the commit message that in this driver
> you also drop the the .parent assignment because the
> core will handle it.

Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
("gpio: bd70528 Drop BD70528 support").

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:11     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-06 13:11 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> This is definitely a patch in the right direction, as Bart says
> it can be a bit dangerous, the outliers are those drivers that
> assign the .dev to something completely different than the
> the dev where the of_node is copied from.

I carefully checked these all and this patch series is only for the cases
when I'm sure it's the same device, which is used as parent, and its of_node
supplied.

> The idea was definitely always to only assign it in the core
> *unless* there is a reason to have a completely different
> of_node for some reason.
> 
> > +++ b/drivers/gpio/gpio-rda.c
> > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> >         rda_gpio->chip.label = dev_name(dev);
> >         rda_gpio->chip.ngpio = ngpios;
> >         rda_gpio->chip.base = -1;
> > -       rda_gpio->chip.parent = dev;
> > -       rda_gpio->chip.of_node = np;
> 
> Mention in the commit message that in this driver
> you also drop the the .parent assignment because the
> core will handle it.

Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
("gpio: bd70528 Drop BD70528 support").

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-06 13:11     ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-06 13:19       ` Bartosz Golaszewski
  -1 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-06 13:19 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Marc Zyngier, Matti Vaittinen, Sergio Paracuellos,
	Chunyan Zhang, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 6, 2021 at 2:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > GPIO library does copy the of_node from the parent device of
> > > the GPIO chip, there is no need to repeat this in the individual
> > > drivers. Remove these assignment all at once.
> > >
> > > For the details one may look into the of_gpio_dev_init() implementation.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > This is definitely a patch in the right direction, as Bart says
> > it can be a bit dangerous, the outliers are those drivers that
> > assign the .dev to something completely different than the
> > the dev where the of_node is copied from.
>
> I carefully checked these all and this patch series is only for the cases
> when I'm sure it's the same device, which is used as parent, and its of_node
> supplied.
>
> > The idea was definitely always to only assign it in the core
> > *unless* there is a reason to have a completely different
> > of_node for some reason.
> >
> > > +++ b/drivers/gpio/gpio-rda.c
> > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> > >         rda_gpio->chip.label = dev_name(dev);
> > >         rda_gpio->chip.ngpio = ngpios;
> > >         rda_gpio->chip.base = -1;
> > > -       rda_gpio->chip.parent = dev;
> > > -       rda_gpio->chip.of_node = np;
> >
> > Mention in the commit message that in this driver
> > you also drop the the .parent assignment because the
> > core will handle it.
>
> Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
> is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
> ("gpio: bd70528 Drop BD70528 support").
>

I didn't plan to, just drop it from your patch.

Bart

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:19       ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-06 13:19 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Marc Zyngier, Matti Vaittinen, Sergio Paracuellos,
	Chunyan Zhang, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 6, 2021 at 2:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > GPIO library does copy the of_node from the parent device of
> > > the GPIO chip, there is no need to repeat this in the individual
> > > drivers. Remove these assignment all at once.
> > >
> > > For the details one may look into the of_gpio_dev_init() implementation.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > This is definitely a patch in the right direction, as Bart says
> > it can be a bit dangerous, the outliers are those drivers that
> > assign the .dev to something completely different than the
> > the dev where the of_node is copied from.
>
> I carefully checked these all and this patch series is only for the cases
> when I'm sure it's the same device, which is used as parent, and its of_node
> supplied.
>
> > The idea was definitely always to only assign it in the core
> > *unless* there is a reason to have a completely different
> > of_node for some reason.
> >
> > > +++ b/drivers/gpio/gpio-rda.c
> > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> > >         rda_gpio->chip.label = dev_name(dev);
> > >         rda_gpio->chip.ngpio = ngpios;
> > >         rda_gpio->chip.base = -1;
> > > -       rda_gpio->chip.parent = dev;
> > > -       rda_gpio->chip.of_node = np;
> >
> > Mention in the commit message that in this driver
> > you also drop the the .parent assignment because the
> > core will handle it.
>
> Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
> is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
> ("gpio: bd70528 Drop BD70528 support").
>

I didn't plan to, just drop it from your patch.

Bart

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:19       ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-06 13:19 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Marc Zyngier, Matti Vaittinen, Sergio Paracuellos,
	Chunyan Zhang, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 6, 2021 at 2:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > GPIO library does copy the of_node from the parent device of
> > > the GPIO chip, there is no need to repeat this in the individual
> > > drivers. Remove these assignment all at once.
> > >
> > > For the details one may look into the of_gpio_dev_init() implementation.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > This is definitely a patch in the right direction, as Bart says
> > it can be a bit dangerous, the outliers are those drivers that
> > assign the .dev to something completely different than the
> > the dev where the of_node is copied from.
>
> I carefully checked these all and this patch series is only for the cases
> when I'm sure it's the same device, which is used as parent, and its of_node
> supplied.
>
> > The idea was definitely always to only assign it in the core
> > *unless* there is a reason to have a completely different
> > of_node for some reason.
> >
> > > +++ b/drivers/gpio/gpio-rda.c
> > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> > >         rda_gpio->chip.label = dev_name(dev);
> > >         rda_gpio->chip.ngpio = ngpios;
> > >         rda_gpio->chip.base = -1;
> > > -       rda_gpio->chip.parent = dev;
> > > -       rda_gpio->chip.of_node = np;
> >
> > Mention in the commit message that in this driver
> > you also drop the the .parent assignment because the
> > core will handle it.
>
> Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
> is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
> ("gpio: bd70528 Drop BD70528 support").
>

I didn't plan to, just drop it from your patch.

Bart

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 13:19       ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-06 13:19 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Marc Zyngier, Matti Vaittinen, Sergio Paracuellos,
	Chunyan Zhang, Baruch Siach, Uwe Kleine-König,
	Tony Lindgren, Nicolas Saenz Julienne, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	linux-pwm, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 6, 2021 at 2:13 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Sun, Dec 05, 2021 at 01:06:07AM +0100, Linus Walleij wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> >
> > > GPIO library does copy the of_node from the parent device of
> > > the GPIO chip, there is no need to repeat this in the individual
> > > drivers. Remove these assignment all at once.
> > >
> > > For the details one may look into the of_gpio_dev_init() implementation.
> > >
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> >
> > This is definitely a patch in the right direction, as Bart says
> > it can be a bit dangerous, the outliers are those drivers that
> > assign the .dev to something completely different than the
> > the dev where the of_node is copied from.
>
> I carefully checked these all and this patch series is only for the cases
> when I'm sure it's the same device, which is used as parent, and its of_node
> supplied.
>
> > The idea was definitely always to only assign it in the core
> > *unless* there is a reason to have a completely different
> > of_node for some reason.
> >
> > > +++ b/drivers/gpio/gpio-rda.c
> > > @@ -240,8 +240,6 @@ static int rda_gpio_probe(struct platform_device *pdev)
> > >         rda_gpio->chip.label = dev_name(dev);
> > >         rda_gpio->chip.ngpio = ngpios;
> > >         rda_gpio->chip.base = -1;
> > > -       rda_gpio->chip.parent = dev;
> > > -       rda_gpio->chip.of_node = np;
> >
> > Mention in the commit message that in this driver
> > you also drop the the .parent assignment because the
> > core will handle it.
>
> Okay, I will update it. Also I'll update to the last codebase (dunno if Bart
> is going to pull the IB from Lee where one of the drivers is gone: da53cc634cea
> ("gpio: bd70528 Drop BD70528 support").
>

I didn't plan to, just drop it from your patch.

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-07  8:03   ` Uwe Kleine-König
  -1 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2021-12-07  8:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

Hello Andy,

you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
anything pwm specific here (apart from touching gpio-mvebu which also
contains a PWM driver). Do I miss something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:03   ` Uwe Kleine-König
  0 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2021-12-07  8:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter


[-- Attachment #1.1: Type: text/plain, Size: 384 bytes --]

Hello Andy,

you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
anything pwm specific here (apart from touching gpio-mvebu which also
contains a PWM driver). Do I miss something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:03   ` Uwe Kleine-König
  0 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2021-12-07  8:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter


[-- Attachment #1.1: Type: text/plain, Size: 384 bytes --]

Hello Andy,

you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
anything pwm specific here (apart from touching gpio-mvebu which also
contains a PWM driver). Do I miss something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:03   ` Uwe Kleine-König
  0 siblings, 0 replies; 58+ messages in thread
From: Uwe Kleine-König @ 2021-12-07  8:03 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Bartosz Golaszewski, Baruch Siach, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter


[-- Attachment #1.1: Type: text/plain, Size: 384 bytes --]

Hello Andy,

you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
anything pwm specific here (apart from touching gpio-mvebu which also
contains a PWM driver). Do I miss something?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-07  8:03   ` Uwe Kleine-König
  (?)
  (?)
@ 2021-12-07  8:05     ` Baruch Siach
  -1 siblings, 0 replies; 58+ messages in thread
From: Baruch Siach @ 2021-12-07  8:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Hi Uwe,

On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> Hello Andy,
>
> you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> anything pwm specific here (apart from touching gpio-mvebu which also
> contains a PWM driver). Do I miss something?

That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
MAINTAINERS PWM entry.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:05     ` Baruch Siach
  0 siblings, 0 replies; 58+ messages in thread
From: Baruch Siach @ 2021-12-07  8:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Hi Uwe,

On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> Hello Andy,
>
> you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> anything pwm specific here (apart from touching gpio-mvebu which also
> contains a PWM driver). Do I miss something?

That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
MAINTAINERS PWM entry.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:05     ` Baruch Siach
  0 siblings, 0 replies; 58+ messages in thread
From: Baruch Siach @ 2021-12-07  8:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Hi Uwe,

On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> Hello Andy,
>
> you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> anything pwm specific here (apart from touching gpio-mvebu which also
> contains a PWM driver). Do I miss something?

That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
MAINTAINERS PWM entry.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07  8:05     ` Baruch Siach
  0 siblings, 0 replies; 58+ messages in thread
From: Baruch Siach @ 2021-12-07  8:05 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Shevchenko, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

Hi Uwe,

On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> Hello Andy,
>
> you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> anything pwm specific here (apart from touching gpio-mvebu which also
> contains a PWM driver). Do I miss something?

That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
MAINTAINERS PWM entry.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-07  8:05     ` Baruch Siach
  (?)
  (?)
@ 2021-12-07 10:43       ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-07 10:43 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Uwe Kleine-König, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Tue, Dec 07, 2021 at 10:05:08AM +0200, Baruch Siach wrote:
> On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> > Hello Andy,
> >
> > you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> > anything pwm specific here (apart from touching gpio-mvebu which also
> > contains a PWM driver). Do I miss something?

Thanks for your eagle eye! For the record I don't do this list manually,
I used the get_maintainer.pl's heuristics [1]. Usually it gives me more
than 95% correct prediction, so I believe here is no smoke without flame
(and it seems what Baruch discovered as well).

> That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
> MAINTAINERS PWM entry.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07 10:43       ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-07 10:43 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Uwe Kleine-König, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Tue, Dec 07, 2021 at 10:05:08AM +0200, Baruch Siach wrote:
> On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> > Hello Andy,
> >
> > you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> > anything pwm specific here (apart from touching gpio-mvebu which also
> > contains a PWM driver). Do I miss something?

Thanks for your eagle eye! For the record I don't do this list manually,
I used the get_maintainer.pl's heuristics [1]. Usually it gives me more
than 95% correct prediction, so I believe here is no smoke without flame
(and it seems what Baruch discovered as well).

> That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
> MAINTAINERS PWM entry.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07 10:43       ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-07 10:43 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Uwe Kleine-König, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Tue, Dec 07, 2021 at 10:05:08AM +0200, Baruch Siach wrote:
> On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> > Hello Andy,
> >
> > you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> > anything pwm specific here (apart from touching gpio-mvebu which also
> > contains a PWM driver). Do I miss something?

Thanks for your eagle eye! For the record I don't do this list manually,
I used the get_maintainer.pl's heuristics [1]. Usually it gives me more
than 95% correct prediction, so I believe here is no smoke without flame
(and it seems what Baruch discovered as well).

> That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
> MAINTAINERS PWM entry.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-07 10:43       ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-07 10:43 UTC (permalink / raw)
  To: Baruch Siach
  Cc: Uwe Kleine-König, Marc Zyngier, Matti Vaittinen,
	Sergio Paracuellos, Chunyan Zhang, Bartosz Golaszewski,
	Tony Lindgren, Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, linux-gpio, linux-kernel,
	patches, bcm-kernel-feedback-list, linux-power, linux-arm-kernel,
	linux-mediatek, linux-pwm, linux-omap, linux-unisoc,
	linux-rockchip, linux-stm32, linux-tegra, Ray Jui,
	Florian Fainelli, Scott Branden, Gregory Fong, Eugeniy Paltsev,
	Keerthy, Orson Zhai, Baolin Wang, Chunyan Zhang,
	Vladimir Zapolskiy, Matthias Brugger, Thierry Reding, Lee Jones,
	Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
	Robert Jarzmik, Manivannan Sadhasivam, Heiko Stuebner,
	Ludovic Desroches, Maxime Coquelin, Alexandre Torgue,
	Jonathan Hunter

On Tue, Dec 07, 2021 at 10:05:08AM +0200, Baruch Siach wrote:
> On Tue, Dec 07 2021, Uwe Kleine-König wrote:
> > Hello Andy,
> >
> > you Cc: linux-pwm and the pwm maintainers in this series. I don't spot
> > anything pwm specific here (apart from touching gpio-mvebu which also
> > contains a PWM driver). Do I miss something?

Thanks for your eagle eye! For the record I don't do this list manually,
I used the get_maintainer.pl's heuristics [1]. Usually it gives me more
than 95% correct prediction, so I believe here is no smoke without flame
(and it seems what Baruch discovered as well).

> That's probably because of drivers/gpio/gpio-mvebu.c that appears in the
> MAINTAINERS PWM entry.

[1]: https://github.com/andy-shev/home-bin-tools/blob/master/ge2maintainer.sh

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-13 13:50   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-13 13:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

If there are no objections, I am willing to apply this to give it some
time in next and get the work on dropping the OF APIs from gpiolib
going.

Bart

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 13:50   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-13 13:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

If there are no objections, I am willing to apply this to give it some
time in next and get the work on dropping the OF APIs from gpiolib
going.

Bart

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 13:50   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-13 13:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

If there are no objections, I am willing to apply this to give it some
time in next and get the work on dropping the OF APIs from gpiolib
going.

Bart

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 13:50   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-13 13:50 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

If there are no objections, I am willing to apply this to give it some
time in next and get the work on dropping the OF APIs from gpiolib
going.

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-13 13:50   ` Bartosz Golaszewski
  (?)
  (?)
@ 2021-12-13 14:04     ` Andy Shevchenko
  -1 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-13 14:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 13, 2021 at 02:50:57PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.

> If there are no objections, I am willing to apply this to give it some
> time in next and get the work on dropping the OF APIs from gpiolib
> going.

There was a v2 sent out.

  Message-Id: <20211206131852.74746-1-andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 14:04     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-13 14:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 13, 2021 at 02:50:57PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.

> If there are no objections, I am willing to apply this to give it some
> time in next and get the work on dropping the OF APIs from gpiolib
> going.

There was a v2 sent out.

  Message-Id: <20211206131852.74746-1-andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 14:04     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-13 14:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 13, 2021 at 02:50:57PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.

> If there are no objections, I am willing to apply this to give it some
> time in next and get the work on dropping the OF APIs from gpiolib
> going.

There was a v2 sent out.

  Message-Id: <20211206131852.74746-1-andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-13 14:04     ` Andy Shevchenko
  0 siblings, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-13 14:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Mon, Dec 13, 2021 at 02:50:57PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove these assignment all at once.
> >
> > For the details one may look into the of_gpio_dev_init() implementation.

> If there are no objections, I am willing to apply this to give it some
> time in next and get the work on dropping the OF APIs from gpiolib
> going.

There was a v2 sent out.

  Message-Id: <20211206131852.74746-1-andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-02 21:08 ` Andy Shevchenko
  (?)
  (?)
@ 2021-12-17 16:54   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-17 16:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Queued the series for next, thanks!

Bart

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-17 16:54   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-17 16:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Queued the series for next, thanks!

Bart

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-17 16:54   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-17 16:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Queued the series for next, thanks!

Bart

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-17 16:54   ` Bartosz Golaszewski
  0 siblings, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-17 16:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Marc Zyngier, Matti Vaittinen, Sergio Paracuellos, Chunyan Zhang,
	Baruch Siach, Uwe Kleine-König, Tony Lindgren,
	Nicolas Saenz Julienne, Linus Walleij, Jianqun Xu,
	Alexandru Ardelean, Thierry Reding, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List, patches, bcm-kernel-feedback-list,
	linux-power, Linux ARM, moderated list:ARM/Mediatek SoC...,
	open list:PWM SUBSYSTEM, Linux-OMAP, linux-unisoc,
	open list:ARM/Rockchip SoC...,
	linux-stm32, linux-tegra, Ray Jui, Florian Fainelli,
	Scott Branden, Gregory Fong, Eugeniy Paltsev, Keerthy,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Vladimir Zapolskiy,
	Matthias Brugger, Thierry Reding, Lee Jones, Grygorii Strashko,
	Santosh Shilimkar, Kevin Hilman, Robert Jarzmik,
	Manivannan Sadhasivam, Heiko Stuebner, Ludovic Desroches,
	Maxime Coquelin, Alexandre Torgue, Jonathan Hunter

On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove these assignment all at once.
>
> For the details one may look into the of_gpio_dev_init() implementation.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Queued the series for next, thanks!

Bart

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-17 16:54   ` Bartosz Golaszewski
                     ` (2 preceding siblings ...)
  (?)
@ 2021-12-17 18:17   ` Andy Shevchenko
  2021-12-17 18:21     ` Bartosz Golaszewski
  2021-12-17 18:22     ` Andy Shevchenko
  -1 siblings, 2 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-17 18:17 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Matti Vaittinen, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List

On Fri, Dec 17, 2021 at 05:54:00PM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:

...

> Queued the series for next, thanks!

Thanks!

I hope that v2 is actually queued. There is a tag from Matti and addressed
comment from Linus.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-17 18:17   ` Andy Shevchenko
@ 2021-12-17 18:21     ` Bartosz Golaszewski
  2021-12-17 18:22     ` Andy Shevchenko
  1 sibling, 0 replies; 58+ messages in thread
From: Bartosz Golaszewski @ 2021-12-17 18:21 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Matti Vaittinen, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List

On Fri, Dec 17, 2021 at 7:18 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Fri, Dec 17, 2021 at 05:54:00PM +0100, Bartosz Golaszewski wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
>
> ...
>
> > Queued the series for next, thanks!
>
> Thanks!
>
> I hope that v2 is actually queued. There is a tag from Matti and addressed
> comment from Linus.
>

Yes, I queued v2 of course.

Bart

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
  2021-12-17 18:17   ` Andy Shevchenko
  2021-12-17 18:21     ` Bartosz Golaszewski
@ 2021-12-17 18:22     ` Andy Shevchenko
  1 sibling, 0 replies; 58+ messages in thread
From: Andy Shevchenko @ 2021-12-17 18:22 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Matti Vaittinen, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List

On Fri, Dec 17, 2021 at 08:17:10PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 17, 2021 at 05:54:00PM +0100, Bartosz Golaszewski wrote:
> > On Thu, Dec 2, 2021 at 10:17 PM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> 
> ...
> 
> > Queued the series for next, thanks!
> 
> Thanks!
> 
> I hope that v2 is actually queued. There is a tag from Matti and addressed
> comment from Linus.

Yes, it seems the case, thanks!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 20:23 kernel test robot
  0 siblings, 0 replies; 58+ messages in thread
From: kernel test robot @ 2021-12-06 20:23 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 19664 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Marc Zyngier <maz@kernel.org>
TO: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>, Matti Vaittinen <mazziesaccount@gmail.com>
TO: Sergio Paracuellos <sergio.paracuellos@gmail.com>
TO: Chunyan Zhang <chunyan.zhang@unisoc.com>
TO: Bartosz Golaszewski <brgl@bgdev.pl>
TO: Baruch Siach <baruch@tkos.co.il>
TO: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
TO: Tony Lindgren <tony@atomide.com>
TO: Nicolas Saenz Julienne <nsaenz@kernel.org>

Hi Andy,

I love your patch! Perhaps something to improve:

[auto build test WARNING on thierry-reding-pwm/for-next]
[also build test WARNING on rockchip/for-next v5.16-rc4]
[cannot apply to linusw-gpio/for-next next-20211206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/gpio-Get-rid-of-duplicate-of_node-assignment-in-the-drivers/20211203-051909
base:   https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git for-next
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: i386-randconfig-c001-20211205 (https://download.01.org/0day-ci/archive/20211207/202112070451.iv2dNdso-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6e8678903523019903222e4521a5e41af743cab0)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/884ea5e4f18badef51842fc948d3b4f0fa538b06
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andy-Shevchenko/gpio-Get-rid-of-duplicate-of_node-assignment-in-the-drivers/20211203-051909
        git checkout 884ea5e4f18badef51842fc948d3b4f0fa538b06
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (2 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:343:6: warning: Branch condition evaluates to a garbage value [clang-analyzer-core.uninitialized.Branch]
           if (!r)
               ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:414:6: note: Assuming 'r' is 0
           if (r)
               ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:414:2: note: Taking false branch
           if (r)
           ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:417:6: note: Calling 'vcn_v3_0_hw_init'
           r = vcn_v3_0_hw_init(adev);
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:283:12: note: 'r' declared without an initial value
           int i, j, r;
                     ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:285:6: note: Assuming the condition is false
           if (amdgpu_sriov_vf(adev)) {
               ^
   drivers/gpu/drm/amd/amdgpu/../amdgpu/amdgpu_virt.h:251:2: note: expanded from macro 'amdgpu_sriov_vf'
   ((adev)->virt.caps & AMDGPU_SRIOV_CAPS_IS_VF)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:285:2: note: Taking false branch
           if (amdgpu_sriov_vf(adev)) {
           ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:320:15: note: Assuming 'i' is >= field 'num_vcn_inst'
                   for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:320:3: note: Loop condition is false. Execution continues on line 343
                   for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                   ^
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:343:6: note: Branch condition evaluates to a garbage value
           if (!r)
               ^~
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:1513:4: warning: Value stored to 'r' is never read [clang-analyzer-deadcode.DeadStores]
                           r = vcn_v3_0_stop_dpg_mode(adev, i);
                           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c:1513:4: note: Value stored to 'r' is never read
                           r = vcn_v3_0_stop_dpg_mode(adev, i);
                           ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   4 warnings generated.
>> drivers/gpio/gpio-gw-pld.c:74:22: warning: Value stored to 'np' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device_node *np = dev->of_node;
                               ^~   ~~~~~~~~~~~~
   drivers/gpio/gpio-gw-pld.c:74:22: note: Value stored to 'np' during its initialization is never read
           struct device_node *np = dev->of_node;
                               ^~   ~~~~~~~~~~~~
   Suppressed 3 warnings (2 in non-user code, 1 with check filters).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   6 warnings generated.
   drivers/cpufreq/longhaul.c:194:4: warning: Value stored to 't' is never read [clang-analyzer-deadcode.DeadStores]
                           t = inl(acpi_gbl_FADT.xpm_timer_block.address);
                           ^
   drivers/cpufreq/longhaul.c:194:4: note: Value stored to 't' is never read
   drivers/cpufreq/longhaul.c:211:3: warning: Value stored to 't' is never read [clang-analyzer-deadcode.DeadStores]
                   t = inl(acpi_gbl_FADT.xpm_timer_block.address);
                   ^
   drivers/cpufreq/longhaul.c:211:3: note: Value stored to 't' is never read

vim +/np +74 drivers/gpio/gpio-gw-pld.c

2a0b0a57fa86b9 Linus Walleij 2019-02-01   69  
2a0b0a57fa86b9 Linus Walleij 2019-02-01   70  static int gw_pld_probe(struct i2c_client *client,
2a0b0a57fa86b9 Linus Walleij 2019-02-01   71  			const struct i2c_device_id *id)
2a0b0a57fa86b9 Linus Walleij 2019-02-01   72  {
2a0b0a57fa86b9 Linus Walleij 2019-02-01   73  	struct device *dev = &client->dev;
2a0b0a57fa86b9 Linus Walleij 2019-02-01  @74  	struct device_node *np = dev->of_node;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   75  	struct gw_pld *gw;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   76  	int ret;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   77  
2a0b0a57fa86b9 Linus Walleij 2019-02-01   78  	gw = devm_kzalloc(dev, sizeof(*gw), GFP_KERNEL);
2a0b0a57fa86b9 Linus Walleij 2019-02-01   79  	if (!gw)
2a0b0a57fa86b9 Linus Walleij 2019-02-01   80  		return -ENOMEM;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   81  
2a0b0a57fa86b9 Linus Walleij 2019-02-01   82  	gw->chip.base = -1;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   83  	gw->chip.can_sleep = true;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   84  	gw->chip.parent = dev;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   85  	gw->chip.owner = THIS_MODULE;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   86  	gw->chip.label = dev_name(dev);
2a0b0a57fa86b9 Linus Walleij 2019-02-01   87  	gw->chip.ngpio = 8;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   88  	gw->chip.direction_input = gw_pld_input8;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   89  	gw->chip.get = gw_pld_get8;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   90  	gw->chip.direction_output = gw_pld_output8;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   91  	gw->chip.set = gw_pld_set8;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   92  	gw->client = client;
2a0b0a57fa86b9 Linus Walleij 2019-02-01   93  
2a0b0a57fa86b9 Linus Walleij 2019-02-01   94  	/*
2a0b0a57fa86b9 Linus Walleij 2019-02-01   95  	 * The Gateworks I2C PLD chip does not properly send the acknowledge
2a0b0a57fa86b9 Linus Walleij 2019-02-01   96  	 * bit at all times, but we can still use the standard i2c_smbus
2a0b0a57fa86b9 Linus Walleij 2019-02-01   97  	 * functions by simply ignoring this bit.
2a0b0a57fa86b9 Linus Walleij 2019-02-01   98  	 */
2a0b0a57fa86b9 Linus Walleij 2019-02-01   99  	client->flags |= I2C_M_IGNORE_NAK;
2a0b0a57fa86b9 Linus Walleij 2019-02-01  100  	gw->out = 0xFF;
2a0b0a57fa86b9 Linus Walleij 2019-02-01  101  
2a0b0a57fa86b9 Linus Walleij 2019-02-01  102  	i2c_set_clientdata(client, gw);
2a0b0a57fa86b9 Linus Walleij 2019-02-01  103  
2a0b0a57fa86b9 Linus Walleij 2019-02-01  104  	ret = devm_gpiochip_add_data(dev, &gw->chip, gw);
2a0b0a57fa86b9 Linus Walleij 2019-02-01  105  	if (ret)
2a0b0a57fa86b9 Linus Walleij 2019-02-01  106  		return ret;
2a0b0a57fa86b9 Linus Walleij 2019-02-01  107  
2a0b0a57fa86b9 Linus Walleij 2019-02-01  108  	dev_info(dev, "registered Gateworks PLD GPIO device\n");
2a0b0a57fa86b9 Linus Walleij 2019-02-01  109  
2a0b0a57fa86b9 Linus Walleij 2019-02-01  110  	return 0;
2a0b0a57fa86b9 Linus Walleij 2019-02-01  111  }
2a0b0a57fa86b9 Linus Walleij 2019-02-01  112  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* Re: [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers
@ 2021-12-06 19:52 kernel test robot
  0 siblings, 0 replies; 58+ messages in thread
From: kernel test robot @ 2021-12-06 19:52 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 21387 bytes --]

CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
References: <20211202210839.79140-1-andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Marc Zyngier <maz@kernel.org>
TO: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>, Matti Vaittinen <mazziesaccount@gmail.com>
TO: Sergio Paracuellos <sergio.paracuellos@gmail.com>
TO: Chunyan Zhang <chunyan.zhang@unisoc.com>
TO: Bartosz Golaszewski <brgl@bgdev.pl>
TO: Baruch Siach <baruch@tkos.co.il>
TO: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
TO: Tony Lindgren <tony@atomide.com>
TO: Nicolas Saenz Julienne <nsaenz@kernel.org>

Hi Andy,

I love your patch! Perhaps something to improve:

[auto build test WARNING on thierry-reding-pwm/for-next]
[also build test WARNING on rockchip/for-next v5.16-rc4]
[cannot apply to linusw-gpio/for-next next-20211206]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/gpio-Get-rid-of-duplicate-of_node-assignment-in-the-drivers/20211203-051909
base:   https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git for-next
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: arm-randconfig-c002-20211205 (https://download.01.org/0day-ci/archive/20211207/202112070345.NhvgDXl2-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6e8678903523019903222e4521a5e41af743cab0)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/884ea5e4f18badef51842fc948d3b4f0fa538b06
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andy-Shevchenko/gpio-Get-rid-of-duplicate-of_node-assignment-in-the-drivers/20211203-051909
        git checkout 884ea5e4f18badef51842fc948d3b4f0fa538b06
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


clang-analyzer warnings: (new ones prefixed by >>)
                   if (!(condition))                                       \
                   ^
   drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2729:7: note: Loop condition is false.  Exiting loop
                       FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
                       ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:52:3: note: expanded from macro '__BF_FIELD_CHECK'
                   BUILD_BUG_ON_MSG((_mask) > (typeof(_reg))~0ull,         \
                   ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2729:7: note: Assuming the condition is false
                       FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
                       ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/bitfield.h:54:3: note: expanded from macro '__BF_FIELD_CHECK'
                   __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +                 \
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/build_bug.h:21:15: note: expanded from macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
           BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:335:22: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:323:23: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/compiler_types.h:315:9: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                         ^~~~~~~~~
   drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2729:7: note: Taking false branch
                       FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
                       ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:54:3: note: expanded from macro '__BF_FIELD_CHECK'
                   __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +                 \
                   ^
   include/linux/build_bug.h:21:2: note: expanded from macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
           BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:315:3: note: expanded from macro '__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2729:7: note: Loop condition is false.  Exiting loop
                       FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
                       ^
   include/linux/bitfield.h:108:3: note: expanded from macro 'FIELD_GET'
                   __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: ");       \
                   ^
   include/linux/bitfield.h:54:3: note: expanded from macro '__BF_FIELD_CHECK'
                   __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) +                 \
                   ^
   include/linux/build_bug.h:21:2: note: expanded from macro '__BUILD_BUG_ON_NOT_POWER_OF_2'
           BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
           ^
   note: (skipping 2 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:335:2: note: expanded from macro 'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
           ^
   include/linux/compiler_types.h:323:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:307:2: note: expanded from macro '__compiletime_assert'
           do {                                                            \
           ^
   drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c:2729:7: note: The left operand of '&' is a garbage value
                       FIELD_GET(MCP251XFD_REG_DEVID_ID_MASK, dev_id),
                       ^
   include/linux/bitfield.h:109:27: note: expanded from macro 'FIELD_GET'
                   (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \
                                     ~~~~  ^
   Suppressed 1 warnings (1 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   2 warnings generated.
>> drivers/gpio/gpio-rda.c:200:22: warning: Value stored to 'np' during its initialization is never read [clang-analyzer-deadcode.DeadStores]
           struct device_node *np = pdev->dev.of_node;
                               ^~   ~~~~~~~~~~~~~~~~~
   drivers/gpio/gpio-rda.c:200:22: note: Value stored to 'np' during its initialization is never read
           struct device_node *np = pdev->dev.of_node;
                               ^~   ~~~~~~~~~~~~~~~~~
   Suppressed 1 warnings (1 with check filters).
   2 warnings generated.
   drivers/misc/enclosure.c:186:2: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(name, "enclosure_device:");
           ^~~~~~
   drivers/misc/enclosure.c:186:2: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119
           strcpy(name, "enclosure_device:");
           ^~~~~~
   drivers/misc/enclosure.c:187:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcat(name, dev_name(&cdev->cdev));
           ^~~~~~
   drivers/misc/enclosure.c:187:2: note: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
           strcat(name, dev_name(&cdev->cdev));
           ^~~~~~
   1 warning generated.
   drivers/misc/gehc-achc.c:152:2: warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
           return ret;
           ^      ~~~
   drivers/misc/gehc-achc.c:142:2: note: 'ret' declared without an initial value
           int ret;
           ^~~~~~~
   drivers/misc/gehc-achc.c:145:14: note: Assuming 'i' is >= 'retries'
           for (i = 0; i < retries; i++) {
                       ^~~~~~~~~~~
   drivers/misc/gehc-achc.c:145:2: note: Loop condition is false. Execution continues on line 152
           for (i = 0; i < retries; i++) {
           ^
   drivers/misc/gehc-achc.c:152:2: note: Undefined or garbage value returned to caller
           return ret;
           ^      ~~~
   1 warning generated.
   drivers/misc/eeprom/at25.c:467:44: warning: The left operand of '&' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           at25->nvmem_config.read_only = chip.flags & EE_READONLY;
                                          ~~~~~~~~~~ ^
   drivers/misc/eeprom/at25.c:389:6: note: Assuming 'match' is non-null
           if (match && !strcmp(match->compatible, "cypress,fm25"))
               ^~~~~
   drivers/misc/eeprom/at25.c:389:6: note: Left side of '&&' is true
   drivers/misc/eeprom/at25.c:389:2: note: Taking true branch
           if (match && !strcmp(match->compatible, "cypress,fm25"))
           ^
   drivers/misc/eeprom/at25.c:393:6: note: Assuming field 'platform_data' is null
           if (!spi->dev.platform_data) {
               ^~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at25.c:393:2: note: Taking true branch
           if (!spi->dev.platform_data) {
           ^
   drivers/misc/eeprom/at25.c:394:8: note: 'is_fram' is true
                   if (!is_fram) {
                        ^~~~~~~
   drivers/misc/eeprom/at25.c:394:3: note: Taking false branch
                   if (!is_fram) {
                   ^
   drivers/misc/eeprom/at25.c:407:6: note: 'sr' is >= 0
           if (sr < 0 || sr & AT25_SR_nRDY) {
               ^~
   drivers/misc/eeprom/at25.c:407:6: note: Left side of '||' is false
   drivers/misc/eeprom/at25.c:407:16: note: Assuming the condition is false
           if (sr < 0 || sr & AT25_SR_nRDY) {
                         ^~~~~~~~~~~~~~~~~
   drivers/misc/eeprom/at25.c:407:2: note: Taking false branch
           if (sr < 0 || sr & AT25_SR_nRDY) {
           ^
   drivers/misc/eeprom/at25.c:413:6: note: Assuming 'at25' is non-null
           if (!at25)
               ^~~~~
   drivers/misc/eeprom/at25.c:413:2: note: Taking false branch
           if (!at25)
           ^
   drivers/misc/eeprom/at25.c:416:2: note: Loop condition is false.  Exiting loop
           mutex_init(&at25->lock);
           ^
   include/linux/mutex.h:101:32: note: expanded from macro 'mutex_init'
   #define mutex_init(mutex)                                               \
                                                                           ^
   drivers/misc/eeprom/at25.c:421:6: note: 'is_fram' is true
           if (is_fram) {
               ^~~~~~~
   drivers/misc/eeprom/at25.c:421:2: note: Taking true branch
           if (is_fram) {
           ^
   drivers/misc/eeprom/at25.c:424:7: note: Assuming the condition is false
                   if (id[6] != 0xc2) {
                       ^~~~~~~~~~~~~
   drivers/misc/eeprom/at25.c:424:3: note: Taking false branch
                   if (id[6] != 0xc2) {
                   ^
   drivers/misc/eeprom/at25.c:430:7: note: Assuming the condition is false
                   if (id[7] < 0x21 || id[7] > 0x26) {
                       ^~~~~~~~~~~~
   drivers/misc/eeprom/at25.c:430:7: note: Left side of '||' is false
   drivers/misc/eeprom/at25.c:430:23: note: Assuming the condition is false
                   if (id[7] < 0x21 || id[7] > 0x26) {
                                       ^~~~~~~~~~~~
   drivers/misc/eeprom/at25.c:430:3: note: Taking false branch

vim +/np +200 drivers/gpio/gpio-rda.c

d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  197  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  198  static int rda_gpio_probe(struct platform_device *pdev)
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  199  {
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21 @200  	struct device_node *np = pdev->dev.of_node;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  201  	struct device *dev = &pdev->dev;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  202  	struct gpio_irq_chip *girq;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  203  	struct rda_gpio *rda_gpio;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  204  	u32 ngpios;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  205  	int ret;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  206  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  207  	rda_gpio = devm_kzalloc(dev, sizeof(*rda_gpio), GFP_KERNEL);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  208  	if (!rda_gpio)
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  209  		return -ENOMEM;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  210  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  211  	ret = device_property_read_u32(dev, "ngpios", &ngpios);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  212  	if (ret < 0)
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  213  		return ret;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  214  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  215  	/*
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  216  	 * Not all ports have interrupt capability. For instance, on
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  217  	 * RDA8810PL, GPIOC doesn't support interrupt. So we must handle
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  218  	 * those also.
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  219  	 */
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  220  	rda_gpio->irq = platform_get_irq(pdev, 0);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  221  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  222  	rda_gpio->base = devm_platform_ioremap_resource(pdev, 0);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  223  	if (IS_ERR(rda_gpio->base))
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  224  		return PTR_ERR(rda_gpio->base);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  225  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  226  	spin_lock_init(&rda_gpio->lock);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  227  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  228  	ret = bgpio_init(&rda_gpio->chip, dev, 4,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  229  			 rda_gpio->base + RDA_GPIO_VAL,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  230  			 rda_gpio->base + RDA_GPIO_SET,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  231  			 rda_gpio->base + RDA_GPIO_CLR,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  232  			 rda_gpio->base + RDA_GPIO_OEN_SET_OUT,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  233  			 rda_gpio->base + RDA_GPIO_OEN_SET_IN,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  234  			 BGPIOF_READ_OUTPUT_REG_SET);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  235  	if (ret) {
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  236  		dev_err(dev, "bgpio_init failed\n");
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  237  		return ret;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  238  	}
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  239  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  240  	rda_gpio->chip.label = dev_name(dev);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  241  	rda_gpio->chip.ngpio = ngpios;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  242  	rda_gpio->chip.base = -1;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  243  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  244  	if (rda_gpio->irq >= 0) {
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  245  		rda_gpio->irq_chip.name = "rda-gpio",
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  246  		rda_gpio->irq_chip.irq_ack = rda_gpio_irq_ack,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  247  		rda_gpio->irq_chip.irq_mask = rda_gpio_irq_mask,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  248  		rda_gpio->irq_chip.irq_unmask = rda_gpio_irq_unmask,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  249  		rda_gpio->irq_chip.irq_set_type = rda_gpio_irq_set_type,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  250  		rda_gpio->irq_chip.flags = IRQCHIP_SKIP_SET_WAKE,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  251  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  252  		girq = &rda_gpio->chip.irq;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  253  		girq->chip = &rda_gpio->irq_chip;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  254  		girq->handler = handle_bad_irq;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  255  		girq->default_type = IRQ_TYPE_NONE;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  256  		girq->parent_handler = rda_gpio_irq_handler;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  257  		girq->parent_handler_data = rda_gpio;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  258  		girq->num_parents = 1;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  259  		girq->parents = devm_kcalloc(dev, 1,
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  260  					     sizeof(*girq->parents),
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  261  					     GFP_KERNEL);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  262  		if (!girq->parents)
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  263  			return -ENOMEM;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  264  		girq->parents[0] = rda_gpio->irq;
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  265  	}
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  266  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  267  	platform_set_drvdata(pdev, rda_gpio);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  268  
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  269  	return devm_gpiochip_add_data(dev, &rda_gpio->chip, rda_gpio);
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  270  }
d57eb825e0dc6f Manivannan Sadhasivam 2019-10-21  271  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

end of thread, other threads:[~2021-12-17 18:23 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 21:08 [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Andy Shevchenko
2021-12-02 21:08 ` Andy Shevchenko
2021-12-02 21:08 ` Andy Shevchenko
2021-12-02 21:08 ` [PATCH v1 2/3] gpio: Setup parent device and get rid of unnecessary of_node assignment Andy Shevchenko
2021-12-02 21:08   ` Andy Shevchenko
2021-12-02 21:08   ` Andy Shevchenko
2021-12-02 21:08 ` [PATCH v1 3/3] gpio: Propagate firmware node from a parent device Andy Shevchenko
2021-12-02 21:08   ` Andy Shevchenko
2021-12-02 21:08   ` Andy Shevchenko
2021-12-03  8:40 ` [PATCH v1 1/3] gpio: Get rid of duplicate of_node assignment in the drivers Bartosz Golaszewski
2021-12-03  8:40   ` Bartosz Golaszewski
2021-12-03  8:40   ` Bartosz Golaszewski
2021-12-03  8:40   ` Bartosz Golaszewski
2021-12-03 12:25   ` Andy Shevchenko
2021-12-03 12:25     ` Andy Shevchenko
2021-12-03 12:25     ` Andy Shevchenko
2021-12-03 12:25     ` Andy Shevchenko
2021-12-05  0:06 ` Linus Walleij
2021-12-05  0:06   ` Linus Walleij
2021-12-05  0:06   ` Linus Walleij
2021-12-05  0:06   ` Linus Walleij
2021-12-06 13:11   ` Andy Shevchenko
2021-12-06 13:11     ` Andy Shevchenko
2021-12-06 13:11     ` Andy Shevchenko
2021-12-06 13:11     ` Andy Shevchenko
2021-12-06 13:19     ` Bartosz Golaszewski
2021-12-06 13:19       ` Bartosz Golaszewski
2021-12-06 13:19       ` Bartosz Golaszewski
2021-12-06 13:19       ` Bartosz Golaszewski
2021-12-07  8:03 ` Uwe Kleine-König
2021-12-07  8:03   ` Uwe Kleine-König
2021-12-07  8:03   ` Uwe Kleine-König
2021-12-07  8:03   ` Uwe Kleine-König
2021-12-07  8:05   ` Baruch Siach
2021-12-07  8:05     ` Baruch Siach
2021-12-07  8:05     ` Baruch Siach
2021-12-07  8:05     ` Baruch Siach
2021-12-07 10:43     ` Andy Shevchenko
2021-12-07 10:43       ` Andy Shevchenko
2021-12-07 10:43       ` Andy Shevchenko
2021-12-07 10:43       ` Andy Shevchenko
2021-12-13 13:50 ` Bartosz Golaszewski
2021-12-13 13:50   ` Bartosz Golaszewski
2021-12-13 13:50   ` Bartosz Golaszewski
2021-12-13 13:50   ` Bartosz Golaszewski
2021-12-13 14:04   ` Andy Shevchenko
2021-12-13 14:04     ` Andy Shevchenko
2021-12-13 14:04     ` Andy Shevchenko
2021-12-13 14:04     ` Andy Shevchenko
2021-12-17 16:54 ` Bartosz Golaszewski
2021-12-17 16:54   ` Bartosz Golaszewski
2021-12-17 16:54   ` Bartosz Golaszewski
2021-12-17 16:54   ` Bartosz Golaszewski
2021-12-17 18:17   ` Andy Shevchenko
2021-12-17 18:21     ` Bartosz Golaszewski
2021-12-17 18:22     ` Andy Shevchenko
2021-12-06 19:52 kernel test robot
2021-12-06 20:23 kernel test robot

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.