aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-01 20:51:54 -0400
commit20b4fb485227404329e41ad15588afad3df23050 (patch)
treef3e099f0ab3da8a93b447203e294d2bb22f6dc05 /drivers/message
parentb9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff)
parentac3e3c5b1164397656df81b9e9ab4991184d3236 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro, Misc cleanups all over the place, mainly wrt /proc interfaces (switch create_proc_entry to proc_create(), get rid of the deprecated create_proc_read_entry() in favor of using proc_create_data() and seq_file etc). 7kloc removed. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits) don't bother with deferred freeing of fdtables proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h proc: Make the PROC_I() and PDE() macros internal to procfs proc: Supply a function to remove a proc entry by PDE take cgroup_open() and cpuset_open() to fs/proc/base.c ppc: Clean up scanlog ppc: Clean up rtas_flash driver somewhat hostap: proc: Use remove_proc_subtree() drm: proc: Use remove_proc_subtree() drm: proc: Use minor->index to label things, not PDE->name drm: Constify drm_proc_list[] zoran: Don't print proc_dir_entry data in debug reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show() proc: Supply an accessor for getting the data from a PDE's parent airo: Use remove_proc_subtree() rtl8192u: Don't need to save device proc dir PDE rtl8187se: Use a dir under /proc/net/r8180/ proc: Add proc_mkdir_data() proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h} proc: Move PDE_NET() to fs/proc/proc_net.c ...
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptbase.c4
-rw-r--r--drivers/message/fusion/mptctl.c8
-rw-r--r--drivers/message/fusion/mptfc.c2
-rw-r--r--drivers/message/fusion/mptsas.c2
-rw-r--r--drivers/message/fusion/mptscsih.c98
-rw-r--r--drivers/message/fusion/mptscsih.h2
-rw-r--r--drivers/message/fusion/mptspi.c2
-rw-r--r--drivers/message/i2o/i2o_proc.c97
8 files changed, 35 insertions, 180 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index fb69baa06ca8..767ff4d839f4 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -6656,7 +6656,7 @@ static int mpt_summary_proc_show(struct seq_file *m, void *v)
6656 6656
6657static int mpt_summary_proc_open(struct inode *inode, struct file *file) 6657static int mpt_summary_proc_open(struct inode *inode, struct file *file)
6658{ 6658{
6659 return single_open(file, mpt_summary_proc_show, PDE(inode)->data); 6659 return single_open(file, mpt_summary_proc_show, PDE_DATA(inode));
6660} 6660}
6661 6661
6662static const struct file_operations mpt_summary_proc_fops = { 6662static const struct file_operations mpt_summary_proc_fops = {
@@ -6805,7 +6805,7 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v)
6805 6805
6806static int mpt_iocinfo_proc_open(struct inode *inode, struct file *file) 6806static int mpt_iocinfo_proc_open(struct inode *inode, struct file *file)
6807{ 6807{
6808 return single_open(file, mpt_iocinfo_proc_show, PDE(inode)->data); 6808 return single_open(file, mpt_iocinfo_proc_show, PDE_DATA(inode));
6809} 6809}
6810 6810
6811static const struct file_operations mpt_iocinfo_proc_fops = { 6811static const struct file_operations mpt_iocinfo_proc_fops = {
diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
index b383b6961e59..dcc8385adeb3 100644
--- a/drivers/message/fusion/mptctl.c
+++ b/drivers/message/fusion/mptctl.c
@@ -597,13 +597,6 @@ mptctl_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
597} 597}
598 598
599static int 599static int
600mptctl_release(struct inode *inode, struct file *filep)
601{
602 fasync_helper(-1, filep, 0, &async_queue);
603 return 0;
604}
605
606static int
607mptctl_fasync(int fd, struct file *filep, int mode) 600mptctl_fasync(int fd, struct file *filep, int mode)
608{ 601{
609 MPT_ADAPTER *ioc; 602 MPT_ADAPTER *ioc;
@@ -2822,7 +2815,6 @@ static const struct file_operations mptctl_fops = {
2822 .llseek = no_llseek, 2815 .llseek = no_llseek,
2823 .fasync = mptctl_fasync, 2816 .fasync = mptctl_fasync,
2824 .unlocked_ioctl = mptctl_ioctl, 2817 .unlocked_ioctl = mptctl_ioctl,
2825 .release = mptctl_release,
2826#ifdef CONFIG_COMPAT 2818#ifdef CONFIG_COMPAT
2827 .compat_ioctl = compat_mpctl_ioctl, 2819 .compat_ioctl = compat_mpctl_ioctl,
2828#endif 2820#endif
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index c13cd9bc590b..fd75108c355e 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -109,7 +109,7 @@ static int mptfc_host_reset(struct scsi_cmnd *SCpnt);
109static struct scsi_host_template mptfc_driver_template = { 109static struct scsi_host_template mptfc_driver_template = {
110 .module = THIS_MODULE, 110 .module = THIS_MODULE,
111 .proc_name = "mptfc", 111 .proc_name = "mptfc",
112 .proc_info = mptscsih_proc_info, 112 .show_info = mptscsih_show_info,
113 .name = "MPT FC Host", 113 .name = "MPT FC Host",
114 .info = mptscsih_info, 114 .info = mptscsih_info,
115 .queuecommand = mptfc_qcmd, 115 .queuecommand = mptfc_qcmd,
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index fa43c391c8ed..ffee6f781e30 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1977,7 +1977,7 @@ done:
1977static struct scsi_host_template mptsas_driver_template = { 1977static struct scsi_host_template mptsas_driver_template = {
1978 .module = THIS_MODULE, 1978 .module = THIS_MODULE,
1979 .proc_name = "mptsas", 1979 .proc_name = "mptsas",
1980 .proc_info = mptscsih_proc_info, 1980 .show_info = mptscsih_show_info,
1981 .name = "MPT SAS Host", 1981 .name = "MPT SAS Host",
1982 .info = mptscsih_info, 1982 .info = mptscsih_info,
1983 .queuecommand = mptsas_qcmd, 1983 .queuecommand = mptsas_qcmd,
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 164afa71bba7..727819cc7034 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1284,101 +1284,17 @@ mptscsih_info(struct Scsi_Host *SChost)
1284 return h->info_kbuf; 1284 return h->info_kbuf;
1285} 1285}
1286 1286
1287struct info_str { 1287int mptscsih_show_info(struct seq_file *m, struct Scsi_Host *host)
1288 char *buffer;
1289 int length;
1290 int offset;
1291 int pos;
1292};
1293
1294static void
1295mptscsih_copy_mem_info(struct info_str *info, char *data, int len)
1296{
1297 if (info->pos + len > info->length)
1298 len = info->length - info->pos;
1299
1300 if (info->pos + len < info->offset) {
1301 info->pos += len;
1302 return;
1303 }
1304
1305 if (info->pos < info->offset) {
1306 data += (info->offset - info->pos);
1307 len -= (info->offset - info->pos);
1308 }
1309
1310 if (len > 0) {
1311 memcpy(info->buffer + info->pos, data, len);
1312 info->pos += len;
1313 }
1314}
1315
1316static int
1317mptscsih_copy_info(struct info_str *info, char *fmt, ...)
1318{
1319 va_list args;
1320 char buf[81];
1321 int len;
1322
1323 va_start(args, fmt);
1324 len = vsprintf(buf, fmt, args);
1325 va_end(args);
1326
1327 mptscsih_copy_mem_info(info, buf, len);
1328 return len;
1329}
1330
1331static int
1332mptscsih_host_info(MPT_ADAPTER *ioc, char *pbuf, off_t offset, int len)
1333{
1334 struct info_str info;
1335
1336 info.buffer = pbuf;
1337 info.length = len;
1338 info.offset = offset;
1339 info.pos = 0;
1340
1341 mptscsih_copy_info(&info, "%s: %s, ", ioc->name, ioc->prod_name);
1342 mptscsih_copy_info(&info, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word);
1343 mptscsih_copy_info(&info, "Ports=%d, ", ioc->facts.NumberOfPorts);
1344 mptscsih_copy_info(&info, "MaxQ=%d\n", ioc->req_depth);
1345
1346 return ((info.pos > info.offset) ? info.pos - info.offset : 0);
1347}
1348
1349/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
1350/**
1351 * mptscsih_proc_info - Return information about MPT adapter
1352 * @host: scsi host struct
1353 * @buffer: if write, user data; if read, buffer for user
1354 * @start: returns the buffer address
1355 * @offset: if write, 0; if read, the current offset into the buffer from
1356 * the previous read.
1357 * @length: if write, return length;
1358 * @func: write = 1; read = 0
1359 *
1360 * (linux scsi_host_template.info routine)
1361 */
1362int
1363mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset,
1364 int length, int func)
1365{ 1288{
1366 MPT_SCSI_HOST *hd = shost_priv(host); 1289 MPT_SCSI_HOST *hd = shost_priv(host);
1367 MPT_ADAPTER *ioc = hd->ioc; 1290 MPT_ADAPTER *ioc = hd->ioc;
1368 int size = 0;
1369 1291
1370 if (func) { 1292 seq_printf(m, "%s: %s, ", ioc->name, ioc->prod_name);
1371 /* 1293 seq_printf(m, "%s%08xh, ", MPT_FW_REV_MAGIC_ID_STRING, ioc->facts.FWVersion.Word);
1372 * write is not supported 1294 seq_printf(m, "Ports=%d, ", ioc->facts.NumberOfPorts);
1373 */ 1295 seq_printf(m, "MaxQ=%d\n", ioc->req_depth);
1374 } else {
1375 if (start)
1376 *start = buffer;
1377
1378 size = mptscsih_host_info(ioc, buffer, offset, length);
1379 }
1380 1296
1381 return size; 1297 return 0;
1382} 1298}
1383 1299
1384/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 1300/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -3348,7 +3264,7 @@ EXPORT_SYMBOL(mptscsih_shutdown);
3348EXPORT_SYMBOL(mptscsih_suspend); 3264EXPORT_SYMBOL(mptscsih_suspend);
3349EXPORT_SYMBOL(mptscsih_resume); 3265EXPORT_SYMBOL(mptscsih_resume);
3350#endif 3266#endif
3351EXPORT_SYMBOL(mptscsih_proc_info); 3267EXPORT_SYMBOL(mptscsih_show_info);
3352EXPORT_SYMBOL(mptscsih_info); 3268EXPORT_SYMBOL(mptscsih_info);
3353EXPORT_SYMBOL(mptscsih_qcmd); 3269EXPORT_SYMBOL(mptscsih_qcmd);
3354EXPORT_SYMBOL(mptscsih_slave_destroy); 3270EXPORT_SYMBOL(mptscsih_slave_destroy);
diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h
index 43e75ff39921..83f503162f7a 100644
--- a/drivers/message/fusion/mptscsih.h
+++ b/drivers/message/fusion/mptscsih.h
@@ -111,7 +111,7 @@ extern void mptscsih_shutdown(struct pci_dev *);
111extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); 111extern int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
112extern int mptscsih_resume(struct pci_dev *pdev); 112extern int mptscsih_resume(struct pci_dev *pdev);
113#endif 113#endif
114extern int mptscsih_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int func); 114extern int mptscsih_show_info(struct seq_file *, struct Scsi_Host *);
115extern const char * mptscsih_info(struct Scsi_Host *SChost); 115extern const char * mptscsih_info(struct Scsi_Host *SChost);
116extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)); 116extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *));
117extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, 117extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index c3aabde2dc4f..5653e505f91f 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -831,7 +831,7 @@ static void mptspi_slave_destroy(struct scsi_device *sdev)
831static struct scsi_host_template mptspi_driver_template = { 831static struct scsi_host_template mptspi_driver_template = {
832 .module = THIS_MODULE, 832 .module = THIS_MODULE,
833 .proc_name = "mptspi", 833 .proc_name = "mptspi",
834 .proc_info = mptscsih_proc_info, 834 .show_info = mptscsih_show_info,
835 .name = "MPT SPI Host", 835 .name = "MPT SPI Host",
836 .info = mptscsih_info, 836 .info = mptscsih_info,
837 .queuecommand = mptspi_qcmd, 837 .queuecommand = mptspi_qcmd,
diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c
index 8001aa6bfb48..b7d87cd227a9 100644
--- a/drivers/message/i2o/i2o_proc.c
+++ b/drivers/message/i2o/i2o_proc.c
@@ -1599,98 +1599,98 @@ static int i2o_seq_show_sensors(struct seq_file *seq, void *v)
1599 1599
1600static int i2o_seq_open_hrt(struct inode *inode, struct file *file) 1600static int i2o_seq_open_hrt(struct inode *inode, struct file *file)
1601{ 1601{
1602 return single_open(file, i2o_seq_show_hrt, PDE(inode)->data); 1602 return single_open(file, i2o_seq_show_hrt, PDE_DATA(inode));
1603}; 1603};
1604 1604
1605static int i2o_seq_open_lct(struct inode *inode, struct file *file) 1605static int i2o_seq_open_lct(struct inode *inode, struct file *file)
1606{ 1606{
1607 return single_open(file, i2o_seq_show_lct, PDE(inode)->data); 1607 return single_open(file, i2o_seq_show_lct, PDE_DATA(inode));
1608}; 1608};
1609 1609
1610static int i2o_seq_open_status(struct inode *inode, struct file *file) 1610static int i2o_seq_open_status(struct inode *inode, struct file *file)
1611{ 1611{
1612 return single_open(file, i2o_seq_show_status, PDE(inode)->data); 1612 return single_open(file, i2o_seq_show_status, PDE_DATA(inode));
1613}; 1613};
1614 1614
1615static int i2o_seq_open_hw(struct inode *inode, struct file *file) 1615static int i2o_seq_open_hw(struct inode *inode, struct file *file)
1616{ 1616{
1617 return single_open(file, i2o_seq_show_hw, PDE(inode)->data); 1617 return single_open(file, i2o_seq_show_hw, PDE_DATA(inode));
1618}; 1618};
1619 1619
1620static int i2o_seq_open_ddm_table(struct inode *inode, struct file *file) 1620static int i2o_seq_open_ddm_table(struct inode *inode, struct file *file)
1621{ 1621{
1622 return single_open(file, i2o_seq_show_ddm_table, PDE(inode)->data); 1622 return single_open(file, i2o_seq_show_ddm_table, PDE_DATA(inode));
1623}; 1623};
1624 1624
1625static int i2o_seq_open_driver_store(struct inode *inode, struct file *file) 1625static int i2o_seq_open_driver_store(struct inode *inode, struct file *file)
1626{ 1626{
1627 return single_open(file, i2o_seq_show_driver_store, PDE(inode)->data); 1627 return single_open(file, i2o_seq_show_driver_store, PDE_DATA(inode));
1628}; 1628};
1629 1629
1630static int i2o_seq_open_drivers_stored(struct inode *inode, struct file *file) 1630static int i2o_seq_open_drivers_stored(struct inode *inode, struct file *file)
1631{ 1631{
1632 return single_open(file, i2o_seq_show_drivers_stored, PDE(inode)->data); 1632 return single_open(file, i2o_seq_show_drivers_stored, PDE_DATA(inode));
1633}; 1633};
1634 1634
1635static int i2o_seq_open_groups(struct inode *inode, struct file *file) 1635static int i2o_seq_open_groups(struct inode *inode, struct file *file)
1636{ 1636{
1637 return single_open(file, i2o_seq_show_groups, PDE(inode)->data); 1637 return single_open(file, i2o_seq_show_groups, PDE_DATA(inode));
1638}; 1638};
1639 1639
1640static int i2o_seq_open_phys_device(struct inode *inode, struct file *file) 1640static int i2o_seq_open_phys_device(struct inode *inode, struct file *file)
1641{ 1641{
1642 return single_open(file, i2o_seq_show_phys_device, PDE(inode)->data); 1642 return single_open(file, i2o_seq_show_phys_device, PDE_DATA(inode));
1643}; 1643};
1644 1644
1645static int i2o_seq_open_claimed(struct inode *inode, struct file *file) 1645static int i2o_seq_open_claimed(struct inode *inode, struct file *file)
1646{ 1646{
1647 return single_open(file, i2o_seq_show_claimed, PDE(inode)->data); 1647 return single_open(file, i2o_seq_show_claimed, PDE_DATA(inode));
1648}; 1648};
1649 1649
1650static int i2o_seq_open_users(struct inode *inode, struct file *file) 1650static int i2o_seq_open_users(struct inode *inode, struct file *file)
1651{ 1651{
1652 return single_open(file, i2o_seq_show_users, PDE(inode)->data); 1652 return single_open(file, i2o_seq_show_users, PDE_DATA(inode));
1653}; 1653};
1654 1654
1655static int i2o_seq_open_priv_msgs(struct inode *inode, struct file *file) 1655static int i2o_seq_open_priv_msgs(struct inode *inode, struct file *file)
1656{ 1656{
1657 return single_open(file, i2o_seq_show_priv_msgs, PDE(inode)->data); 1657 return single_open(file, i2o_seq_show_priv_msgs, PDE_DATA(inode));
1658}; 1658};
1659 1659
1660static int i2o_seq_open_authorized_users(struct inode *inode, struct file *file) 1660static int i2o_seq_open_authorized_users(struct inode *inode, struct file *file)
1661{ 1661{
1662 return single_open(file, i2o_seq_show_authorized_users, 1662 return single_open(file, i2o_seq_show_authorized_users,
1663 PDE(inode)->data); 1663 PDE_DATA(inode));
1664}; 1664};
1665 1665
1666static int i2o_seq_open_dev_identity(struct inode *inode, struct file *file) 1666static int i2o_seq_open_dev_identity(struct inode *inode, struct file *file)
1667{ 1667{
1668 return single_open(file, i2o_seq_show_dev_identity, PDE(inode)->data); 1668 return single_open(file, i2o_seq_show_dev_identity, PDE_DATA(inode));
1669}; 1669};
1670 1670
1671static int i2o_seq_open_ddm_identity(struct inode *inode, struct file *file) 1671static int i2o_seq_open_ddm_identity(struct inode *inode, struct file *file)
1672{ 1672{
1673 return single_open(file, i2o_seq_show_ddm_identity, PDE(inode)->data); 1673 return single_open(file, i2o_seq_show_ddm_identity, PDE_DATA(inode));
1674}; 1674};
1675 1675
1676static int i2o_seq_open_uinfo(struct inode *inode, struct file *file) 1676static int i2o_seq_open_uinfo(struct inode *inode, struct file *file)
1677{ 1677{
1678 return single_open(file, i2o_seq_show_uinfo, PDE(inode)->data); 1678 return single_open(file, i2o_seq_show_uinfo, PDE_DATA(inode));
1679}; 1679};
1680 1680
1681static int i2o_seq_open_sgl_limits(struct inode *inode, struct file *file) 1681static int i2o_seq_open_sgl_limits(struct inode *inode, struct file *file)
1682{ 1682{
1683 return single_open(file, i2o_seq_show_sgl_limits, PDE(inode)->data); 1683 return single_open(file, i2o_seq_show_sgl_limits, PDE_DATA(inode));
1684}; 1684};
1685 1685
1686static int i2o_seq_open_sensors(struct inode *inode, struct file *file) 1686static int i2o_seq_open_sensors(struct inode *inode, struct file *file)
1687{ 1687{
1688 return single_open(file, i2o_seq_show_sensors, PDE(inode)->data); 1688 return single_open(file, i2o_seq_show_sensors, PDE_DATA(inode));
1689}; 1689};
1690 1690
1691static int i2o_seq_open_dev_name(struct inode *inode, struct file *file) 1691static int i2o_seq_open_dev_name(struct inode *inode, struct file *file)
1692{ 1692{
1693 return single_open(file, i2o_seq_show_dev_name, PDE(inode)->data); 1693 return single_open(file, i2o_seq_show_dev_name, PDE_DATA(inode));
1694}; 1694};
1695 1695
1696static const struct file_operations i2o_seq_fops_lct = { 1696static const struct file_operations i2o_seq_fops_lct = {
@@ -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 */
1904static 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
@@ -1932,14 +1913,12 @@ static void i2o_proc_device_add(struct proc_dir_entry *dir,
1932 1913
1933 osm_debug("adding device /proc/i2o/%s/%s\n", dev->iop->name, buff); 1914 osm_debug("adding device /proc/i2o/%s/%s\n", dev->iop->name, buff);
1934 1915
1935 devdir = proc_mkdir(buff, dir); 1916 devdir = proc_mkdir_data(buff, 0, dir, dev);
1936 if (!devdir) { 1917 if (!devdir) {
1937 osm_warn("Could not allocate procdir!\n"); 1918 osm_warn("Could not allocate procdir!\n");
1938 return; 1919 return;
1939 } 1920 }
1940 1921
1941 devdir->data = dev;
1942
1943 i2o_proc_create_entries(devdir, generic_dev_entries, dev); 1922 i2o_proc_create_entries(devdir, generic_dev_entries, dev);
1944 1923
1945 /* Inform core that we want updates about this device's status */ 1924 /* Inform core that we want updates about this device's status */
@@ -1973,12 +1952,10 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir,
1973 1952
1974 osm_debug("adding IOP /proc/i2o/%s\n", c->name); 1953 osm_debug("adding IOP /proc/i2o/%s\n", c->name);
1975 1954
1976 iopdir = proc_mkdir(c->name, dir); 1955 iopdir = proc_mkdir_data(c->name, 0, dir, c);
1977 if (!iopdir) 1956 if (!iopdir)
1978 return -1; 1957 return -1;
1979 1958
1980 iopdir->data = c;
1981
1982 i2o_proc_create_entries(iopdir, i2o_proc_generic_iop_entries, c); 1959 i2o_proc_create_entries(iopdir, i2o_proc_generic_iop_entries, c);
1983 1960
1984 list_for_each_entry(dev, &c->devices, list) 1961 list_for_each_entry(dev, &c->devices, list)
@@ -1988,31 +1965,6 @@ static int i2o_proc_iop_add(struct proc_dir_entry *dir,
1988} 1965}
1989 1966
1990/** 1967/**
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 */
1998static 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. 1968 * i2o_proc_fs_create - Create the i2o proc fs.
2017 * 1969 *
2018 * Iterate over each I2O controller and create the entries for it. 1970 * Iterate over each I2O controller and create the entries for it.
@@ -2042,12 +1994,7 @@ static int __init i2o_proc_fs_create(void)
2042 */ 1994 */
2043static int __exit i2o_proc_fs_destroy(void) 1995static int __exit i2o_proc_fs_destroy(void)
2044{ 1996{
2045 struct i2o_controller *c; 1997 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 1998
2052 return 0; 1999 return 0;
2053}; 2000};