diff options
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r-- | drivers/pinctrl/core.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 569bdb3ef104..d9d35fcbfc6b 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -510,10 +510,12 @@ static struct dentry *debugfs_root; | |||
510 | 510 | ||
511 | static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) | 511 | static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) |
512 | { | 512 | { |
513 | static struct dentry *device_root; | 513 | struct dentry *device_root; |
514 | 514 | ||
515 | device_root = debugfs_create_dir(dev_name(pctldev->dev), | 515 | device_root = debugfs_create_dir(dev_name(pctldev->dev), |
516 | debugfs_root); | 516 | debugfs_root); |
517 | pctldev->device_root = device_root; | ||
518 | |||
517 | if (IS_ERR(device_root) || !device_root) { | 519 | if (IS_ERR(device_root) || !device_root) { |
518 | pr_warn("failed to create debugfs directory for %s\n", | 520 | pr_warn("failed to create debugfs directory for %s\n", |
519 | dev_name(pctldev->dev)); | 521 | dev_name(pctldev->dev)); |
@@ -529,6 +531,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) | |||
529 | pinconf_init_device_debugfs(device_root, pctldev); | 531 | pinconf_init_device_debugfs(device_root, pctldev); |
530 | } | 532 | } |
531 | 533 | ||
534 | static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) | ||
535 | { | ||
536 | debugfs_remove_recursive(pctldev->device_root); | ||
537 | } | ||
538 | |||
532 | static void pinctrl_init_debugfs(void) | 539 | static void pinctrl_init_debugfs(void) |
533 | { | 540 | { |
534 | debugfs_root = debugfs_create_dir("pinctrl", NULL); | 541 | debugfs_root = debugfs_create_dir("pinctrl", NULL); |
@@ -553,6 +560,10 @@ static void pinctrl_init_debugfs(void) | |||
553 | { | 560 | { |
554 | } | 561 | } |
555 | 562 | ||
563 | static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev) | ||
564 | { | ||
565 | } | ||
566 | |||
556 | #endif | 567 | #endif |
557 | 568 | ||
558 | /** | 569 | /** |
@@ -641,6 +652,7 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev) | |||
641 | if (pctldev == NULL) | 652 | if (pctldev == NULL) |
642 | return; | 653 | return; |
643 | 654 | ||
655 | pinctrl_remove_device_debugfs(pctldev); | ||
644 | pinmux_unhog_maps(pctldev); | 656 | pinmux_unhog_maps(pctldev); |
645 | /* TODO: check that no pinmuxes are still active? */ | 657 | /* TODO: check that no pinmuxes are still active? */ |
646 | mutex_lock(&pinctrldev_list_mutex); | 658 | mutex_lock(&pinctrldev_list_mutex); |