From: Al Viro Date: Sun, 31 Mar 2013 06:14:18 +0000 (-0400) Subject: nsp_cs: switch to ->show_info() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=63fd57cb5c21b7b914b13be0b225829c0f5dba10;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git nsp_cs: switch to ->show_info() Signed-off-by: Al Viro --- diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index b61a753eb896..987fbb1b244e 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -76,7 +76,7 @@ MODULE_PARM_DESC(free_ports, "Release IO ports after configuration? (default: 0 static struct scsi_host_template nsp_driver_template = { .proc_name = "nsp_cs", - .proc_info = nsp_proc_info, + .show_info = nsp_show_info, .name = "WorkBit NinjaSCSI-3/32Bi(16bit)", .info = nsp_info, .queuecommand = nsp_queuecommand, @@ -1365,33 +1365,19 @@ static const char *nsp_info(struct Scsi_Host *shpnt) } #undef SPRINTF -#define SPRINTF(args...) \ - do { \ - if(length > (pos - buffer)) { \ - pos += snprintf(pos, length - (pos - buffer) + 1, ## args); \ - nsp_dbg(NSP_DEBUG_PROC, "buffer=0x%p pos=0x%p length=%d %d\n", buffer, pos, length, length - (pos - buffer));\ - } \ - } while(0) - -static int nsp_proc_info(struct Scsi_Host *host, char *buffer, char **start, - off_t offset, int length, int inout) +#define SPRINTF(args...) seq_printf(m, ##args) + +static int nsp_show_info(struct seq_file *m, struct Scsi_Host *host) { int id; - char *pos = buffer; - int thislength; int speed; unsigned long flags; nsp_hw_data *data; int hostno; - if (inout) { - return -EINVAL; - } - hostno = host->host_no; data = (nsp_hw_data *)host->hostdata; - SPRINTF("NinjaSCSI status\n\n"); SPRINTF("Driver version: $Revision: 1.23 $\n"); SPRINTF("SCSI host No.: %d\n", hostno); @@ -1458,19 +1444,7 @@ static int nsp_proc_info(struct Scsi_Host *host, char *buffer, char **start, } SPRINTF("\n"); } - - thislength = pos - (buffer + offset); - - if(thislength < 0) { - *start = NULL; - return 0; - } - - - thislength = min(thislength, length); - *start = buffer + offset; - - return thislength; + return 0; } #undef SPRINTF diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index 7fc9a9d0a448..afd64f0adc4b 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h @@ -292,13 +292,8 @@ static int nsp_cs_config (struct pcmcia_device *link); /* Linux SCSI subsystem specific functions */ static struct Scsi_Host *nsp_detect (struct scsi_host_template *sht); static const char *nsp_info (struct Scsi_Host *shpnt); -static int nsp_proc_info ( - struct Scsi_Host *host, - char *buffer, - char **start, - off_t offset, - int length, - int inout); +static int nsp_show_info (struct seq_file *m, + struct Scsi_Host *host); static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); /* Error handler */