aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/wd7000.c
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/scsi/wd7000.c
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/scsi/wd7000.c')
-rw-r--r--drivers/scsi/wd7000.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c
index d89a5dfd3ade..f9a6e4b0affe 100644
--- a/drivers/scsi/wd7000.c
+++ b/drivers/scsi/wd7000.c
@@ -1296,9 +1296,9 @@ static void wd7000_revision(Adapter * host)
1296 1296
1297 1297
1298#undef SPRINTF 1298#undef SPRINTF
1299#define SPRINTF(args...) { if (pos < (buffer + length)) pos += sprintf (pos, ## args); } 1299#define SPRINTF(args...) { seq_printf(m, ## args); }
1300 1300
1301static int wd7000_set_info(char *buffer, int length, struct Scsi_Host *host) 1301static int wd7000_set_info(struct Scsi_Host *host, char *buffer, int length)
1302{ 1302{
1303 dprintk("Buffer = <%.*s>, length = %d\n", length, buffer, length); 1303 dprintk("Buffer = <%.*s>, length = %d\n", length, buffer, length);
1304 1304
@@ -1310,22 +1310,15 @@ static int wd7000_set_info(char *buffer, int length, struct Scsi_Host *host)
1310} 1310}
1311 1311
1312 1312
1313static int wd7000_proc_info(struct Scsi_Host *host, char *buffer, char **start, off_t offset, int length, int inout) 1313static int wd7000_show_info(struct seq_file *m, struct Scsi_Host *host)
1314{ 1314{
1315 Adapter *adapter = (Adapter *)host->hostdata; 1315 Adapter *adapter = (Adapter *)host->hostdata;
1316 unsigned long flags; 1316 unsigned long flags;
1317 char *pos = buffer;
1318#ifdef WD7000_DEBUG 1317#ifdef WD7000_DEBUG
1319 Mailbox *ogmbs, *icmbs; 1318 Mailbox *ogmbs, *icmbs;
1320 short count; 1319 short count;
1321#endif 1320#endif
1322 1321
1323 /*
1324 * Has data been written to the file ?
1325 */
1326 if (inout)
1327 return (wd7000_set_info(buffer, length, host));
1328
1329 spin_lock_irqsave(host->host_lock, flags); 1322 spin_lock_irqsave(host->host_lock, flags);
1330 SPRINTF("Host scsi%d: Western Digital WD-7000 (rev %d.%d)\n", host->host_no, adapter->rev1, adapter->rev2); 1323 SPRINTF("Host scsi%d: Western Digital WD-7000 (rev %d.%d)\n", host->host_no, adapter->rev1, adapter->rev2);
1331 SPRINTF(" IO base: 0x%x\n", adapter->iobase); 1324 SPRINTF(" IO base: 0x%x\n", adapter->iobase);
@@ -1368,17 +1361,7 @@ static int wd7000_proc_info(struct Scsi_Host *host, char *buffer, char **start,
1368 1361
1369 spin_unlock_irqrestore(host->host_lock, flags); 1362 spin_unlock_irqrestore(host->host_lock, flags);
1370 1363
1371 /* 1364 return 0;
1372 * Calculate start of next buffer, and return value.
1373 */
1374 *start = buffer + offset;
1375
1376 if ((pos - buffer) < offset)
1377 return (0);
1378 else if ((pos - buffer - offset) < length)
1379 return (pos - buffer - offset);
1380 else
1381 return (length);
1382} 1365}
1383 1366
1384 1367
@@ -1413,7 +1396,8 @@ static __init int wd7000_detect(struct scsi_host_template *tpnt)
1413 for (i = 0; i < NUM_CONFIGS; biosptr[i++] = -1); 1396 for (i = 0; i < NUM_CONFIGS; biosptr[i++] = -1);
1414 1397
1415 tpnt->proc_name = "wd7000"; 1398 tpnt->proc_name = "wd7000";
1416 tpnt->proc_info = &wd7000_proc_info; 1399 tpnt->show_info = &wd7000_show_info;
1400 tpnt->write_info = wd7000_set_info;
1417 1401
1418 /* 1402 /*
1419 * Set up SCB free list, which is shared by all adapters 1403 * Set up SCB free list, which is shared by all adapters
@@ -1658,7 +1642,8 @@ MODULE_LICENSE("GPL");
1658 1642
1659static struct scsi_host_template driver_template = { 1643static struct scsi_host_template driver_template = {
1660 .proc_name = "wd7000", 1644 .proc_name = "wd7000",
1661 .proc_info = wd7000_proc_info, 1645 .show_info = wd7000_show_info,
1646 .write_info = wd7000_set_info,
1662 .name = "Western Digital WD-7000", 1647 .name = "Western Digital WD-7000",
1663 .detect = wd7000_detect, 1648 .detect = wd7000_detect,
1664 .release = wd7000_release, 1649 .release = wd7000_release,