diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-02-23 19:04:40 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-02-29 13:10:56 -0500 |
commit | 3eedb4372354a70ce63c9f4ec294d2eba0d79d17 (patch) | |
tree | cb9159674023e9e38d783978dac0e9678b3eee4c | |
parent | 806d314325812fb8ffe7059bd84a23d334350c21 (diff) |
pinctrl: move pinctrl-maps debugfs file to top-level
The debugfs file pinctrl-maps is a system-wide file, not specific to any
pin controller, so place it in the top-level directory.
Also, move the code implementing the file to keep the order of all the
functions matching the order they're created in pinctrl_init_*debugfs().
The only non-obvious change here is no private data is passed to
debugfs_create_file() or single_open().
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/core.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 633b97e5ff6e..376cede29662 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -889,28 +889,6 @@ static int pinctrl_gpioranges_show(struct seq_file *s, void *what) | |||
889 | return 0; | 889 | return 0; |
890 | } | 890 | } |
891 | 891 | ||
892 | static int pinctrl_maps_show(struct seq_file *s, void *what) | ||
893 | { | ||
894 | struct pinctrl_maps *maps_node; | ||
895 | int i; | ||
896 | struct pinctrl_map const *map; | ||
897 | |||
898 | seq_puts(s, "Pinctrl maps:\n"); | ||
899 | |||
900 | mutex_lock(&pinctrl_maps_mutex); | ||
901 | for_each_maps(maps_node, i, map) { | ||
902 | seq_printf(s, "%s:\n", map->name); | ||
903 | seq_printf(s, " device: %s\n", map->dev_name); | ||
904 | seq_printf(s, " controlling device %s\n", map->ctrl_dev_name); | ||
905 | seq_printf(s, " function: %s\n", map->function); | ||
906 | seq_printf(s, " group: %s\n", map->group ? map->group : | ||
907 | "(default)"); | ||
908 | } | ||
909 | mutex_unlock(&pinctrl_maps_mutex); | ||
910 | |||
911 | return 0; | ||
912 | } | ||
913 | |||
914 | static int pinmux_hogs_show(struct seq_file *s, void *what) | 892 | static int pinmux_hogs_show(struct seq_file *s, void *what) |
915 | { | 893 | { |
916 | struct pinctrl_dev *pctldev = s->private; | 894 | struct pinctrl_dev *pctldev = s->private; |
@@ -947,6 +925,28 @@ static int pinctrl_devices_show(struct seq_file *s, void *what) | |||
947 | return 0; | 925 | return 0; |
948 | } | 926 | } |
949 | 927 | ||
928 | static int pinctrl_maps_show(struct seq_file *s, void *what) | ||
929 | { | ||
930 | struct pinctrl_maps *maps_node; | ||
931 | int i; | ||
932 | struct pinctrl_map const *map; | ||
933 | |||
934 | seq_puts(s, "Pinctrl maps:\n"); | ||
935 | |||
936 | mutex_lock(&pinctrl_maps_mutex); | ||
937 | for_each_maps(maps_node, i, map) { | ||
938 | seq_printf(s, "%s:\n", map->name); | ||
939 | seq_printf(s, " device: %s\n", map->dev_name); | ||
940 | seq_printf(s, " controlling device %s\n", map->ctrl_dev_name); | ||
941 | seq_printf(s, " function: %s\n", map->function); | ||
942 | seq_printf(s, " group: %s\n", map->group ? map->group : | ||
943 | "(default)"); | ||
944 | } | ||
945 | mutex_unlock(&pinctrl_maps_mutex); | ||
946 | |||
947 | return 0; | ||
948 | } | ||
949 | |||
950 | static int pinctrl_show(struct seq_file *s, void *what) | 950 | static int pinctrl_show(struct seq_file *s, void *what) |
951 | { | 951 | { |
952 | struct pinctrl *p; | 952 | struct pinctrl *p; |
@@ -988,11 +988,6 @@ static int pinctrl_gpioranges_open(struct inode *inode, struct file *file) | |||
988 | return single_open(file, pinctrl_gpioranges_show, inode->i_private); | 988 | return single_open(file, pinctrl_gpioranges_show, inode->i_private); |
989 | } | 989 | } |
990 | 990 | ||
991 | static int pinctrl_maps_open(struct inode *inode, struct file *file) | ||
992 | { | ||
993 | return single_open(file, pinctrl_maps_show, inode->i_private); | ||
994 | } | ||
995 | |||
996 | static int pinmux_hogs_open(struct inode *inode, struct file *file) | 991 | static int pinmux_hogs_open(struct inode *inode, struct file *file) |
997 | { | 992 | { |
998 | return single_open(file, pinmux_hogs_show, inode->i_private); | 993 | return single_open(file, pinmux_hogs_show, inode->i_private); |
@@ -1003,6 +998,11 @@ static int pinctrl_devices_open(struct inode *inode, struct file *file) | |||
1003 | return single_open(file, pinctrl_devices_show, NULL); | 998 | return single_open(file, pinctrl_devices_show, NULL); |
1004 | } | 999 | } |
1005 | 1000 | ||
1001 | static int pinctrl_maps_open(struct inode *inode, struct file *file) | ||
1002 | { | ||
1003 | return single_open(file, pinctrl_maps_show, NULL); | ||
1004 | } | ||
1005 | |||
1006 | static int pinctrl_open(struct inode *inode, struct file *file) | 1006 | static int pinctrl_open(struct inode *inode, struct file *file) |
1007 | { | 1007 | { |
1008 | return single_open(file, pinctrl_show, NULL); | 1008 | return single_open(file, pinctrl_show, NULL); |
@@ -1029,22 +1029,22 @@ static const struct file_operations pinctrl_gpioranges_ops = { | |||
1029 | .release = single_release, | 1029 | .release = single_release, |
1030 | }; | 1030 | }; |
1031 | 1031 | ||
1032 | static const struct file_operations pinctrl_maps_ops = { | 1032 | static const struct file_operations pinmux_hogs_ops = { |
1033 | .open = pinctrl_maps_open, | 1033 | .open = pinmux_hogs_open, |
1034 | .read = seq_read, | 1034 | .read = seq_read, |
1035 | .llseek = seq_lseek, | 1035 | .llseek = seq_lseek, |
1036 | .release = single_release, | 1036 | .release = single_release, |
1037 | }; | 1037 | }; |
1038 | 1038 | ||
1039 | static const struct file_operations pinmux_hogs_ops = { | 1039 | static const struct file_operations pinctrl_devices_ops = { |
1040 | .open = pinmux_hogs_open, | 1040 | .open = pinctrl_devices_open, |
1041 | .read = seq_read, | 1041 | .read = seq_read, |
1042 | .llseek = seq_lseek, | 1042 | .llseek = seq_lseek, |
1043 | .release = single_release, | 1043 | .release = single_release, |
1044 | }; | 1044 | }; |
1045 | 1045 | ||
1046 | static const struct file_operations pinctrl_devices_ops = { | 1046 | static const struct file_operations pinctrl_maps_ops = { |
1047 | .open = pinctrl_devices_open, | 1047 | .open = pinctrl_maps_open, |
1048 | .read = seq_read, | 1048 | .read = seq_read, |
1049 | .llseek = seq_lseek, | 1049 | .llseek = seq_lseek, |
1050 | .release = single_release, | 1050 | .release = single_release, |
@@ -1078,8 +1078,6 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) | |||
1078 | device_root, pctldev, &pinctrl_groups_ops); | 1078 | device_root, pctldev, &pinctrl_groups_ops); |
1079 | debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, | 1079 | debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, |
1080 | device_root, pctldev, &pinctrl_gpioranges_ops); | 1080 | device_root, pctldev, &pinctrl_gpioranges_ops); |
1081 | debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, | ||
1082 | device_root, pctldev, &pinctrl_maps_ops); | ||
1083 | debugfs_create_file("pinmux-hogs", S_IFREG | S_IRUGO, | 1081 | debugfs_create_file("pinmux-hogs", S_IFREG | S_IRUGO, |
1084 | device_root, pctldev, &pinmux_hogs_ops); | 1082 | device_root, pctldev, &pinmux_hogs_ops); |
1085 | pinmux_init_device_debugfs(device_root, pctldev); | 1083 | pinmux_init_device_debugfs(device_root, pctldev); |
@@ -1102,6 +1100,8 @@ static void pinctrl_init_debugfs(void) | |||
1102 | 1100 | ||
1103 | debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, | 1101 | debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, |
1104 | debugfs_root, NULL, &pinctrl_devices_ops); | 1102 | debugfs_root, NULL, &pinctrl_devices_ops); |
1103 | debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, | ||
1104 | debugfs_root, NULL, &pinctrl_maps_ops); | ||
1105 | debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, | 1105 | debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, |
1106 | debugfs_root, NULL, &pinctrl_ops); | 1106 | debugfs_root, NULL, &pinctrl_ops); |
1107 | } | 1107 | } |