]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: aggregator: remove the software node when deactivating the aggregator
authorBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Wed, 20 May 2026 12:16:31 +0000 (14:16 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Thu, 21 May 2026 10:01:07 +0000 (12:01 +0200)
The dynamic software node we create for the aggregator platform device
when using configfs is leaked when the device is deactivated. Destroy it
as the last step in the tear-down path.

Fixes: 86f162e73d2d ("gpio: aggregator: introduce basic configfs interface")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdVZ=XUvJTGdDAjnkxgtw7Uvnn61iOy3XN_5XNZM2anctw@mail.gmail.com/
Link: https://patch.msgid.link/20260520121631.33976-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-aggregator.c

index b53230065f50ec20687cd96f354fe15802271b24..a9ad809708fb66587d171699293ac2430e478512 100644 (file)
@@ -991,11 +991,15 @@ err_remove_lookups:
 
 static void gpio_aggregator_deactivate(struct gpio_aggregator *aggr)
 {
+       struct fwnode_handle *swnode;
+
+       swnode = dev_fwnode(&aggr->pdev->dev);
        platform_device_unregister(aggr->pdev);
        aggr->pdev = NULL;
        gpiod_remove_lookup_table(aggr->lookups);
        kfree(aggr->lookups->dev_id);
        kfree(aggr->lookups);
+       fwnode_remove_software_node(swnode);
 }
 
 static void gpio_aggregator_lockup_configfs(struct gpio_aggregator *aggr,