diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-31 01:37:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 14:13:17 -0400 |
commit | 09dae7fc57a010288875ef46a44e30d16cedd232 (patch) | |
tree | 051a18b31dcbfc5260875f1675104544ed8c82ba /drivers/usb/storage | |
parent | dd7ab71bb3b4dad7fa1c4fd89706d6870991cfe6 (diff) |
usb-storage: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 92f35abee92d..615c66eaedeb 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -438,22 +438,21 @@ void usb_stor_report_bus_reset(struct us_data *us) | |||
438 | * /proc/scsi/ functions | 438 | * /proc/scsi/ functions |
439 | ***********************************************************************/ | 439 | ***********************************************************************/ |
440 | 440 | ||
441 | static int write_info(struct Scsi_Host *host, char *buffer, int length) | ||
442 | { | ||
443 | /* if someone is sending us data, just throw it away */ | ||
444 | return length; | ||
445 | } | ||
446 | |||
441 | /* we use this macro to help us write into the buffer */ | 447 | /* we use this macro to help us write into the buffer */ |
442 | #undef SPRINTF | 448 | #undef SPRINTF |
443 | #define SPRINTF(args...) \ | 449 | #define SPRINTF(args...) seq_printf(m, ## args) |
444 | do { if (pos < buffer+length) pos += sprintf(pos, ## args); } while (0) | ||
445 | 450 | ||
446 | static int proc_info (struct Scsi_Host *host, char *buffer, | 451 | static int show_info (struct seq_file *m, struct Scsi_Host *host) |
447 | char **start, off_t offset, int length, int inout) | ||
448 | { | 452 | { |
449 | struct us_data *us = host_to_us(host); | 453 | struct us_data *us = host_to_us(host); |
450 | char *pos = buffer; | ||
451 | const char *string; | 454 | const char *string; |
452 | 455 | ||
453 | /* if someone is sending us data, just throw it away */ | ||
454 | if (inout) | ||
455 | return length; | ||
456 | |||
457 | /* print the controller name */ | 456 | /* print the controller name */ |
458 | SPRINTF(" Host scsi%d: usb-storage\n", host->host_no); | 457 | SPRINTF(" Host scsi%d: usb-storage\n", host->host_no); |
459 | 458 | ||
@@ -483,28 +482,14 @@ static int proc_info (struct Scsi_Host *host, char *buffer, | |||
483 | SPRINTF(" Transport: %s\n", us->transport_name); | 482 | SPRINTF(" Transport: %s\n", us->transport_name); |
484 | 483 | ||
485 | /* show the device flags */ | 484 | /* show the device flags */ |
486 | if (pos < buffer + length) { | 485 | SPRINTF(" Quirks:"); |
487 | pos += sprintf(pos, " Quirks:"); | ||
488 | 486 | ||
489 | #define US_FLAG(name, value) \ | 487 | #define US_FLAG(name, value) \ |
490 | if (us->fflags & value) pos += sprintf(pos, " " #name); | 488 | if (us->fflags & value) seq_printf(m, " " #name); |
491 | US_DO_ALL_FLAGS | 489 | US_DO_ALL_FLAGS |
492 | #undef US_FLAG | 490 | #undef US_FLAG |
493 | 491 | seq_putc(m, '\n'); | |
494 | *(pos++) = '\n'; | 492 | return 0; |
495 | } | ||
496 | |||
497 | /* | ||
498 | * Calculate start of next buffer, and return value. | ||
499 | */ | ||
500 | *start = buffer + offset; | ||
501 | |||
502 | if ((pos - buffer) < offset) | ||
503 | return (0); | ||
504 | else if ((pos - buffer - offset) < length) | ||
505 | return (pos - buffer - offset); | ||
506 | else | ||
507 | return (length); | ||
508 | } | 493 | } |
509 | 494 | ||
510 | /*********************************************************************** | 495 | /*********************************************************************** |
@@ -549,7 +534,8 @@ struct scsi_host_template usb_stor_host_template = { | |||
549 | /* basic userland interface stuff */ | 534 | /* basic userland interface stuff */ |
550 | .name = "usb-storage", | 535 | .name = "usb-storage", |
551 | .proc_name = "usb-storage", | 536 | .proc_name = "usb-storage", |
552 | .proc_info = proc_info, | 537 | .show_info = show_info, |
538 | .write_info = write_info, | ||
553 | .info = host_info, | 539 | .info = host_info, |
554 | 540 | ||
555 | /* command interface -- queued only */ | 541 | /* command interface -- queued only */ |