linux-stable/drivers/gpio
Bartosz Golaszewski 3386fb86ec gpiolib: fix reference leaks when removing GPIO chips still in use
After we remove a GPIO chip that still has some requested descriptors,
gpiod_free_commit() will fail and we will never put the references to the
GPIO device and the owning module in gpiod_free().

Rework this function to:
- not warn on desc == NULL as this is a use-case on which most free
  functions silently return
- put the references to desc->gdev and desc->gdev->owner unconditionally
  so that the release callback actually gets called when the remaining
  references are dropped by external GPIO users

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2023-08-16 13:35:50 +02:00
..
gpio-74x164.c
gpio-74xx-mmio.c
gpio-104-dio-48e.c regmap-irq: Drop map from handle_mask_sync() parameters 2023-05-08 08:50:02 +09:00
gpio-104-idi-48.c gpio: 104-idi-48: Enable use_raw_spinlock for idi48_regmap_config 2023-04-11 21:08:31 +02:00
gpio-104-idio-16.c
gpio-adnp.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-adp5520.c
gpio-aggregator.c gpio: aggregator: Set up a parser of delay line parameters 2023-06-16 11:02:07 +02:00
gpio-altera-a10sr.c
gpio-altera.c gpio: altera: drop of_match_ptr for ID table 2023-03-15 10:38:03 +01:00
gpio-amd-fch.c
gpio-amd8111.c
gpio-amdpt.c
gpio-arizona.c
gpio-aspeed-sgpio.c gpio: aspeed-sgpio: Convert to immutable irq_chip 2023-03-10 16:17:20 +01:00
gpio-aspeed.c gpio: aspeed: Convert to immutable irq_chip 2023-03-10 16:17:19 +01:00
gpio-ath79.c gpio: ath79: Convert to immutable irq_chip 2023-03-10 16:17:23 +01:00
gpio-bcm-kona.c
gpio-bd9571mwv.c
gpio-bd71815.c
gpio-bd71828.c
gpio-brcmstb.c gpio: brcmstb: Use devm_platform_get_and_ioremap_resource() 2023-05-23 10:23:46 +02:00
gpio-bt8xx.c
gpio-cadence.c gpio: cadence: Convert to immutable irq_chip 2023-03-10 16:17:24 +01:00
gpio-clps711x.c
gpio-creg-snps.c
gpio-crystalcove.c
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: make davinci_gpio_dev_pm_ops static 2023-06-13 11:45:06 +02:00
gpio-dln2.c
gpio-dwapb.c
gpio-eic-sprd.c gpio: eic-sprd: Make the irqchip immutable 2022-12-30 16:57:27 +01:00
gpio-elkhartlake.c gpio: elkhartlake: Introduce Intel Elkhart Lake PSE GPIO 2023-03-06 17:10:46 +02:00
gpio-em.c
gpio-en7523.c
gpio-ep93xx.c gpio: ep93xx: remove unused variable 2023-01-27 14:05:38 +01:00
gpio-exar.c
gpio-f7188x.c gpio-f7188x: fix chip name and pin count on Nuvoton chip 2023-05-23 10:47:41 +02:00
gpio-ftgpio010.c gpio: ftgpio010: drop of_match_ptr for ID table 2023-03-15 10:37:56 +01:00
gpio-fxl6408.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-ge.c gpio: ge: Remove duplicate assignment of of_gpio_n_cells 2023-01-30 15:55:30 +01:00
gpio-gpio-mm.c gpio: gpio-mm: Migrate to regmap API 2023-01-30 15:55:28 +01:00
gpio-grgpio.c
gpio-gw-pld.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-hisi.c gpio: hisi: Convert to immutable irq_chip 2023-03-10 16:17:27 +01:00
gpio-hlwd.c gpio: hlwd: Convert to immutable irq_chip 2023-03-10 16:17:29 +01:00
gpio-htc-egpio.c
gpio-i8255.c gpio: i8255: Remove unused legacy interface 2023-01-30 15:55:28 +01:00
gpio-i8255.h gpio: i8255: Remove unused legacy interface 2023-01-30 15:55:28 +01:00
gpio-ich.c gpio: ich: Use devm_gpiochip_add_data() to simplify remove path 2023-03-09 16:08:39 +02:00
gpio-idio-16.c
gpio-idio-16.h
gpio-idt3243x.c gpio: idt3243x: Convert to immutable irq_chip 2023-03-10 16:17:30 +01:00
gpio-imx-scu.c gpio: remove MODULE_LICENSE in non-modules 2023-03-06 10:47:22 +01:00
gpio-it87.c
gpio-ixp4xx.c gpio: ixp4xx: Use devm_platform_ioremap_resource() 2023-05-11 11:07:51 +02:00
gpio-janz-ttl.c
gpio-kempld.c
gpio-latch.c
gpio-ljca.c gpio: Add support for Intel LJCA USB GPIO driver 2023-04-26 11:40:29 +01:00
gpio-logicvc.c
gpio-loongson-64bit.c gpio: loongson: Remove unnecessary .owner 2023-03-10 16:27:28 +01:00
gpio-loongson.c
gpio-loongson1.c gpio: loongson1: Add DT support 2023-03-23 14:31:18 +01:00
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c
gpio-lpc18xx.c gpio: lpc18xx: Remove unused of_gpio.h inclusion 2023-06-19 14:45:29 +02:00
gpio-lpc32xx.c
gpio-madera.c
gpio-max730x.c
gpio-max732x.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-max3191x.c
gpio-max7300.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-max7301.c
gpio-max77620.c
gpio-max77650.c
gpio-mb86s7x.c
gpio-mc33880.c
gpio-menz127.c
gpio-merrifield.c gpio: merrifield: Utilise temporary variable for struct device 2023-03-06 17:10:46 +02:00
gpio-ml-ioh.c
gpio-mlxbf.c
gpio-mlxbf2.c gpio: mlxbf2: Convert to immutable irq_chip 2023-03-10 16:17:32 +01:00
gpio-mlxbf3.c gpio: mlxbf3: Add gpio driver support 2023-06-16 11:08:32 +02:00
gpio-mm-lantiq.c gpio: mm-lantiq: Fix typo in the newly added header filename 2023-03-23 16:22:18 +02:00
gpio-mmio.c
gpio-mockup.c gpio: mockup: Fix mode of debugfs files 2023-05-17 11:19:32 +02:00
gpio-moxtet.c
gpio-mpc8xxx.c gpio: mpc8xxx: Remove unused of_gpio.h inclusion 2023-06-19 14:45:15 +02:00
gpio-mpc5200.c gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h 2023-03-06 12:33:01 +02:00
gpio-msc313.c gpio: msc313: Convert to immutable irq_chip 2023-03-10 16:17:31 +01:00
gpio-mt7621.c
gpio-mvebu.c gpio: mvebu: fix irq domain leak 2023-07-20 14:38:36 +02:00
gpio-mxc.c gpio: mxc: Unlock on error path in mxc_flip_edge() 2023-01-25 13:33:29 +01:00
gpio-mxs.c gpio: remove MODULE_LICENSE in non-modules 2023-03-06 10:47:22 +01:00
gpio-octeon.c
gpio-omap.c gpio: omap: Convert to immutable irq_chip 2023-03-10 16:17:35 +01:00
gpio-palmas.c
gpio-pca953x.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-pca9570.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-pcf857x.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-pch.c
gpio-pci-idio-16.c gpio: pci-idio-16: Convert to immutable irq_chip 2023-03-10 16:17:36 +01:00
gpio-pcie-idio-24.c gpio: pcie-idio-24: Prune superfluous license boilerplate 2023-03-15 13:40:10 +01:00
gpio-pisosr.c
gpio-pl061.c
gpio-pmic-eic-sprd.c gpio: pmic-eic-sprd: Make the irqchip immutable 2022-12-30 16:58:58 +01:00
gpio-pxa.c gpio: pxa: remove unused gpio_is_pxa_type function 2023-03-22 17:46:12 +01:00
gpio-raspberrypi-exp.c gpio: raspberrypi-exp: mark OF related data as maybe unused 2023-03-15 10:38:39 +01:00
gpio-rc5t583.c
gpio-rcar.c gpio: rcar: drop of_match_ptr for ID table 2023-03-15 10:38:05 +01:00
gpio-rda.c gpio: rda: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-rdc321x.c
gpio-realtek-otto.c
gpio-reg.c gpio: reg: Add missing header(s) 2023-03-06 12:33:02 +02:00
gpio-regmap.c gpio: regmap: Add missing header(s) 2023-03-06 12:33:02 +02:00
gpio-rockchip.c gpio: rockchip: Do not mention legacy API in the code 2023-01-30 15:55:30 +01:00
gpio-sa1100.c gpio: sa1100: include <mach/generic.h> 2023-05-17 11:56:24 +02:00
gpio-sama5d2-piobu.c gpio: sama5d2-piobu: drop of_match_ptr for ID table 2023-03-15 10:38:16 +01:00
gpio-sch.c
gpio-sch311x.c gpio: sch311x: Use devm_gpiochip_add_data() to simplify remove path 2023-05-17 11:52:14 +02:00
gpio-sifive.c gpio: sifive: add missing check for platform_get_irq 2023-06-13 16:22:16 +02:00
gpio-sim.c gpio: sim: mark the GPIO chip as a one that can sleep 2023-08-03 15:50:35 +02:00
gpio-siox.c gpio: siox: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-sl28cpld.c
gpio-sodaville.c
gpio-spear-spics.c
gpio-sprd.c gpio: sprd: Make the irqchip immutable 2022-12-30 16:59:06 +01:00
gpio-stmpe.c gpio: stmpe: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-stp-xway.c gpio: Use of_property_read_bool() for boolean properties 2023-03-15 10:43:08 +01:00
gpio-syscon.c
gpio-tangier.c gpio: tangier: calculate number of ctx using temporary variable 2023-05-23 10:22:25 +02:00
gpio-tangier.h gpio: elkhartlake: Introduce Intel Elkhart Lake PSE GPIO 2023-03-06 17:10:46 +02:00
gpio-tb10x.c gpio: Use of_property_read_bool() for boolean properties 2023-03-15 10:43:08 +01:00
gpio-tc3589x.c
gpio-tegra.c
gpio-tegra186.c Pin control changes for the v6.5 kernel cycle: 2023-06-30 14:57:19 -07:00
gpio-thunderx.c gpio: thunderx: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-timberdale.c
gpio-tn48m.c
gpio-tpic2810.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-tps6586x.c
gpio-tps65086.c gpio: tps65086: Use devm_gpiochip_add_data() to simplify remove path 2023-05-17 11:40:40 +02:00
gpio-tps65218.c
gpio-tps65219.c gpio: tps65219: add GPIO support for TPS65219 PMIC 2023-06-13 14:49:56 +02:00
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c gpio: tps68470: Make tps68470_gpio_output() always set the initial value 2023-07-19 13:22:13 +02:00
gpio-tqmx86.c gpio: tqmx86: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-ts4800.c
gpio-ts4900.c gpio: Switch i2c drivers back to use .probe() 2023-05-23 10:09:11 +02:00
gpio-ts5500.c
gpio-twl4030.c This removes all usage of global GPIO numbers from 2023-05-31 17:01:34 +02:00
gpio-twl6040.c
gpio-uniphier.c
gpio-vf610.c gpio updates for v6.3 2023-02-22 11:01:17 -08:00
gpio-viperboard.c
gpio-virtio.c
gpio-visconti.c gpio: visconti: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-vx855.c
gpio-wcd934x.c gpio: wcd934x: Remove duplicate assignment of of_gpio_n_cells 2023-01-30 15:55:30 +01:00
gpio-wcove.c
gpio-winbond.c
gpio-wm831x.c
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent 2023-08-11 21:31:59 +02:00
gpio-xgene-sb.c
gpio-xgene.c
gpio-xgs-iproc.c gpio: xgs-iproc: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-xilinx.c gpio: xilinx: Convert to immutable irq_chip 2023-03-23 14:31:18 +01:00
gpio-xlp.c gpio: xlp: Convert to immutable irq_chip 2023-03-23 14:31:19 +01:00
gpio-xra1403.c gpio: xra1403: Remove unused of_gpio.h inclusion 2023-06-19 14:45:21 +02:00
gpio-xtensa.c
gpio-zevio.c gpio: zevio: Add missing header 2023-01-30 15:55:31 +01:00
gpio-zynq.c gpio: synq: remove unused zynq_gpio_irq_reqres/zynq_gpio_irq_relres 2023-06-19 14:50:28 +02:00
gpio-zynqmp-modepin.c
gpiolib-acpi.c gpio updates for v6.4-rc1 2023-04-25 17:18:18 -07:00
gpiolib-acpi.h gpiolib: Clean up headers 2023-03-06 12:33:02 +02:00
gpiolib-cdev.c gpiolib: Introduce gpio_device_get() and gpio_device_put() 2023-01-30 15:55:29 +01:00
gpiolib-cdev.h
gpiolib-devres.c gpiolib: of: remove [devm_]gpiod_get_from_of_node() APIs 2023-01-30 15:55:28 +01:00
gpiolib-legacy.c gpiolib: Kill unused GPIOF_OPEN_* 2023-06-01 09:52:39 +02:00
gpiolib-of.c gpiolib: Clean up headers 2023-03-06 12:33:02 +02:00
gpiolib-of.h gpiolib: Clean up headers 2023-03-06 12:33:02 +02:00
gpiolib-swnode.c gpiolib: Clean up headers 2023-03-06 12:33:02 +02:00
gpiolib-swnode.h
gpiolib-sysfs.c gpiolib: sysfs: Do unexport GPIO when user asks for it 2023-08-16 13:34:31 +02:00
gpiolib-sysfs.h
gpiolib.c gpiolib: fix reference leaks when removing GPIO chips still in use 2023-08-16 13:35:50 +02:00
gpiolib.h gpiolib: Introduce gpio_device_get() and gpio_device_put() 2023-01-30 15:55:29 +01:00
Kconfig gpio updates for v6.5 2023-06-29 10:11:10 -07:00
Makefile gpio: mlxbf3: Add gpio driver support 2023-06-16 11:08:32 +02:00
TODO gpiolib: split of_mm_gpio_chip out of linux/of_gpio.h 2023-03-06 12:33:01 +02:00