drivers/gpio : Remove redundant platform_set_drvdata().
Subsystems (27)
PATCH v2 1/1 drivers/gpio : Remove redundant platform_set_drvdata().
platform_set_drvdata() is redundant in these functions. the purpose of calling this function is to place data in *driver_data. but the data is not retrieved in these functions
--- drivers/gpio/gpio-74xx-mmio.c | 2 -- drivers/gpio/gpio-aggregator.c | 1 - drivers/gpio/gpio-amd-fch.c | 2 -- drivers/gpio/gpio-bcm-kona.c | 1 - drivers/gpio/gpio-clps711x.c | 1 - drivers/gpio/gpio-davinci.c | 1 - drivers/gpio/gpio-dwapb.c | 2 -- drivers/gpio/gpio-eic-sprd.c | 1 - drivers/gpio/gpio-em.c | 1 - drivers/gpio/gpio-exar.c | 2 -- drivers/gpio/gpio-f7188x.c | 2 -- drivers/gpio/gpio-htc-egpio.c | 3 --- drivers/gpio/gpio-imx-scu.c | 2 -- drivers/gpio/gpio-ixp4xx.c | 1 - drivers/gpio/gpio-janz-ttl.c | 1 - drivers/gpio/gpio-kempld.c | 2 -- drivers/gpio/gpio-latch.c | 2 -- drivers/gpio/gpio-logicvc.c | 2 -- drivers/gpio/gpio-loongson1.c | 1 - drivers/gpio/gpio-lp3943.c | 2 -- drivers/gpio/gpio-lp873x.c | 2 -- drivers/gpio/gpio-max77620.c | 2 -- drivers/gpio/gpio-mlxbf.c | 1 - drivers/gpio/gpio-mlxbf2.c | 2 -- drivers/gpio/gpio-mmio.c | 2 -- drivers/gpio/gpio-msc313.c | 2 -- drivers/gpio/gpio-mt7621.c | 1 - drivers/gpio/gpio-mvebu.c | 2 -- drivers/gpio/gpio-mxc.c | 2 -- drivers/gpio/gpio-omap.c | 4 ---- drivers/gpio/gpio-palmas.c | 1 - drivers/gpio/gpio-pmic-eic-sprd.c | 1 - drivers/gpio/gpio-rc5t583.c | 2 -- drivers/gpio/gpio-rcar.c | 2 -- drivers/gpio/gpio-rda.c | 2 -- drivers/gpio/gpio-rdc321x.c | 2 -- drivers/gpio/gpio-sama5d2-piobu.c | 1 - drivers/gpio/gpio-sch.c | 2 -- drivers/gpio/gpio-sch311x.c | 2 -- drivers/gpio/gpio-sifive.c | 1 - drivers/gpio/gpio-syscon.c | 2 -- drivers/gpio/gpio-tegra.c | 2 -- drivers/gpio/gpio-timberdale.c | 2 -- drivers/gpio/gpio-tqmx86.c | 2 -- drivers/gpio/gpio-ts4800.c | 2 -- drivers/gpio/gpio-vx855.c | 2 -- drivers/gpio/gpio-wcove.c | 2 -- drivers/gpio/gpio-xgene.c | 2 -- drivers/gpio/gpio-zevio.c | 2 -- drivers/gpio/gpio-zynqmp-modepin.c | 2 -- 50 files changed, 88 deletions(-)
drivers/gpio/gpio-74xx-mmio.c +0 -2
@@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) priv->gc.ngpio =MMIO_74XX_BIT_CNT (priv->flags); priv->gc.owner =THIS_MODULE ; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }
drivers/gpio/gpio-aggregator.c +0 -1
@@ -495,7 +495,6 @@ static int gpio_aggregator_probe(struct platform_device *pdev)if (IS_ERR (fwd))return PTR_ERR (fwd); -platform_set_drvdata (pdev, fwd);return 0 ; }
drivers/gpio/gpio-amd-fch.c +0 -2
@@ -172,8 +172,6 @@ static int amd_fch_gpio_probe(struct platform_device *pdev)if (IS_ERR (priv->base))return PTR_ERR (priv->base); -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }
drivers/gpio/gpio-bcm-kona.c +0 -1
@@ -597,7 +597,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENOMEM ; kona_gpio->pdev = pdev; -platform_set_drvdata (pdev, kona_gpio); chip->parent = dev; chip->ngpio = kona_gpio->num_bank *GPIO_PER_BANK ;
drivers/gpio/gpio-clps711x.c +0 -1
@@ -62,7 +62,6 @@ static int clps711x_gpio_probe(struct platform_device *pdev) gc->base =-1 ; gc->owner =THIS_MODULE ; -platform_set_drvdata (pdev, gc);return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }
drivers/gpio/gpio-davinci.c +0 -1
@@ -266,7 +266,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, chips); ret =davinci_gpio_irq_setup (pdev);if (ret)return ret;
drivers/gpio/gpio-dwapb.c +0 -2
@@ -734,8 +734,6 @@ static int dwapb_gpio_probe(struct platform_device *pdev)return err; } -platform_set_drvdata (pdev, gpio); -return 0 ; }
drivers/gpio/gpio-eic-sprd.c +0 -1
@@ -653,7 +653,6 @@ static int sprd_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, sprd_eic);return 0 ; }
drivers/gpio/gpio-em.c +0 -1
@@ -281,7 +281,6 @@ static int em_gio_probe(struct platform_device *pdev)return -ENOMEM ; p->pdev = pdev; -platform_set_drvdata (pdev, p);spin_lock_init (&p->sense_lock); irq[0 ] =platform_get_irq (pdev,0 );
drivers/gpio/gpio-exar.c +0 -2
@@ -217,8 +217,6 @@ static int gpio_exar_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, exar_gpio); -return 0 ; }
drivers/gpio/gpio-f7188x.c +0 -2
@@ -499,8 +499,6 @@ static int f7188x_gpio_probe(struct platform_device *pdev) } data->sio = sio; -platform_set_drvdata (pdev, data); -/* For each GPIO bank, register a GPIO chip. */ for (i =0 ; i < data->nr_bank; i++) {struct f7188x_gpio_bank *bank = &data->bank[i];
drivers/gpio/gpio-htc-egpio.c +0 -3
@@ -299,9 +299,6 @@ static int __init egpio_probe(struct platform_device *pdev)pr_debug ("reg_shift = %d\n" , ei->reg_shift); ei->reg_mask = (1 << pdata->reg_width) -1 ; - -platform_set_drvdata (pdev, ei); - ei->nchips = pdata->num_chips; ei->chip = devm_kcalloc(&pdev->dev, ei->nchips, sizeof(struct egpio_chip),
drivers/gpio/gpio-imx-scu.c +0 -2
@@ -109,8 +109,6 @@ static int imx_scu_gpio_probe(struct platform_device *pdev) gc->set = imx_scu_gpio_set; gc->get_direction = imx_scu_gpio_get_direction; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (dev, gc, priv); }
drivers/gpio/gpio-ixp4xx.c +0 -1
@@ -287,7 +287,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, g);dev_info (dev,"IXP4 GPIO registered\n" );return 0 ;
drivers/gpio/gpio-janz-ttl.c +0 -1
@@ -154,7 +154,6 @@ static int ttl_probe(struct platform_device *pdev)if (!mod)return -ENOMEM ; -platform_set_drvdata (pdev, mod);spin_lock_init (&mod->lock);/* get access to the MODULbus registers for this module */
drivers/gpio/gpio-kempld.c +0 -2
@@ -151,8 +151,6 @@ static int kempld_gpio_probe(struct platform_device *pdev) gpio->pld = pld; -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-kempld" ; chip->owner =THIS_MODULE ;
drivers/gpio/gpio-latch.c +0 -2
@@ -192,8 +192,6 @@ static int gpio_latch_probe(struct platform_device *pdev) priv->gc.base =-1 ; priv->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }
drivers/gpio/gpio-logicvc.c +0 -2
@@ -139,8 +139,6 @@ static int logicvc_gpio_probe(struct platform_device *pdev) logicvc->chip.set = logicvc_gpio_set; logicvc->chip.direction_output = logicvc_gpio_direction_output; -platform_set_drvdata (pdev, logicvc); -return devm_gpiochip_add_data (dev, &logicvc->chip, logicvc); }
drivers/gpio/gpio-loongson1.c +0 -1
@@ -72,7 +72,6 @@ static int ls1x_gpio_probe(struct platform_device *pdev)if (ret) goto err; -platform_set_drvdata (pdev, gc);dev_info (dev,"Loongson1 GPIO driver registered\n" );return 0 ;
drivers/gpio/gpio-lp3943.c +0 -2
@@ -199,8 +199,6 @@ static int lp3943_gpio_probe(struct platform_device *pdev) lp3943_gpio->chip = lp3943_gpio_chip; lp3943_gpio->chip.parent = &pdev->dev; -platform_set_drvdata (pdev, lp3943_gpio); -return devm_gpiochip_add_data (&pdev->dev, &lp3943_gpio->chip, lp3943_gpio); }
drivers/gpio/gpio-lp873x.c +0 -2
@@ -140,8 +140,6 @@ static int lp873x_gpio_probe(struct platform_device *pdev)if (!gpio)return -ENOMEM ; -platform_set_drvdata (pdev, gpio); - gpio->lp873 =dev_get_drvdata (pdev->dev.parent); gpio->chip = template_chip; gpio->chip.parent = gpio->lp873->dev;
drivers/gpio/gpio-max77620.c +0 -2
@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) girq->init_hw = max77620_gpio_irq_init_hw; girq->threaded = true; -platform_set_drvdata (pdev, mgpio); - ret =devm_gpiochip_add_data (&pdev->dev, &mgpio->gpio_chip, mgpio);if (ret <0 ) {dev_err (&pdev->dev,"gpio_init: Failed to add max77620_gpio\n" );
drivers/gpio/gpio-mlxbf.c +0 -1
@@ -82,7 +82,6 @@ static int mlxbf_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, gs);dev_info (&pdev->dev,"registered Mellanox BlueField GPIO" );return 0 ; }
drivers/gpio/gpio-mlxbf2.c +0 -2
@@ -402,8 +402,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, gs); - ret =devm_gpiochip_add_data (dev, &gs->gc, gs);if (ret) {dev_err (dev,"Failed adding memory mapped gpiochip\n" );
drivers/gpio/gpio-mmio.c +0 -2
@@ -787,8 +787,6 @@ static int bgpio_pdev_probe(struct platform_device *pdev) gc->ngpio = pdata->ngpio; } -platform_set_drvdata (pdev, gc); -return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }
drivers/gpio/gpio-msc313.c +0 -2
@@ -625,8 +625,6 @@ static int msc313_gpio_probe(struct platform_device *pdev)if (IS_ERR (gpio->base))return PTR_ERR (gpio->base); -platform_set_drvdata (pdev, gpio); - gpiochip =devm_kzalloc (dev,sizeof (*gpiochip),GFP_KERNEL );if (!gpiochip)return -ENOMEM ;
drivers/gpio/gpio-mt7621.c +0 -1
@@ -315,7 +315,6 @@ mediatek_gpio_probe(struct platform_device *pdev)return mtk->gpio_irq; mtk->dev = dev; -platform_set_drvdata (pdev, mtk);for (i =0 ; i <MTK_BANK_CNT ; i++) { ret =mediatek_gpio_bank_probe (dev, i);
drivers/gpio/gpio-mvebu.c +0 -2
@@ -1143,8 +1143,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)if (!mvchip)return -ENOMEM ; -platform_set_drvdata (pdev, mvchip); -if (of_property_read_u32 (pdev->dev.of_node,"ngpios" , &ngpios)) {dev_err (&pdev->dev,"Missing ngpios OF property\n" );return -ENODEV ;
drivers/gpio/gpio-mxc.c +0 -2
@@ -489,8 +489,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)list_add_tail (&port->node, &mxc_gpio_ports); -platform_set_drvdata (pdev, port); -return 0 ; out_irqdomain_remove:
drivers/gpio/gpio-omap.c +0 -4
@@ -762,8 +762,6 @@ static struct platform_device omap_mpuio_device = {static inline void omap_mpuio_init (struct gpio_bank *bank) { -platform_set_drvdata (&omap_mpuio_device, bank); -if (platform_driver_register (&omap_mpuio_driver) ==0 ) (void )platform_device_register (&omap_mpuio_device); }
@@ -1457,8 +1455,6 @@ static int omap_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, bank); -pm_runtime_enable (dev);pm_runtime_get_sync (dev);
drivers/gpio/gpio-palmas.c +0 -1
@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, palmas_gpio);return ret; }
drivers/gpio/gpio-pmic-eic-sprd.c +0 -1
@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, pmic_eic);return 0 ; }
drivers/gpio/gpio-rc5t583.c +0 -2
@@ -121,8 +121,6 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)if (pdata && pdata->gpio_base) rc5t583_gpio->gpio_chip.base = pdata->gpio_base; -platform_set_drvdata (pdev, rc5t583_gpio); -return devm_gpiochip_add_data (&pdev->dev, &rc5t583_gpio->gpio_chip, rc5t583_gpio); }
drivers/gpio/gpio-rcar.c +0 -2
@@ -513,8 +513,6 @@ static int gpio_rcar_probe(struct platform_device *pdev)if (ret <0 )return ret; -platform_set_drvdata (pdev, p); -pm_runtime_enable (dev); ret =platform_get_irq (pdev,0 );
drivers/gpio/gpio-rda.c +0 -2
@@ -263,8 +263,6 @@ static int rda_gpio_probe(struct platform_device *pdev) girq->parents[0 ] = rda_gpio->irq; } -platform_set_drvdata (pdev, rda_gpio); -return devm_gpiochip_add_data (dev, &rda_gpio->chip, rda_gpio); }
drivers/gpio/gpio-rdc321x.c +0 -2
@@ -161,8 +161,6 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->chip.base =0 ; rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios; -platform_set_drvdata (pdev, rdc321x_gpio_dev); -/* This might not be, what others (BIOS, bootloader, etc.) wrote to these registers before, but it's a good guess. Still better than just using 0xffffffff. */
drivers/gpio/gpio-sama5d2-piobu.c +0 -1
@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)if (!piobu)return -ENOMEM ; -platform_set_drvdata (pdev, piobu); piobu->chip.label = pdev->name; piobu->chip.parent = &pdev->dev; piobu->chip.owner = THIS_MODULE,
drivers/gpio/gpio-sch.c +0 -2
@@ -380,8 +380,6 @@ static int sch_gpio_probe(struct platform_device *pdev)return -ENODEV ; } -platform_set_drvdata (pdev, sch); - girq = &sch->chip.irq;gpio_irq_chip_set_chip (girq, &sch_irqchip); girq->num_parents =0 ;
drivers/gpio/gpio-sch311x.c +0 -2
@@ -281,8 +281,6 @@ static int sch311x_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; -platform_set_drvdata (pdev, priv); -for (i =0 ; i <ARRAY_SIZE (priv->blocks); i++) { block = &priv->blocks[i];
drivers/gpio/gpio-sifive.c +0 -1
@@ -256,7 +256,6 @@ static int sifive_gpio_probe(struct platform_device *pdev) girq->handler = handle_bad_irq; girq->default_type =IRQ_TYPE_NONE ; -platform_set_drvdata (pdev, chip);return gpiochip_add_data (&chip->gc, chip); }
drivers/gpio/gpio-syscon.c +0 -2
@@ -249,8 +249,6 @@ static int syscon_gpio_probe(struct platform_device *pdev) priv->chip.direction_output = syscon_gpio_dir_out; } -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->chip, priv); }
drivers/gpio/gpio-tegra.c +0 -2
@@ -728,8 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count *32 ; tgi->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, tgi); -if (tgi->soc->debounce_supported) tgi->gc.set_config = tegra_gpio_set_config;
drivers/gpio/gpio-timberdale.c +0 -2
@@ -256,8 +256,6 @@ static int timbgpio_probe(struct platform_device *pdev)if (err)return err; -platform_set_drvdata (pdev, tgpio); -/* make sure to disable interrupts */ iowrite32 (0x0 , tgpio->membase +TGPIO_IER );
drivers/gpio/gpio-tqmx86.c +0 -2
@@ -259,8 +259,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)tqmx86_gpio_write (gpio, (u8 )~TQMX86_DIR_INPUT_MASK ,TQMX86_GPIODD ); -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-tqmx86" ; chip->owner =THIS_MODULE ;
drivers/gpio/gpio-ts4800.c +0 -2
@@ -52,8 +52,6 @@ static int ts4800_gpio_probe(struct platform_device *pdev) chip->ngpio = ngpios; -platform_set_drvdata (pdev, chip); -return devm_gpiochip_add_data (&pdev->dev, chip,NULL ); }
drivers/gpio/gpio-vx855.c +0 -2
@@ -240,8 +240,6 @@ static int vx855gpio_probe(struct platform_device *pdev)if (!vg)return -ENOMEM ; -platform_set_drvdata (pdev, vg); -dev_info (&pdev->dev,"found VX855 GPIO controller\n" ); vg->io_gpi = res_gpi->start; vg->io_gpo = res_gpo->start;
drivers/gpio/gpio-wcove.c +0 -2
@@ -433,8 +433,6 @@ static int wcove_gpio_probe(struct platform_device *pdev) wg->regmap_irq_chip = pmic->irq_chip_data; -platform_set_drvdata (pdev, wg); -mutex_init (&wg->buslock); wg->chip.label =KBUILD_MODNAME ; wg->chip.direction_input = wcove_gpio_dir_in;
drivers/gpio/gpio-xgene.c +0 -2
@@ -180,8 +180,6 @@ static int xgene_gpio_probe(struct platform_device *pdev) gpio->chip.label =dev_name (&pdev->dev); gpio->chip.base =-1 ; -platform_set_drvdata (pdev, gpio); -return devm_gpiochip_add_data (&pdev->dev, &gpio->chip, gpio); }
drivers/gpio/gpio-zevio.c +0 -2
@@ -176,8 +176,6 @@ static int zevio_gpio_probe(struct platform_device *pdev)if (!controller)return -ENOMEM ; -platform_set_drvdata (pdev, controller); -/* Copy our reference */ controller->chip = zevio_gpio_chip; controller->chip.parent = &pdev->dev;
drivers/gpio/gpio-zynqmp-modepin.c +0 -2
@@ -120,8 +120,6 @@ static int modepin_gpio_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; -platform_set_drvdata (pdev, chip); -/* configure the gpio chip */ chip->base =-1 ; chip->ngpio =MODE_PINS ;
Signature · 1 line
2.34.1
Le 19/03/2023 à 12:59, Lizhe a écrit :
Quoted 7 lines
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functionsSigned-off-by Lizhe <[email protected]>---
Hi, I just randomly choose one driver, and:
Quoted 6 lines
drivers/gpio/gpio-74xx-mmio.c | 2 -- drivers/gpio/gpio-aggregator.c | 1 - drivers/gpio/gpio-amd-fch.c | 2 -- drivers/gpio/gpio-bcm-kona.c | 1 - drivers/gpio/gpio-clps711x.c | 1 - drivers/gpio/gpio-davinci.c | 1 -
So more care should be given to avoid to break existing code.
How have you generated/checked your patch?
Just my 2c,
CJ
Quoted 691 lines
drivers/gpio/gpio-dwapb.c | 2 -- drivers/gpio/gpio-eic-sprd.c | 1 - drivers/gpio/gpio-em.c | 1 - drivers/gpio/gpio-exar.c | 2 -- drivers/gpio/gpio-f7188x.c | 2 -- drivers/gpio/gpio-htc-egpio.c | 3 --- drivers/gpio/gpio-imx-scu.c | 2 -- drivers/gpio/gpio-ixp4xx.c | 1 - drivers/gpio/gpio-janz-ttl.c | 1 - drivers/gpio/gpio-kempld.c | 2 -- drivers/gpio/gpio-latch.c | 2 -- drivers/gpio/gpio-logicvc.c | 2 -- drivers/gpio/gpio-loongson1.c | 1 - drivers/gpio/gpio-lp3943.c | 2 -- drivers/gpio/gpio-lp873x.c | 2 -- drivers/gpio/gpio-max77620.c | 2 -- drivers/gpio/gpio-mlxbf.c | 1 - drivers/gpio/gpio-mlxbf2.c | 2 -- drivers/gpio/gpio-mmio.c | 2 -- drivers/gpio/gpio-msc313.c | 2 -- drivers/gpio/gpio-mt7621.c | 1 - drivers/gpio/gpio-mvebu.c | 2 -- drivers/gpio/gpio-mxc.c | 2 -- drivers/gpio/gpio-omap.c | 4 ---- drivers/gpio/gpio-palmas.c | 1 - drivers/gpio/gpio-pmic-eic-sprd.c | 1 - drivers/gpio/gpio-rc5t583.c | 2 -- drivers/gpio/gpio-rcar.c | 2 -- drivers/gpio/gpio-rda.c | 2 -- drivers/gpio/gpio-rdc321x.c | 2 -- drivers/gpio/gpio-sama5d2-piobu.c | 1 - drivers/gpio/gpio-sch.c | 2 -- drivers/gpio/gpio-sch311x.c | 2 -- drivers/gpio/gpio-sifive.c | 1 - drivers/gpio/gpio-syscon.c | 2 -- drivers/gpio/gpio-tegra.c | 2 -- drivers/gpio/gpio-timberdale.c | 2 -- drivers/gpio/gpio-tqmx86.c | 2 -- drivers/gpio/gpio-ts4800.c | 2 -- drivers/gpio/gpio-vx855.c | 2 -- drivers/gpio/gpio-wcove.c | 2 -- drivers/gpio/gpio-xgene.c | 2 -- drivers/gpio/gpio-zevio.c | 2 -- drivers/gpio/gpio-zynqmp-modepin.c | 2 -- 50 files changed, 88 deletions(-)drivers/gpio/gpio-74xx-mmio.c +0
-2@@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) priv->gc.ngpio =MMIO_74XX_BIT_CNT (priv->flags); priv->gc.owner =THIS_MODULE ; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-aggregator.c +0
-1@@ -495,7 +495,6 @@ static int gpio_aggregator_probe(struct platform_device *pdev)if (IS_ERR (fwd))return PTR_ERR (fwd); -platform_set_drvdata (pdev, fwd);return 0 ; }drivers/gpio/gpio-amd-fch.c +0
-2@@ -172,8 +172,6 @@ static int amd_fch_gpio_probe(struct platform_device *pdev)if (IS_ERR (priv->base))return PTR_ERR (priv->base); -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-bcm-kona.c +0
-1@@ -597,7 +597,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENOMEM ; kona_gpio->pdev = pdev; -platform_set_drvdata (pdev, kona_gpio); chip->parent = dev; chip->ngpio = kona_gpio->num_bank *GPIO_PER_BANK ;drivers/gpio/gpio-clps711x.c +0
-1@@ -62,7 +62,6 @@ static int clps711x_gpio_probe(struct platform_device *pdev) gc->base =-1 ; gc->owner =THIS_MODULE ; -platform_set_drvdata (pdev, gc);return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }drivers/gpio/gpio-davinci.c +0
-1@@ -266,7 +266,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, chips); ret =davinci_gpio_irq_setup (pdev);if (ret)return ret;drivers/gpio/gpio-dwapb.c +0
-2@@ -734,8 +734,6 @@ static int dwapb_gpio_probe(struct platform_device *pdev)return err; } -platform_set_drvdata (pdev, gpio); -return 0 ; }drivers/gpio/gpio-eic-sprd.c +0
-1@@ -653,7 +653,6 @@ static int sprd_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, sprd_eic);return 0 ; }drivers/gpio/gpio-em.c +0
-1@@ -281,7 +281,6 @@ static int em_gio_probe(struct platform_device *pdev)return -ENOMEM ; p->pdev = pdev; -platform_set_drvdata (pdev, p);spin_lock_init (&p->sense_lock); irq[0 ] =platform_get_irq (pdev,0 );drivers/gpio/gpio-exar.c +0
-2@@ -217,8 +217,6 @@ static int gpio_exar_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, exar_gpio); -return 0 ; }drivers/gpio/gpio-f7188x.c +0
-2@@ -499,8 +499,6 @@ static int f7188x_gpio_probe(struct platform_device *pdev) } data->sio = sio; -platform_set_drvdata (pdev, data); -/* For each GPIO bank, register a GPIO chip. */ for (i =0 ; i < data->nr_bank; i++) {struct f7188x_gpio_bank *bank = &data->bank[i];drivers/gpio/gpio-htc-egpio.c +0
-3@@ -299,9 +299,6 @@ static int __init egpio_probe(struct platform_device *pdev)pr_debug ("reg_shift = %d\n" , ei->reg_shift); ei->reg_mask = (1 << pdata->reg_width) -1 ; - -platform_set_drvdata (pdev, ei); - ei->nchips = pdata->num_chips; ei->chip = devm_kcalloc(&pdev->dev, ei->nchips, sizeof(struct egpio_chip),drivers/gpio/gpio-imx-scu.c +0
-2@@ -109,8 +109,6 @@ static int imx_scu_gpio_probe(struct platform_device *pdev) gc->set = imx_scu_gpio_set; gc->get_direction = imx_scu_gpio_get_direction; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (dev, gc, priv); }drivers/gpio/gpio-ixp4xx.c +0
-1@@ -287,7 +287,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, g);dev_info (dev,"IXP4 GPIO registered\n" );return 0 ;drivers/gpio/gpio-janz-ttl.c +0
-1@@ -154,7 +154,6 @@ static int ttl_probe(struct platform_device *pdev)if (!mod)return -ENOMEM ; -platform_set_drvdata (pdev, mod);spin_lock_init (&mod->lock);/* get access to the MODULbus registers for this module */ drivers/gpio/gpio-kempld.c +0
-2@@ -151,8 +151,6 @@ static int kempld_gpio_probe(struct platform_device *pdev) gpio->pld = pld; -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-kempld" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-latch.c +0
-2@@ -192,8 +192,6 @@ static int gpio_latch_probe(struct platform_device *pdev) priv->gc.base =-1 ; priv->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-logicvc.c +0
-2@@ -139,8 +139,6 @@ static int logicvc_gpio_probe(struct platform_device *pdev) logicvc->chip.set = logicvc_gpio_set; logicvc->chip.direction_output = logicvc_gpio_direction_output; -platform_set_drvdata (pdev, logicvc); -return devm_gpiochip_add_data (dev, &logicvc->chip, logicvc); }drivers/gpio/gpio-loongson1.c +0
-1@@ -72,7 +72,6 @@ static int ls1x_gpio_probe(struct platform_device *pdev)if (ret) goto err; -platform_set_drvdata (pdev, gc);dev_info (dev,"Loongson1 GPIO driver registered\n" );return 0 ;drivers/gpio/gpio-lp3943.c +0
-2@@ -199,8 +199,6 @@ static int lp3943_gpio_probe(struct platform_device *pdev) lp3943_gpio->chip = lp3943_gpio_chip; lp3943_gpio->chip.parent = &pdev->dev; -platform_set_drvdata (pdev, lp3943_gpio); -return devm_gpiochip_add_data (&pdev->dev, &lp3943_gpio->chip, lp3943_gpio); }drivers/gpio/gpio-lp873x.c +0
-2@@ -140,8 +140,6 @@ static int lp873x_gpio_probe(struct platform_device *pdev)if (!gpio)return -ENOMEM ; -platform_set_drvdata (pdev, gpio); - gpio->lp873 =dev_get_drvdata (pdev->dev.parent); gpio->chip = template_chip; gpio->chip.parent = gpio->lp873->dev;drivers/gpio/gpio-max77620.c +0
-2@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) girq->init_hw = max77620_gpio_irq_init_hw; girq->threaded = true; -platform_set_drvdata (pdev, mgpio); - ret =devm_gpiochip_add_data (&pdev->dev, &mgpio->gpio_chip, mgpio);if (ret <0 ) {dev_err (&pdev->dev,"gpio_init: Failed to add max77620_gpio\n" );drivers/gpio/gpio-mlxbf.c +0
-1@@ -82,7 +82,6 @@ static int mlxbf_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, gs);dev_info (&pdev->dev,"registered Mellanox BlueField GPIO" );return 0 ; }drivers/gpio/gpio-mlxbf2.c +0
-2@@ -402,8 +402,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, gs); - ret =devm_gpiochip_add_data (dev, &gs->gc, gs);if (ret) {dev_err (dev,"Failed adding memory mapped gpiochip\n" );drivers/gpio/gpio-mmio.c +0
-2@@ -787,8 +787,6 @@ static int bgpio_pdev_probe(struct platform_device *pdev) gc->ngpio = pdata->ngpio; } -platform_set_drvdata (pdev, gc); -return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }drivers/gpio/gpio-msc313.c +0
-2@@ -625,8 +625,6 @@ static int msc313_gpio_probe(struct platform_device *pdev)if (IS_ERR (gpio->base))return PTR_ERR (gpio->base); -platform_set_drvdata (pdev, gpio); - gpiochip =devm_kzalloc (dev,sizeof (*gpiochip),GFP_KERNEL );if (!gpiochip)return -ENOMEM ;drivers/gpio/gpio-mt7621.c +0
-1@@ -315,7 +315,6 @@ mediatek_gpio_probe(struct platform_device *pdev)return mtk->gpio_irq; mtk->dev = dev; -platform_set_drvdata (pdev, mtk);for (i =0 ; i <MTK_BANK_CNT ; i++) { ret =mediatek_gpio_bank_probe (dev, i);drivers/gpio/gpio-mvebu.c +0
-2@@ -1143,8 +1143,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)if (!mvchip)return -ENOMEM ; -platform_set_drvdata (pdev, mvchip); -if (of_property_read_u32 (pdev->dev.of_node,"ngpios" , &ngpios)) {dev_err (&pdev->dev,"Missing ngpios OF property\n" );return -ENODEV ;drivers/gpio/gpio-mxc.c +0
-2@@ -489,8 +489,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)list_add_tail (&port->node, &mxc_gpio_ports); -platform_set_drvdata (pdev, port); -return 0 ; out_irqdomain_remove:drivers/gpio/gpio-omap.c +0
-4@@ -762,8 +762,6 @@ static struct platform_device omap_mpuio_device = {static inline void omap_mpuio_init (struct gpio_bank *bank) { -platform_set_drvdata (&omap_mpuio_device, bank); -if (platform_driver_register (&omap_mpuio_driver) ==0 ) (void )platform_device_register (&omap_mpuio_device); }@@ -1457,8 +1455,6 @@ static int omap_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, bank); -pm_runtime_enable (dev);pm_runtime_get_sync (dev);drivers/gpio/gpio-palmas.c +0
-1@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, palmas_gpio);return ret; }drivers/gpio/gpio-pmic-eic-sprd.c +0
-1@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, pmic_eic);return 0 ; }drivers/gpio/gpio-rc5t583.c +0
-2@@ -121,8 +121,6 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)if (pdata && pdata->gpio_base) rc5t583_gpio->gpio_chip.base = pdata->gpio_base; -platform_set_drvdata (pdev, rc5t583_gpio); -return devm_gpiochip_add_data (&pdev->dev, &rc5t583_gpio->gpio_chip, rc5t583_gpio); }drivers/gpio/gpio-rcar.c +0
-2@@ -513,8 +513,6 @@ static int gpio_rcar_probe(struct platform_device *pdev)if (ret <0 )return ret; -platform_set_drvdata (pdev, p); -pm_runtime_enable (dev); ret =platform_get_irq (pdev,0 );drivers/gpio/gpio-rda.c +0
-2@@ -263,8 +263,6 @@ static int rda_gpio_probe(struct platform_device *pdev) girq->parents[0 ] = rda_gpio->irq; } -platform_set_drvdata (pdev, rda_gpio); -return devm_gpiochip_add_data (dev, &rda_gpio->chip, rda_gpio); }drivers/gpio/gpio-rdc321x.c +0
-2@@ -161,8 +161,6 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->chip.base =0 ; rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios; -platform_set_drvdata (pdev, rdc321x_gpio_dev); -/* This might not be, what others (BIOS, bootloader, etc.) wrote to these registers before, but it's a good guess. Still better than just using 0xffffffff. */ drivers/gpio/gpio-sama5d2-piobu.c +0
-1@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)if (!piobu)return -ENOMEM ; -platform_set_drvdata (pdev, piobu); piobu->chip.label = pdev->name; piobu->chip.parent = &pdev->dev; piobu->chip.owner = THIS_MODULE,drivers/gpio/gpio-sch.c +0
-2@@ -380,8 +380,6 @@ static int sch_gpio_probe(struct platform_device *pdev)return -ENODEV ; } -platform_set_drvdata (pdev, sch); - girq = &sch->chip.irq;gpio_irq_chip_set_chip (girq, &sch_irqchip); girq->num_parents =0 ;drivers/gpio/gpio-sch311x.c +0
-2@@ -281,8 +281,6 @@ static int sch311x_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; -platform_set_drvdata (pdev, priv); -for (i =0 ; i <ARRAY_SIZE (priv->blocks); i++) { block = &priv->blocks[i];drivers/gpio/gpio-sifive.c +0
-1@@ -256,7 +256,6 @@ static int sifive_gpio_probe(struct platform_device *pdev) girq->handler = handle_bad_irq; girq->default_type =IRQ_TYPE_NONE ; -platform_set_drvdata (pdev, chip);return gpiochip_add_data (&chip->gc, chip); }drivers/gpio/gpio-syscon.c +0
-2@@ -249,8 +249,6 @@ static int syscon_gpio_probe(struct platform_device *pdev) priv->chip.direction_output = syscon_gpio_dir_out; } -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->chip, priv); }drivers/gpio/gpio-tegra.c +0
-2@@ -728,8 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count *32 ; tgi->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, tgi); -if (tgi->soc->debounce_supported) tgi->gc.set_config = tegra_gpio_set_config;drivers/gpio/gpio-timberdale.c +0
-2@@ -256,8 +256,6 @@ static int timbgpio_probe(struct platform_device *pdev)if (err)return err; -platform_set_drvdata (pdev, tgpio); -/* make sure to disable interrupts */ iowrite32 (0x0 , tgpio->membase +TGPIO_IER );drivers/gpio/gpio-tqmx86.c +0
-2@@ -259,8 +259,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)tqmx86_gpio_write (gpio, (u8 )~TQMX86_DIR_INPUT_MASK ,TQMX86_GPIODD ); -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-tqmx86" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-ts4800.c +0
-2@@ -52,8 +52,6 @@ static int ts4800_gpio_probe(struct platform_device *pdev) chip->ngpio = ngpios; -platform_set_drvdata (pdev, chip); -return devm_gpiochip_add_data (&pdev->dev, chip,NULL ); }drivers/gpio/gpio-vx855.c +0
-2@@ -240,8 +240,6 @@ static int vx855gpio_probe(struct platform_device *pdev)if (!vg)return -ENOMEM ; -platform_set_drvdata (pdev, vg); -dev_info (&pdev->dev,"found VX855 GPIO controller\n" ); vg->io_gpi = res_gpi->start; vg->io_gpo = res_gpo->start;drivers/gpio/gpio-wcove.c +0
-2@@ -433,8 +433,6 @@ static int wcove_gpio_probe(struct platform_device *pdev) wg->regmap_irq_chip = pmic->irq_chip_data; -platform_set_drvdata (pdev, wg); -mutex_init (&wg->buslock); wg->chip.label =KBUILD_MODNAME ; wg->chip.direction_input = wcove_gpio_dir_in;drivers/gpio/gpio-xgene.c +0
-2@@ -180,8 +180,6 @@ static int xgene_gpio_probe(struct platform_device *pdev) gpio->chip.label =dev_name (&pdev->dev); gpio->chip.base =-1 ; -platform_set_drvdata (pdev, gpio); -return devm_gpiochip_add_data (&pdev->dev, &gpio->chip, gpio); }drivers/gpio/gpio-zevio.c +0
-2@@ -176,8 +176,6 @@ static int zevio_gpio_probe(struct platform_device *pdev)if (!controller)return -ENOMEM ; -platform_set_drvdata (pdev, controller); -/* Copy our reference */ controller->chip = zevio_gpio_chip; controller->chip.parent = &pdev->dev;drivers/gpio/gpio-zynqmp-modepin.c +0
-2@@ -120,8 +120,6 @@ static int modepin_gpio_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; -platform_set_drvdata (pdev, chip); -/* configure the gpio chip */ chip->base =-1 ; chip->ngpio =MODE_PINS ;
Le 19/03/2023 à 13:28, lizhe a écrit :
Quoted 5 lines
HI :
Thanks for pointing out this C file,
i will remove the modifications to this file
Other examples below.
I've not (and I won't) check them all.
Unless you explain how you generated (or even tested) your patch, I think that reviewing it, line by line, is just a waste of time.
CJ
Quoted 42 lines
Quoted 41 lines · Christophe JAILLET
Le 19/03/2023 à 12:59, Lizhe a écrit :
Quoted 7 lines
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functionsSigned-off-by Lizhe <[email protected]>---
Hi, I just randomly choose one driver, and:
Quoted 6 lines
drivers/gpio/gpio-74xx-mmio.c | 2 -- drivers/gpio/gpio-aggregator.c | 1 - drivers/gpio/gpio-amd-fch.c | 2 -- drivers/gpio/gpio-bcm-kona.c | 1 - drivers/gpio/gpio-clps711x.c | 1 - drivers/gpio/gpio-davinci.c | 1 -So more care should be given to avoid to break existing code.
How have you generated/checked your patch?
Just my 2c,
CJ
Quoted 13 lines
drivers/gpio/gpio-dwapb.c | 2 -- drivers/gpio/gpio-eic-sprd.c | 1 - drivers/gpio/gpio-em.c | 1 - drivers/gpio/gpio-exar.c | 2 -- drivers/gpio/gpio-f7188x.c | 2 -- drivers/gpio/gpio-htc-egpio.c | 3 --- drivers/gpio/gpio-imx-scu.c | 2 -- drivers/gpio/gpio-ixp4xx.c | 1 - drivers/gpio/gpio-janz-ttl.c | 1 - drivers/gpio/gpio-kempld.c | 2 -- drivers/gpio/gpio-latch.c | 2 -- drivers/gpio/gpio-logicvc.c | 2 -- drivers/gpio/gpio-loongson1.c | 1 -
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpio/gpio-lp3943.c | 2 -- drivers/gpio/gpio-lp873x.c | 2 -- drivers/gpio/gpio-max77620.c | 2 -- drivers/gpio/gpio-mlxbf.c | 1 - drivers/gpio/gpio-mlxbf2.c | 2 -- drivers/gpio/gpio-mmio.c | 2 -- drivers/gpio/gpio-msc313.c | 2 -- drivers/gpio/gpio-mt7621.c | 1 -
Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpio/gpio-mvebu.c | 2 --
Quoted 669 lines
Quoted 669 lines
Quoted 669 lines
drivers/gpio/gpio-mxc.c | 2 -- drivers/gpio/gpio-omap.c | 4 ---- drivers/gpio/gpio-palmas.c | 1 - drivers/gpio/gpio-pmic-eic-sprd.c | 1 - drivers/gpio/gpio-rc5t583.c | 2 -- drivers/gpio/gpio-rcar.c | 2 -- drivers/gpio/gpio-rda.c | 2 -- drivers/gpio/gpio-rdc321x.c | 2 -- drivers/gpio/gpio-sama5d2-piobu.c | 1 - drivers/gpio/gpio-sch.c | 2 -- drivers/gpio/gpio-sch311x.c | 2 -- drivers/gpio/gpio-sifive.c | 1 - drivers/gpio/gpio-syscon.c | 2 -- drivers/gpio/gpio-tegra.c | 2 -- drivers/gpio/gpio-timberdale.c | 2 -- drivers/gpio/gpio-tqmx86.c | 2 -- drivers/gpio/gpio-ts4800.c | 2 -- drivers/gpio/gpio-vx855.c | 2 -- drivers/gpio/gpio-wcove.c | 2 -- drivers/gpio/gpio-xgene.c | 2 -- drivers/gpio/gpio-zevio.c | 2 -- drivers/gpio/gpio-zynqmp-modepin.c | 2 -- 50 files changed, 88 deletions(-)drivers/gpio/gpio-74xx-mmio.c +0
-2@@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) priv->gc.ngpio =MMIO_74XX_BIT_CNT (priv->flags); priv->gc.owner =THIS_MODULE ; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-aggregator.c +0
-1@@ -495,7 +495,6 @@ static int gpio_aggregator_probe(struct platform_device *pdev)if (IS_ERR (fwd))return PTR_ERR (fwd); -platform_set_drvdata (pdev, fwd);return 0 ; }drivers/gpio/gpio-amd-fch.c +0
-2@@ -172,8 +172,6 @@ static int amd_fch_gpio_probe(struct platform_device *pdev)if (IS_ERR (priv->base))return PTR_ERR (priv->base); -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-bcm-kona.c +0
-1@@ -597,7 +597,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENOMEM ; kona_gpio->pdev = pdev; -platform_set_drvdata (pdev, kona_gpio); chip->parent = dev; chip->ngpio = kona_gpio->num_bank *GPIO_PER_BANK ;drivers/gpio/gpio-clps711x.c +0
-1@@ -62,7 +62,6 @@ static int clps711x_gpio_probe(struct platform_device *pdev) gc->base =-1 ; gc->owner =THIS_MODULE ; -platform_set_drvdata (pdev, gc);return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }drivers/gpio/gpio-davinci.c +0
-1@@ -266,7 +266,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, chips); ret =davinci_gpio_irq_setup (pdev);if (ret)return ret;drivers/gpio/gpio-dwapb.c +0
-2@@ -734,8 +734,6 @@ static int dwapb_gpio_probe(struct platform_device *pdev)return err; } -platform_set_drvdata (pdev, gpio); -return 0 ; }drivers/gpio/gpio-eic-sprd.c +0
-1@@ -653,7 +653,6 @@ static int sprd_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, sprd_eic);return 0 ; }drivers/gpio/gpio-em.c +0
-1@@ -281,7 +281,6 @@ static int em_gio_probe(struct platform_device *pdev)return -ENOMEM ; p->pdev = pdev; -platform_set_drvdata (pdev, p);spin_lock_init (&p->sense_lock); irq[0 ] =platform_get_irq (pdev,0 );drivers/gpio/gpio-exar.c +0
-2@@ -217,8 +217,6 @@ static int gpio_exar_probe(struct platform_device *pdev)if (ret)return ret; -platform_set_drvdata (pdev, exar_gpio); -return 0 ; }drivers/gpio/gpio-f7188x.c +0
-2@@ -499,8 +499,6 @@ static int f7188x_gpio_probe(struct platform_device *pdev) } data->sio = sio; -platform_set_drvdata (pdev, data); -/* For each GPIO bank, register a GPIO chip. */ for (i =0 ; i < data->nr_bank; i++) {struct f7188x_gpio_bank *bank = &data->bank[i];drivers/gpio/gpio-htc-egpio.c +0
-3@@ -299,9 +299,6 @@ static int __init egpio_probe(struct platform_device *pdev)pr_debug ("reg_shift = %d\n" , ei->reg_shift); ei->reg_mask = (1 << pdata->reg_width) -1 ; - -platform_set_drvdata (pdev, ei); - ei->nchips = pdata->num_chips; ei->chip = devm_kcalloc(&pdev->dev, ei->nchips, sizeof(struct egpio_chip),drivers/gpio/gpio-imx-scu.c +0
-2@@ -109,8 +109,6 @@ static int imx_scu_gpio_probe(struct platform_device *pdev) gc->set = imx_scu_gpio_set; gc->get_direction = imx_scu_gpio_get_direction; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (dev, gc, priv); }drivers/gpio/gpio-ixp4xx.c +0
-1@@ -287,7 +287,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, g);dev_info (dev,"IXP4 GPIO registered\n" );return 0 ;drivers/gpio/gpio-janz-ttl.c +0
-1@@ -154,7 +154,6 @@ static int ttl_probe(struct platform_device *pdev)if (!mod)return -ENOMEM ; -platform_set_drvdata (pdev, mod);spin_lock_init (&mod->lock);/* get access to the MODULbus registers for this module */ drivers/gpio/gpio-kempld.c +0
-2@@ -151,8 +151,6 @@ static int kempld_gpio_probe(struct platform_device *pdev) gpio->pld = pld; -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-kempld" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-latch.c +0
-2@@ -192,8 +192,6 @@ static int gpio_latch_probe(struct platform_device *pdev) priv->gc.base =-1 ; priv->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); }drivers/gpio/gpio-logicvc.c +0
-2@@ -139,8 +139,6 @@ static int logicvc_gpio_probe(struct platform_device *pdev) logicvc->chip.set = logicvc_gpio_set; logicvc->chip.direction_output = logicvc_gpio_direction_output; -platform_set_drvdata (pdev, logicvc); -return devm_gpiochip_add_data (dev, &logicvc->chip, logicvc); }drivers/gpio/gpio-loongson1.c +0
-1@@ -72,7 +72,6 @@ static int ls1x_gpio_probe(struct platform_device *pdev)if (ret) goto err; -platform_set_drvdata (pdev, gc);dev_info (dev,"Loongson1 GPIO driver registered\n" );return 0 ;drivers/gpio/gpio-lp3943.c +0
-2@@ -199,8 +199,6 @@ static int lp3943_gpio_probe(struct platform_device *pdev) lp3943_gpio->chip = lp3943_gpio_chip; lp3943_gpio->chip.parent = &pdev->dev; -platform_set_drvdata (pdev, lp3943_gpio); -return devm_gpiochip_add_data (&pdev->dev, &lp3943_gpio->chip, lp3943_gpio); }drivers/gpio/gpio-lp873x.c +0
-2@@ -140,8 +140,6 @@ static int lp873x_gpio_probe(struct platform_device *pdev)if (!gpio)return -ENOMEM ; -platform_set_drvdata (pdev, gpio); - gpio->lp873 =dev_get_drvdata (pdev->dev.parent); gpio->chip = template_chip; gpio->chip.parent = gpio->lp873->dev;drivers/gpio/gpio-max77620.c +0
-2@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) girq->init_hw = max77620_gpio_irq_init_hw; girq->threaded = true; -platform_set_drvdata (pdev, mgpio); - ret =devm_gpiochip_add_data (&pdev->dev, &mgpio->gpio_chip, mgpio);if (ret <0 ) {dev_err (&pdev->dev,"gpio_init: Failed to add max77620_gpio\n" );drivers/gpio/gpio-mlxbf.c +0
-1@@ -82,7 +82,6 @@ static int mlxbf_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, gs);dev_info (&pdev->dev,"registered Mellanox BlueField GPIO" );return 0 ; }drivers/gpio/gpio-mlxbf2.c +0
-2@@ -402,8 +402,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, gs); - ret =devm_gpiochip_add_data (dev, &gs->gc, gs);if (ret) {dev_err (dev,"Failed adding memory mapped gpiochip\n" );drivers/gpio/gpio-mmio.c +0
-2@@ -787,8 +787,6 @@ static int bgpio_pdev_probe(struct platform_device *pdev) gc->ngpio = pdata->ngpio; } -platform_set_drvdata (pdev, gc); -return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); }drivers/gpio/gpio-msc313.c +0
-2@@ -625,8 +625,6 @@ static int msc313_gpio_probe(struct platform_device *pdev)if (IS_ERR (gpio->base))return PTR_ERR (gpio->base); -platform_set_drvdata (pdev, gpio); - gpiochip =devm_kzalloc (dev,sizeof (*gpiochip),GFP_KERNEL );if (!gpiochip)return -ENOMEM ;drivers/gpio/gpio-mt7621.c +0
-1@@ -315,7 +315,6 @@ mediatek_gpio_probe(struct platform_device *pdev)return mtk->gpio_irq; mtk->dev = dev; -platform_set_drvdata (pdev, mtk);for (i =0 ; i <MTK_BANK_CNT ; i++) { ret =mediatek_gpio_bank_probe (dev, i);drivers/gpio/gpio-mvebu.c +0
-2@@ -1143,8 +1143,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)if (!mvchip)return -ENOMEM ; -platform_set_drvdata (pdev, mvchip); -if (of_property_read_u32 (pdev->dev.of_node,"ngpios" , &ngpios)) {dev_err (&pdev->dev,"Missing ngpios OF property\n" );return -ENODEV ;drivers/gpio/gpio-mxc.c +0
-2@@ -489,8 +489,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)list_add_tail (&port->node, &mxc_gpio_ports); -platform_set_drvdata (pdev, port); -return 0 ; out_irqdomain_remove:drivers/gpio/gpio-omap.c +0
-4@@ -762,8 +762,6 @@ static struct platform_device omap_mpuio_device = {static inline void omap_mpuio_init (struct gpio_bank *bank) { -platform_set_drvdata (&omap_mpuio_device, bank); -if (platform_driver_register (&omap_mpuio_driver) ==0 ) (void )platform_device_register (&omap_mpuio_device); }@@ -1457,8 +1455,6 @@ static int omap_gpio_probe(struct platform_device *pdev) } } -platform_set_drvdata (pdev, bank); -pm_runtime_enable (dev);pm_runtime_get_sync (dev);drivers/gpio/gpio-palmas.c +0
-1@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, palmas_gpio);return ret; }drivers/gpio/gpio-pmic-eic-sprd.c +0
-1@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)return ret; } -platform_set_drvdata (pdev, pmic_eic);return 0 ; }drivers/gpio/gpio-rc5t583.c +0
-2@@ -121,8 +121,6 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)if (pdata && pdata->gpio_base) rc5t583_gpio->gpio_chip.base = pdata->gpio_base; -platform_set_drvdata (pdev, rc5t583_gpio); -return devm_gpiochip_add_data (&pdev->dev, &rc5t583_gpio->gpio_chip, rc5t583_gpio); }drivers/gpio/gpio-rcar.c +0
-2@@ -513,8 +513,6 @@ static int gpio_rcar_probe(struct platform_device *pdev)if (ret <0 )return ret; -platform_set_drvdata (pdev, p); -pm_runtime_enable (dev); ret =platform_get_irq (pdev,0 );drivers/gpio/gpio-rda.c +0
-2@@ -263,8 +263,6 @@ static int rda_gpio_probe(struct platform_device *pdev) girq->parents[0 ] = rda_gpio->irq; } -platform_set_drvdata (pdev, rda_gpio); -return devm_gpiochip_add_data (dev, &rda_gpio->chip, rda_gpio); }drivers/gpio/gpio-rdc321x.c +0
-2@@ -161,8 +161,6 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->chip.base =0 ; rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios; -platform_set_drvdata (pdev, rdc321x_gpio_dev); -/* This might not be, what others (BIOS, bootloader, etc.) wrote to these registers before, but it's a good guess. Still better than just using 0xffffffff. */ drivers/gpio/gpio-sama5d2-piobu.c +0
-1@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)if (!piobu)return -ENOMEM ; -platform_set_drvdata (pdev, piobu); piobu->chip.label = pdev->name; piobu->chip.parent = &pdev->dev; piobu->chip.owner = THIS_MODULE,drivers/gpio/gpio-sch.c +0
-2@@ -380,8 +380,6 @@ static int sch_gpio_probe(struct platform_device *pdev)return -ENODEV ; } -platform_set_drvdata (pdev, sch); - girq = &sch->chip.irq;gpio_irq_chip_set_chip (girq, &sch_irqchip); girq->num_parents =0 ;drivers/gpio/gpio-sch311x.c +0
-2@@ -281,8 +281,6 @@ static int sch311x_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; -platform_set_drvdata (pdev, priv); -for (i =0 ; i <ARRAY_SIZE (priv->blocks); i++) { block = &priv->blocks[i];drivers/gpio/gpio-sifive.c +0
-1@@ -256,7 +256,6 @@ static int sifive_gpio_probe(struct platform_device *pdev) girq->handler = handle_bad_irq; girq->default_type =IRQ_TYPE_NONE ; -platform_set_drvdata (pdev, chip);return gpiochip_add_data (&chip->gc, chip); }drivers/gpio/gpio-syscon.c +0
-2@@ -249,8 +249,6 @@ static int syscon_gpio_probe(struct platform_device *pdev) priv->chip.direction_output = syscon_gpio_dir_out; } -platform_set_drvdata (pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->chip, priv); }drivers/gpio/gpio-tegra.c +0
-2@@ -728,8 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count *32 ; tgi->gc.parent = &pdev->dev; -platform_set_drvdata (pdev, tgi); -if (tgi->soc->debounce_supported) tgi->gc.set_config = tegra_gpio_set_config;drivers/gpio/gpio-timberdale.c +0
-2@@ -256,8 +256,6 @@ static int timbgpio_probe(struct platform_device *pdev)if (err)return err; -platform_set_drvdata (pdev, tgpio); -/* make sure to disable interrupts */ iowrite32 (0x0 , tgpio->membase +TGPIO_IER );drivers/gpio/gpio-tqmx86.c +0
-2@@ -259,8 +259,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)tqmx86_gpio_write (gpio, (u8 )~TQMX86_DIR_INPUT_MASK ,TQMX86_GPIODD ); -platform_set_drvdata (pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-tqmx86" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-ts4800.c +0
-2@@ -52,8 +52,6 @@ static int ts4800_gpio_probe(struct platform_device *pdev) chip->ngpio = ngpios; -platform_set_drvdata (pdev, chip); -return devm_gpiochip_add_data (&pdev->dev, chip,NULL ); }drivers/gpio/gpio-vx855.c +0
-2@@ -240,8 +240,6 @@ static int vx855gpio_probe(struct platform_device *pdev)if (!vg)return -ENOMEM ; -platform_set_drvdata (pdev, vg); -dev_info (&pdev->dev,"found VX855 GPIO controller\n" ); vg->io_gpi = res_gpi->start; vg->io_gpo = res_gpo->start;drivers/gpio/gpio-wcove.c +0
-2@@ -433,8 +433,6 @@ static int wcove_gpio_probe(struct platform_device *pdev) wg->regmap_irq_chip = pmic->irq_chip_data; -platform_set_drvdata (pdev, wg); -mutex_init (&wg->buslock); wg->chip.label =KBUILD_MODNAME ; wg->chip.direction_input = wcove_gpio_dir_in;drivers/gpio/gpio-xgene.c +0
-2@@ -180,8 +180,6 @@ static int xgene_gpio_probe(struct platform_device *pdev) gpio->chip.label =dev_name (&pdev->dev); gpio->chip.base =-1 ; -platform_set_drvdata (pdev, gpio); -return devm_gpiochip_add_data (&pdev->dev, &gpio->chip, gpio); }drivers/gpio/gpio-zevio.c +0
-2@@ -176,8 +176,6 @@ static int zevio_gpio_probe(struct platform_device *pdev)if (!controller)return -ENOMEM ; -platform_set_drvdata (pdev, controller); -/* Copy our reference */ controller->chip = zevio_gpio_chip; controller->chip.parent = &pdev->dev;drivers/gpio/gpio-zynqmp-modepin.c +0
-2@@ -120,8 +120,6 @@ static int modepin_gpio_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; -platform_set_drvdata (pdev, chip); -/* configure the gpio chip */ chip->base =-1 ; chip->ngpio =MODE_PINS ;
Hi Christophe
Quoted 7 lines · Christophe JAILLET
Le 19/03/2023 à 13:28, lizhe a écrit :
Quoted 5 lines
HI :
Thanks for pointing out this C file,
i will remove the modifications to this file
Quoted 6 lines
Other examples below.
I've not (and I won't) check them all.
Unless you explain how you generated (or even tested) your patch, I think that reviewing it, line by line, is just a waste of time.
An obviously bogus patch was submitted for DW SSI controller to.
It seems as if Lizhe doesn't fully understand what he is doing.
-Serge(y)
Quoted 669 lines
CJ
Quoted 41 lines
Quoted 40 lines · Christophe JAILLET
Le 19/03/2023 à 12:59, Lizhe a écrit :
Quoted 6 lines
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functionsQuoted 1 line
Quoted 1 line
Signed-off-by Lizhe <[email protected]>---
Hi, I just randomly choose one driver, and:
Quoted 6 lines
drivers/gpio/gpio-74xx-mmio.c | 2 -- drivers/gpio/gpio-aggregator.c | 1 - drivers/gpio/gpio-amd-fch.c | 2 -- drivers/gpio/gpio-bcm-kona.c | 1 - drivers/gpio/gpio-clps711x.c | 1 - drivers/gpio/gpio-davinci.c | 1 -So more care should be given to avoid to break existing code.
How have you generated/checked your patch?
Just my 2c,
CJ
Quoted 13 lines
drivers/gpio/gpio-dwapb.c | 2 -- drivers/gpio/gpio-eic-sprd.c | 1 - drivers/gpio/gpio-em.c | 1 - drivers/gpio/gpio-exar.c | 2 -- drivers/gpio/gpio-f7188x.c | 2 -- drivers/gpio/gpio-htc-egpio.c | 3 --- drivers/gpio/gpio-imx-scu.c | 2 -- drivers/gpio/gpio-ixp4xx.c | 1 - drivers/gpio/gpio-janz-ttl.c | 1 - drivers/gpio/gpio-kempld.c | 2 -- drivers/gpio/gpio-latch.c | 2 -- drivers/gpio/gpio-logicvc.c | 2 -- drivers/gpio/gpio-loongson1.c | 1 -Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpio/gpio-lp3943.c | 2 -- drivers/gpio/gpio-lp873x.c | 2 -- drivers/gpio/gpio-max77620.c | 2 -- drivers/gpio/gpio-mlxbf.c | 1 - drivers/gpio/gpio-mlxbf2.c | 2 -- drivers/gpio/gpio-mmio.c | 2 -- drivers/gpio/gpio-msc313.c | 2 -- drivers/gpio/gpio-mt7621.c | 1 -Quoted 1 line
Quoted 1 line
Quoted 1 line
drivers/gpio/gpio-mvebu.c | 2 --Quoted 605 lines
Quoted 23 lines
Quoted 23 lines
drivers/gpio/gpio-mxc.c | 2 -- drivers/gpio/gpio-omap.c | 4 ---- drivers/gpio/gpio-palmas.c | 1 - drivers/gpio/gpio-pmic-eic-sprd.c | 1 - drivers/gpio/gpio-rc5t583.c | 2 -- drivers/gpio/gpio-rcar.c | 2 -- drivers/gpio/gpio-rda.c | 2 -- drivers/gpio/gpio-rdc321x.c | 2 -- drivers/gpio/gpio-sama5d2-piobu.c | 1 - drivers/gpio/gpio-sch.c | 2 -- drivers/gpio/gpio-sch311x.c | 2 -- drivers/gpio/gpio-sifive.c | 1 - drivers/gpio/gpio-syscon.c | 2 -- drivers/gpio/gpio-tegra.c | 2 -- drivers/gpio/gpio-timberdale.c | 2 -- drivers/gpio/gpio-tqmx86.c | 2 -- drivers/gpio/gpio-ts4800.c | 2 -- drivers/gpio/gpio-vx855.c | 2 -- drivers/gpio/gpio-wcove.c | 2 -- drivers/gpio/gpio-xgene.c | 2 -- drivers/gpio/gpio-zevio.c | 2 -- drivers/gpio/gpio-zynqmp-modepin.c | 2 -- 50 files changed, 88 deletions(-)Quoted 1 line
Quoted 1 line
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpio/gpio-74xx-mmio.cQuoted 11 lines
drivers/gpio/gpio-74xx-mmio.c static int mmio_74xx_gpio_probe(struct platform_device *pdev) · line 140
Quoted 11 lines
index
0464f1ecd20d..c7ac5a9ffb1f100644drivers/gpio/gpio-74xx-mmio.c +0
-1@@ -135,8 +135,6 @@ static int mmio_74xx_gpio_probe(struct platform_device *pdev) priv->gc.ngpio =MMIO_74XX_BIT_CNT (priv->flags); priv->gc.owner =THIS_MODULE ; >> - platform_set_drvdata(pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); } >> diff --git a/drivers/gpio/gpio-aggregator.c
b/drivers/gpio/gpio-aggregator.cQuoted 10 lines
drivers/gpio/gpio-aggregator.c static int gpio_aggregator_probe(struct platform_device *pdev) · line 500
Quoted 10 lines
index
6d17d262ad91..f67d1d46c093100644drivers/gpio/gpio-aggregator.c +0
-0@@ -495,7 +495,6 @@ static int gpio_aggregator_probe(struct platform_device *pdev)if (IS_ERR (fwd))return PTR_ERR (fwd); >> - platform_set_drvdata(pdev, fwd);return 0 ; } >> diff --git a/drivers/gpio/gpio-amd-fch.c
b/drivers/gpio/gpio-amd-fch.cQuoted 11 lines
drivers/gpio/gpio-amd-fch.c static int amd_fch_gpio_probe(struct platform_device *pdev) · line 177
Quoted 11 lines
index
2a21354ed6a0..8a7f861513eb100644drivers/gpio/gpio-amd-fch.c +0
-1@@ -172,8 +172,6 @@ static int amd_fch_gpio_probe(struct platform_device *pdev)if (IS_ERR (priv->base))return PTR_ERR (priv->base); >> - platform_set_drvdata(pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); } >> diff --git a/drivers/gpio/gpio-bcm-kona.c
b/drivers/gpio/gpio-bcm-kona.cQuoted 10 lines
drivers/gpio/gpio-bcm-kona.c static int bcm_kona_gpio_probe(struct platform_device *pdev) · line 601
Quoted 10 lines
index
70770429ba48..2e50a07a43e6100644drivers/gpio/gpio-bcm-kona.c +0
-1@@ -597,7 +597,6 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)return -ENOMEM ; >> kona_gpio->pdev = pdev; -platform_set_drvdata (pdev, kona_gpio); chip->parent = dev; chip->ngpio = kona_gpio->num_bank *GPIO_PER_BANK ; >> diff --git a/drivers/gpio/gpio-clps711x.c
b/drivers/gpio/gpio-clps711x.cQuoted 24 lines
Quoted 24 lines
index
75f6f8d4323e..b9ba85ef94b2100644drivers/gpio/gpio-clps711x.c +0
-1@@ -62,7 +62,6 @@ static int clps711x_gpio_probe(struct platform_device *pdev) >> gc->base = -1; gc->owner =THIS_MODULE ; -platform_set_drvdata (pdev, gc); >> return devm_gpiochip_add_data(&pdev->dev, gc, NULL); }drivers/gpio/gpio-davinci.c +0
-0@@ -266,7 +266,6 @@ static int davinci_gpio_probe(struct platform_device *pdev)if (ret)return ret; >> - platform_set_drvdata(pdev, chips); ret =davinci_gpio_irq_setup (pdev);if (ret)return ret;drivers/gpio/gpio-dwapb.c +0
-0Quoted 8 lines
drivers/gpio/gpio-dwapb.c static int dwapb_gpio_probe(struct platform_device *pdev) · line 739
Quoted 8 lines
drivers/gpio/gpio-dwapb.c +0
-1@@ -734,8 +734,6 @@ static int dwapb_gpio_probe(struct platform_device *pdev)return err; } >> - platform_set_drvdata(pdev, gpio); -return 0 ; } >> diff --git a/drivers/gpio/gpio-eic-sprd.c
b/drivers/gpio/gpio-eic-sprd.cQuoted 23 lines
Quoted 23 lines
index
84352a6f4973..53db88ae2a20100644drivers/gpio/gpio-eic-sprd.c +0
-0@@ -653,7 +653,6 @@ static int sprd_eic_probe(struct platform_device *pdev)return ret; } >> - platform_set_drvdata(pdev, sprd_eic);return 0 ; } >> diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.cindex
858e6ebbb584..3707cb4c1b79100644drivers/gpio/gpio-em.c +0
-1@@ -281,7 +281,6 @@ static int em_gio_probe(struct platform_device *pdev)return -ENOMEM ; >> p->pdev = pdev; -platform_set_drvdata (pdev, p);spin_lock_init (&p->sense_lock); >> irq[0] = platform_get_irq(pdev, 0);drivers/gpio/gpio-exar.c +0
-0Quoted 8 lines
drivers/gpio/gpio-exar.c static int gpio_exar_probe(struct platform_device *pdev) · line 222
Quoted 8 lines
drivers/gpio/gpio-exar.c +0
-1@@ -217,8 +217,6 @@ static int gpio_exar_probe(struct platform_device *pdev)if (ret)return ret; >> - platform_set_drvdata(pdev, exar_gpio); -return 0 ; } >> diff --git a/drivers/gpio/gpio-f7188x.c
b/drivers/gpio/gpio-f7188x.cQuoted 28 lines
Quoted 28 lines
index
9effa7769bef..5475614c1872100644drivers/gpio/gpio-f7188x.c +0
-1@@ -499,8 +499,6 @@ static int f7188x_gpio_probe(struct platform_device *pdev) } data->sio = sio; >> - platform_set_drvdata(pdev, data); -/* For each GPIO bank, register a GPIO chip. */ for (i =0 ; i < data->nr_bank; i++) {struct f7188x_gpio_bank *bank = &data->bank[i];drivers/gpio/gpio-htc-egpio.c +0
-3@@ -299,9 +299,6 @@ static int __init egpio_probe(struct platform_device *pdev)pr_debug ("reg_shift = %d\n" , ei->reg_shift); >> ei->reg_mask = (1 << pdata->reg_width) - 1; - -platform_set_drvdata (pdev, ei); - ei->nchips = pdata->num_chips; ei->chip = devm_kcalloc(&pdev->dev, ei->nchips, sizeof(struct egpio_chip),drivers/gpio/gpio-imx-scu.c +0
-0Quoted 8 lines
drivers/gpio/gpio-imx-scu.c static int imx_scu_gpio_probe(struct platform_device *pdev) · line 114
Quoted 8 lines
drivers/gpio/gpio-imx-scu.c +0
-1@@ -109,8 +109,6 @@ static int imx_scu_gpio_probe(struct platform_device *pdev) gc->set = imx_scu_gpio_set; gc->get_direction = imx_scu_gpio_get_direction; >> - platform_set_drvdata(pdev, priv); -return devm_gpiochip_add_data (dev, gc, priv); } >> diff --git a/drivers/gpio/gpio-ixp4xx.c
b/drivers/gpio/gpio-ixp4xx.cQuoted 34 lines
Quoted 34 lines
index
56656fb519f8..3f59658dd316100644drivers/gpio/gpio-ixp4xx.c +0
-0@@ -287,7 +287,6 @@ static int ixp4xx_gpio_probe(struct platform_device *pdev)return ret; } >> - platform_set_drvdata(pdev, g);dev_info (dev,"IXP4 GPIO registered\n" ); >> return 0;drivers/gpio/gpio-janz-ttl.c +0
-0@@ -154,7 +154,6 @@ static int ttl_probe(struct platform_device *pdev)if (!mod)return -ENOMEM ; >> - platform_set_drvdata(pdev, mod);spin_lock_init (&mod->lock); >> /* get access to the MODULbus registers for this module */drivers/gpio/gpio-kempld.c +0
-1@@ -151,8 +151,6 @@ static int kempld_gpio_probe(struct platform_device *pdev) >> gpio->pld = pld; >> - platform_set_drvdata(pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-kempld" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-latch.c +0
-0Quoted 8 lines
drivers/gpio/gpio-latch.c static int gpio_latch_probe(struct platform_device *pdev) · line 197
Quoted 8 lines
drivers/gpio/gpio-latch.c +0
-1@@ -192,8 +192,6 @@ static int gpio_latch_probe(struct platform_device *pdev) priv->gc.base =-1 ; priv->gc.parent = &pdev->dev; >> - platform_set_drvdata(pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->gc, priv); } >> diff --git a/drivers/gpio/gpio-logicvc.c
b/drivers/gpio/gpio-logicvc.cQuoted 11 lines
drivers/gpio/gpio-logicvc.c static int logicvc_gpio_probe(struct platform_device *pdev) · line 144
Quoted 11 lines
index
992cc958a43f..9b4789deae45100644drivers/gpio/gpio-logicvc.c +0
-1@@ -139,8 +139,6 @@ static int logicvc_gpio_probe(struct platform_device *pdev) logicvc->chip.set = logicvc_gpio_set; logicvc->chip.direction_output = logicvc_gpio_direction_output; >> - platform_set_drvdata(pdev, logicvc); -return devm_gpiochip_add_data (dev, &logicvc->chip, logicvc); } >> diff --git a/drivers/gpio/gpio-loongson1.c
b/drivers/gpio/gpio-loongson1.cQuoted 72 lines
Quoted 72 lines
index
5d90b3bc5a25..0ff4ea7af9c0100644drivers/gpio/gpio-loongson1.c +0
-0@@ -72,7 +72,6 @@ static int ls1x_gpio_probe(struct platform_device *pdev)if (ret) goto err; >> - platform_set_drvdata(pdev, gc);dev_info (dev,"Loongson1 GPIO driver registered\n" ); >> return 0;drivers/gpio/gpio-lp3943.c +0
-1@@ -199,8 +199,6 @@ static int lp3943_gpio_probe(struct platform_device *pdev) lp3943_gpio->chip = lp3943_gpio_chip; lp3943_gpio->chip.parent = &pdev->dev; >> - platform_set_drvdata(pdev, lp3943_gpio); -return devm_gpiochip_add_data (&pdev->dev, &lp3943_gpio->chip, lp3943_gpio); }drivers/gpio/gpio-lp873x.c +0
-1@@ -140,8 +140,6 @@ static int lp873x_gpio_probe(struct platform_device *pdev)if (!gpio)return -ENOMEM ; >> - platform_set_drvdata(pdev, gpio); - gpio->lp873 =dev_get_drvdata (pdev->dev.parent); gpio->chip = template_chip; gpio->chip.parent = gpio->lp873->dev;drivers/gpio/gpio-max77620.c +0
-1@@ -331,8 +331,6 @@ static int max77620_gpio_probe(struct platform_device *pdev) girq->init_hw = max77620_gpio_irq_init_hw; girq->threaded = true; >> - platform_set_drvdata(pdev, mgpio); - ret =devm_gpiochip_add_data (&pdev->dev, &mgpio->gpio_chip, mgpio);if (ret <0 ) {dev_err (&pdev->dev,"gpio_init: Failed to add max77620_gpio\n" );drivers/gpio/gpio-mlxbf.c +0
-0@@ -82,7 +82,6 @@ static int mlxbf_gpio_probe(struct platform_device *pdev)return ret; } >> - platform_set_drvdata(pdev, gs);dev_info (&pdev->dev,"registered Mellanox BlueField GPIO" );return 0 ; }drivers/gpio/gpio-mlxbf2.c +0
-1@@ -402,8 +402,6 @@ mlxbf2_gpio_probe(struct platform_device *pdev) } } >> - platform_set_drvdata(pdev, gs); - ret =devm_gpiochip_add_data (dev, &gs->gc, gs);if (ret) {dev_err (dev,"Failed adding memory mapped gpiochip\n" );drivers/gpio/gpio-mmio.c +0
-0Quoted 8 lines
drivers/gpio/gpio-mmio.c static int bgpio_pdev_probe(struct platform_device *pdev) · line 792
Quoted 8 lines
drivers/gpio/gpio-mmio.c +0
-1@@ -787,8 +787,6 @@ static int bgpio_pdev_probe(struct platform_device *pdev) gc->ngpio = pdata->ngpio; } >> - platform_set_drvdata(pdev, gc); -return devm_gpiochip_add_data (&pdev->dev, gc,NULL ); } >> diff --git a/drivers/gpio/gpio-msc313.c
b/drivers/gpio/gpio-msc313.cQuoted 55 lines
Quoted 55 lines
index
b0773e5652fa..0a12948defc0100644drivers/gpio/gpio-msc313.c +0
-1@@ -625,8 +625,6 @@ static int msc313_gpio_probe(struct platform_device *pdev)if (IS_ERR (gpio->base))return PTR_ERR (gpio->base); >> - platform_set_drvdata(pdev, gpio); - gpiochip =devm_kzalloc (dev,sizeof (*gpiochip),GFP_KERNEL );if (!gpiochip)return -ENOMEM ;drivers/gpio/gpio-mt7621.c +0
-1@@ -315,7 +315,6 @@ mediatek_gpio_probe(struct platform_device *pdev)return mtk->gpio_irq; >> mtk->dev = dev; -platform_set_drvdata (pdev, mtk); >> for (i = 0; i < MTK_BANK_CNT; i++) { ret =mediatek_gpio_bank_probe (dev, i);drivers/gpio/gpio-mvebu.c +0
-1@@ -1143,8 +1143,6 @@ static int mvebu_gpio_probe(struct platform_device *pdev)if (!mvchip)return -ENOMEM ; >> - platform_set_drvdata(pdev, mvchip); -if (of_property_read_u32 (pdev->dev.of_node,"ngpios" , &ngpios)) {dev_err (&pdev->dev,"Missing ngpios OF property\n" );return -ENODEV ;drivers/gpio/gpio-mxc.c +0
-1@@ -489,8 +489,6 @@ static int mxc_gpio_probe(struct platform_device *pdev) >> list_add_tail(&port->node, &mxc_gpio_ports); >> - platform_set_drvdata(pdev, port); -return 0 ; >> out_irqdomain_remove:drivers/gpio/gpio-omap.c +0
-2@@ -762,8 +762,6 @@ static struct platform_device omap_mpuio_device = { >> static inline void omap_mpuio_init(struct gpio_bank *bank) { -platform_set_drvdata (&omap_mpuio_device, bank); -if (platform_driver_register (&omap_mpuio_driver) ==0 ) (void )platform_device_register (&omap_mpuio_device); }Quoted 8 lines
drivers/gpio/gpio-omap.c static int omap_gpio_probe(struct platform_device *pdev) · line 1460
Quoted 8 lines
drivers/gpio/gpio-omap.c +0
-1@@ -1457,8 +1455,6 @@ static int omap_gpio_probe(struct platform_device *pdev) } } >> - platform_set_drvdata(pdev, bank); -pm_runtime_enable (dev);pm_runtime_get_sync (dev); >> diff --git a/drivers/gpio/gpio-palmas.c
b/drivers/gpio/gpio-palmas.cQuoted 10 lines
drivers/gpio/gpio-palmas.c static int palmas_gpio_probe(struct platform_device *pdev) · line 189
Quoted 10 lines
index
bac10c2faf56..dd8a287ff6d0100644drivers/gpio/gpio-palmas.c +0
-0@@ -184,7 +184,6 @@ static int palmas_gpio_probe(struct platform_device *pdev)return ret; } >> - platform_set_drvdata(pdev, palmas_gpio);return ret; } >> diff --git a/drivers/gpio/gpio-pmic-eic-sprd.c
b/drivers/gpio/gpio-pmic-eic-sprd.cQuoted 10 lines
drivers/gpio/gpio-pmic-eic-sprd.c static int sprd_pmic_eic_probe(struct platform_device *pdev) · line 368
Quoted 10 lines
index
c3e4d90f6b18..bfb003ccbd99100644drivers/gpio/gpio-pmic-eic-sprd.c +0
-0@@ -363,7 +363,6 @@ static int sprd_pmic_eic_probe(struct platform_device *pdev)return ret; } >> - platform_set_drvdata(pdev, pmic_eic);return 0 ; } >> diff --git a/drivers/gpio/gpio-rc5t583.c
b/drivers/gpio/gpio-rc5t583.cQuoted 26 lines
Quoted 26 lines
index
4fae3ebea790..c34dcadaee36100644drivers/gpio/gpio-rc5t583.c +0
-1@@ -121,8 +121,6 @@ static int rc5t583_gpio_probe(struct platform_device *pdev)if (pdata && pdata->gpio_base) rc5t583_gpio->gpio_chip.base = pdata->gpio_base; >> - platform_set_drvdata(pdev, rc5t583_gpio); -return devm_gpiochip_add_data (&pdev->dev, &rc5t583_gpio->gpio_chip, rc5t583_gpio); }drivers/gpio/gpio-rcar.c +0
-1@@ -513,8 +513,6 @@ static int gpio_rcar_probe(struct platform_device *pdev)if (ret <0 )return ret; >> - platform_set_drvdata(pdev, p); -pm_runtime_enable (dev); >> ret = platform_get_irq(pdev, 0);drivers/gpio/gpio-rda.c +0
-0Quoted 8 lines
drivers/gpio/gpio-rda.c static int rda_gpio_probe(struct platform_device *pdev) · line 268
Quoted 8 lines
drivers/gpio/gpio-rda.c +0
-1@@ -263,8 +263,6 @@ static int rda_gpio_probe(struct platform_device *pdev) girq->parents[0 ] = rda_gpio->irq; } >> - platform_set_drvdata(pdev, rda_gpio); -return devm_gpiochip_add_data (dev, &rda_gpio->chip, rda_gpio); } >> diff --git a/drivers/gpio/gpio-rdc321x.c
b/drivers/gpio/gpio-rdc321x.cQuoted 38 lines
Quoted 38 lines
index
01ed2517e9fd..4d3c6c9adfcd100644drivers/gpio/gpio-rdc321x.c +0
-1@@ -161,8 +161,6 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) rdc321x_gpio_dev->chip.base =0 ; rdc321x_gpio_dev->chip.ngpio = pdata->max_gpios; >> - platform_set_drvdata(pdev, rdc321x_gpio_dev); -/* This might not be, what others (BIOS, bootloader, etc.) wrote to these registers before, but it's a good guess. Still better than just using 0xffffffff. */ drivers/gpio/gpio-sama5d2-piobu.c +0
-0@@ -189,7 +189,6 @@ static int sama5d2_piobu_probe(struct platform_device *pdev)if (!piobu)return -ENOMEM ; >> - platform_set_drvdata(pdev, piobu); piobu->chip.label = pdev->name; piobu->chip.parent = &pdev->dev; piobu->chip.owner = THIS_MODULE,drivers/gpio/gpio-sch.c +0
-1@@ -380,8 +380,6 @@ static int sch_gpio_probe(struct platform_device *pdev)return -ENODEV ; } >> - platform_set_drvdata(pdev, sch); - girq = &sch->chip.irq;gpio_irq_chip_set_chip (girq, &sch_irqchip); girq->num_parents =0 ;drivers/gpio/gpio-sch311x.c +0
-0Quoted 8 lines
drivers/gpio/gpio-sch311x.c static int sch311x_gpio_probe(struct platform_device *pdev) · line 286
Quoted 8 lines
drivers/gpio/gpio-sch311x.c +0
-1@@ -281,8 +281,6 @@ static int sch311x_gpio_probe(struct platform_device *pdev)if (!priv)return -ENOMEM ; >> - platform_set_drvdata(pdev, priv); -for (i =0 ; i <ARRAY_SIZE (priv->blocks); i++) { block = &priv->blocks[i]; >> diff --git a/drivers/gpio/gpio-sifive.c
b/drivers/gpio/gpio-sifive.cQuoted 10 lines
drivers/gpio/gpio-sifive.c static int sifive_gpio_probe(struct platform_device *pdev) · line 261
Quoted 10 lines
index
bc5660f61c57..65d1b6437136100644drivers/gpio/gpio-sifive.c +0
-0@@ -256,7 +256,6 @@ static int sifive_gpio_probe(struct platform_device *pdev) girq->handler = handle_bad_irq; girq->default_type =IRQ_TYPE_NONE ; >> - platform_set_drvdata(pdev, chip);return gpiochip_add_data (&chip->gc, chip); } >> diff --git a/drivers/gpio/gpio-syscon.c
b/drivers/gpio/gpio-syscon.cQuoted 11 lines
drivers/gpio/gpio-syscon.c static int syscon_gpio_probe(struct platform_device *pdev) · line 254
Quoted 11 lines
index
6076937b18e7..afceb7e17ad8100644drivers/gpio/gpio-syscon.c +0
-1@@ -249,8 +249,6 @@ static int syscon_gpio_probe(struct platform_device *pdev) priv->chip.direction_output = syscon_gpio_dir_out; } >> - platform_set_drvdata(pdev, priv); -return devm_gpiochip_add_data (&pdev->dev, &priv->chip, priv); } >> diff --git a/drivers/gpio/gpio-tegra.c
b/drivers/gpio/gpio-tegra.cQuoted 11 lines
drivers/gpio/gpio-tegra.c static int tegra_gpio_probe(struct platform_device *pdev) · line 733
Quoted 11 lines
index
5b265a6fd3c1..8a1731a13b5a100644drivers/gpio/gpio-tegra.c +0
-1@@ -728,8 +728,6 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->gc.ngpio = tgi->bank_count *32 ; tgi->gc.parent = &pdev->dev; >> - platform_set_drvdata(pdev, tgi); -if (tgi->soc->debounce_supported) tgi->gc.set_config = tegra_gpio_set_config; >> diff --git a/drivers/gpio/gpio-timberdale.c
b/drivers/gpio/gpio-timberdale.cQuoted 11 lines
drivers/gpio/gpio-timberdale.c static int timbgpio_probe(struct platform_device *pdev) · line 261
Quoted 11 lines
index
de14949a3fe5..bbd9e9191199100644drivers/gpio/gpio-timberdale.c +0
-1@@ -256,8 +256,6 @@ static int timbgpio_probe(struct platform_device *pdev)if (err)return err; >> - platform_set_drvdata(pdev, tgpio); -/* make sure to disable interrupts */ iowrite32 (0x0 , tgpio->membase +TGPIO_IER ); >> diff --git a/drivers/gpio/gpio-tqmx86.c
b/drivers/gpio/gpio-tqmx86.cQuoted 5 lines
drivers/gpio/gpio-tqmx86.c static int tqmx86_gpio_probe(struct platform_device *pdev) · line 259
Quoted 5 lines
index
e739dcea61b2..f0a2cf4b0679100644drivers/gpio/gpio-tqmx86.c +0
-0@@ -259,8 +259,6 @@ static int tqmx86_gpio_probe(struct platform_device *pdev) >> tqmx86_gpio_write(gpio, (u8)~TQMX86_DIR_INPUT_MASK,
TQMX86_GPIODD);Quoted 8 lines
Quoted 8 lines
drivers/gpio/gpio-tqmx86.c +0
-1>> - platform_set_drvdata(pdev, gpio); - chip = &gpio->chip; chip->label ="gpio-tqmx86" ; chip->owner =THIS_MODULE ;drivers/gpio/gpio-ts4800.c +0
-1--- a/drivers/gpio/gpio-ts4800.cQuoted 8 lines
drivers/gpio/gpio-ts4800.c static int ts4800_gpio_probe(struct platform_device *pdev) · line 56
Quoted 8 lines
+++
b/drivers/gpio/gpio-ts4800.cdrivers/gpio/gpio-ts4800.c +0
-1@@ -52,8 +52,6 @@ static int ts4800_gpio_probe(struct platform_device *pdev) >> chip->ngpio = ngpios; >> - platform_set_drvdata(pdev, chip); -return devm_gpiochip_add_data (&pdev->dev, chip,NULL ); } >> diff --git a/drivers/gpio/gpio-vx855.c
b/drivers/gpio/gpio-vx855.cQuoted 26 lines
Quoted 26 lines
index
69713fd5485b..8fd6c3913d69100644drivers/gpio/gpio-vx855.c +0
-1@@ -240,8 +240,6 @@ static int vx855gpio_probe(struct platform_device *pdev)if (!vg)return -ENOMEM ; >> - platform_set_drvdata(pdev, vg); -dev_info (&pdev->dev,"found VX855 GPIO controller\n" ); vg->io_gpi = res_gpi->start; vg->io_gpo = res_gpo->start;drivers/gpio/gpio-wcove.c +0
-1@@ -433,8 +433,6 @@ static int wcove_gpio_probe(struct platform_device *pdev) >> wg->regmap_irq_chip = pmic->irq_chip_data; >> - platform_set_drvdata(pdev, wg); -mutex_init (&wg->buslock); wg->chip.label =KBUILD_MODNAME ; wg->chip.direction_input = wcove_gpio_dir_in;drivers/gpio/gpio-xgene.c +0
-0Quoted 8 lines
drivers/gpio/gpio-xgene.c static int xgene_gpio_probe(struct platform_device *pdev) · line 185
Quoted 8 lines
drivers/gpio/gpio-xgene.c +0
-1@@ -180,8 +180,6 @@ static int xgene_gpio_probe(struct platform_device *pdev) gpio->chip.label =dev_name (&pdev->dev); gpio->chip.base =-1 ; >> - platform_set_drvdata(pdev, gpio); -return devm_gpiochip_add_data (&pdev->dev, &gpio->chip, gpio); } >> diff --git a/drivers/gpio/gpio-zevio.c
b/drivers/gpio/gpio-zevio.cQuoted 23 lines
Quoted 23 lines
index
f0f571b323f2..2de61337ad3b100644drivers/gpio/gpio-zevio.c +0
-1@@ -176,8 +176,6 @@ static int zevio_gpio_probe(struct platform_device *pdev)if (!controller)return -ENOMEM ; >> - platform_set_drvdata(pdev, controller); -/* Copy our reference */ controller->chip = zevio_gpio_chip; controller->chip.parent = &pdev->dev;drivers/gpio/gpio-zynqmp-modepin.c +0
-1@@ -120,8 +120,6 @@ static int modepin_gpio_probe(struct platform_device *pdev)if (!chip)return -ENOMEM ; >> - platform_set_drvdata(pdev, chip); -/* configure the gpio chip */ chip->base =-1 ; chip->ngpio =MODE_PINS ;
Quoted 6 lines · Lizhe
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functionsSigned-off-by Lizhe <[email protected]>
You have to also ascertain that the data is not used elsewhere like in some callbacks or even in other drivers in some odd cases.
Yours,
Linus Walleij
Quoted 5 lines · Lizhe
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functions
You need to:
1) split the series on per driver basis (not all of the drivers are going thru the same subsystem);
2) improve English grammar and style in your commit message;
3) carefully explain in the cover letter your methods of finding the places you think need to be improved.
Before that it's a waste of time to look at your contributions.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Andy Shevchenko
Quoted 5 lines · Lizhe
platform_set_drvdata()is redundant in these functions. the purpose of calling this function is to place data in*driver_data. but the data is not retrieved in these functionsYou need to:
1) split the series on per driver basis (not all of the drivers are going thru the same subsystem);
s/subsystem/tree/
Quoted 5 lines
2) improve English grammar and style in your commit message;
3) carefully explain in the cover letter your methods of finding the places you think need to be improved.Before that it's a waste of time to look at your contributions.
Signature · 2 lines
With Best Regards, Andy Shevchenko