Commit 303e6da9 authored by Wei Yongjun's avatar Wei Yongjun Committed by Bartosz Golaszewski

gpio: mockup: remove gpio debugfs when remove device

GPIO mockup debugfs is created in gpio_mockup_probe() but
forgot to remove when remove device. This patch add a devm
managed callback for removing them.
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent 3f4e432f
...@@ -373,6 +373,13 @@ static void gpio_mockup_debugfs_setup(struct device *dev, ...@@ -373,6 +373,13 @@ static void gpio_mockup_debugfs_setup(struct device *dev,
} }
} }
static void gpio_mockup_debugfs_cleanup(void *data)
{
struct gpio_mockup_chip *chip = data;
debugfs_remove_recursive(chip->dbg_dir);
}
static void gpio_mockup_dispose_mappings(void *data) static void gpio_mockup_dispose_mappings(void *data)
{ {
struct gpio_mockup_chip *chip = data; struct gpio_mockup_chip *chip = data;
...@@ -455,7 +462,7 @@ static int gpio_mockup_probe(struct platform_device *pdev) ...@@ -455,7 +462,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
gpio_mockup_debugfs_setup(dev, chip); gpio_mockup_debugfs_setup(dev, chip);
return 0; return devm_add_action_or_reset(dev, gpio_mockup_debugfs_cleanup, chip);
} }
static const struct of_device_id gpio_mockup_of_match[] = { static const struct of_device_id gpio_mockup_of_match[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment