diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-30 20:34:21 -0400 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:13 -0400 |
| commit | 21ba37c9cf2f2dcadaabd79dff384537124d216c (patch) | |
| tree | 12eb63599044c0a6807a215dbc8e5f31a96e3999 /drivers/message | |
| parent | 685e55eb5192ac05085a8e486fcfa5849a0dd60c (diff) | |
i2o: use proc_remove_subtree()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/message')
| -rw-r--r-- | drivers/message/i2o/i2o_proc.c | 51 |
1 files changed, 1 insertions, 50 deletions
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index 8001aa6bfb48..15c1e480c0dd 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c | |||
| @@ -1895,25 +1895,6 @@ static int i2o_proc_create_entries(struct proc_dir_entry *dir, | |||
| 1895 | } | 1895 | } |
| 1896 | 1896 | ||
| 1897 | /** | 1897 | /** |
| 1898 | * i2o_proc_subdir_remove - Remove child entries from a proc entry | ||
| 1899 | * @dir: proc dir entry from which the childs should be removed | ||
| 1900 | * | ||
| 1901 | * Iterate over each i2o proc entry under dir and remove it. If the child | ||
| 1902 | * also has entries, remove them too. | ||
| 1903 | */ | ||
| 1904 | static void i2o_proc_subdir_remove(struct proc_dir_entry *dir) | ||
| 1905 | { | ||
| 1906 | struct proc_dir_entry *pe, *tmp; | ||
| 1907 | pe = dir->subdir; | ||
| 1908 | while (pe) { | ||
| 1909 | tmp = pe->next; | ||
| 1910 | i2o_proc_subdir_remove(pe); | ||
| 1911 | remove_proc_entry(pe->name, dir); | ||
| 1912 | pe = tmp; | ||
| 1913 | } | ||
| 1914 | }; | ||
| 1915 | |||
| 1916 | /** | ||
| 1917 | * i2o_proc_device_add - Add an I2O device to the proc dir | 1898 | * i2o_proc_device_add - Add an I2O device to the proc dir |
| 1918 | * @dir: proc dir entry to which the device should be added | 1899 | * @dir: proc dir entry to which the device should be added |
| 1919 | * @dev: I2O device which should be added | 1900 | * @dev: I2O device which should be added |
| @@ -1988,31 +1969,6 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir, | |||
| 1988 | } | 1969 | } |
| 1989 | 1970 | ||
| 1990 | /** | 1971 | /** |
| 1991 | * i2o_proc_iop_remove - Removes an I2O controller from the i2o proc tree | ||
| 1992 | * @dir: parent proc dir entry | ||
| 1993 | * @c: I2O controller which should be removed | ||
| 1994 | * | ||
| 1995 | * Iterate over each i2o proc entry and search controller c. If it is found | ||
| 1996 | * remove it from the tree. | ||
| 1997 | */ | ||
| 1998 | static void i2o_proc_iop_remove(struct proc_dir_entry *dir, | ||
| 1999 | struct i2o_controller *c) | ||
| 2000 | { | ||
| 2001 | struct proc_dir_entry *pe, *tmp; | ||
| 2002 | |||
| 2003 | pe = dir->subdir; | ||
| 2004 | while (pe) { | ||
| 2005 | tmp = pe->next; | ||
| 2006 | if (pe->data == c) { | ||
| 2007 | i2o_proc_subdir_remove(pe); | ||
| 2008 | remove_proc_entry(pe->name, dir); | ||
| 2009 | } | ||
| 2010 | osm_debug("removing IOP /proc/i2o/%s\n", c->name); | ||
| 2011 | pe = tmp; | ||
| 2012 | } | ||
| 2013 | } | ||
| 2014 | |||
| 2015 | /** | ||
| 2016 | * i2o_proc_fs_create - Create the i2o proc fs. | 1972 | * i2o_proc_fs_create - Create the i2o proc fs. |
| 2017 | * | 1973 | * |
| 2018 | * Iterate over each I2O controller and create the entries for it. | 1974 | * Iterate over each I2O controller and create the entries for it. |
| @@ -2042,12 +1998,7 @@ static int __init i2o_proc_fs_create(void) | |||
| 2042 | */ | 1998 | */ |
| 2043 | static int __exit i2o_proc_fs_destroy(void) | 1999 | static int __exit i2o_proc_fs_destroy(void) |
| 2044 | { | 2000 | { |
| 2045 | struct i2o_controller *c; | 2001 | remove_proc_subtree("i2o", NULL); |
| 2046 | |||
| 2047 | list_for_each_entry(c, &i2o_controllers, list) | ||
| 2048 | i2o_proc_iop_remove(i2o_proc_dir_root, c); | ||
| 2049 | |||
| 2050 | remove_proc_entry("i2o", NULL); | ||
| 2051 | 2002 | ||
| 2052 | return 0; | 2003 | return 0; |
| 2053 | }; | 2004 | }; |
