aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 02:08:31 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:20 -0400
commit60e8b807a6fb989de5fc195a92cfab4fd890b3c9 (patch)
treee9e9b2c3f33b12d3037633e7195020fa238b46e3
parent38c19ec9f7b28c8d5034daf28e4cc1b24e23ac49 (diff)
keucr: switch to ->show_info()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/staging/keucr/scsiglue.c45
1 files changed, 13 insertions, 32 deletions
diff --git a/drivers/staging/keucr/scsiglue.c b/drivers/staging/keucr/scsiglue.c
index 083b20e6253e..48e1005349da 100644
--- a/drivers/staging/keucr/scsiglue.c
+++ b/drivers/staging/keucr/scsiglue.c
@@ -229,26 +229,18 @@ void usb_stor_report_bus_reset(struct us_data *us)
229 229
230/* we use this macro to help us write into the buffer */ 230/* we use this macro to help us write into the buffer */
231#undef SPRINTF 231#undef SPRINTF
232#define SPRINTF(args...) \ 232#define SPRINTF(args...) seq_printf(m, ##args)
233 do { \
234 if (pos < buffer+length) \
235 pos += sprintf(pos, ## args); \
236 } while (0)
237 233
238/* 234static int write_info(struct Scsi_Host *host, char *buffer, int length)
239 * proc_info() 235{
240 */ 236 return length;
241static int proc_info(struct Scsi_Host *host, char *buffer, char **start, 237}
242 off_t offset, int length, int inout) 238
239static int show_info(struct seq_file *m, struct Scsi_Host *host)
243{ 240{
244 struct us_data *us = host_to_us(host); 241 struct us_data *us = host_to_us(host);
245 char *pos = buffer;
246 const char *string; 242 const char *string;
247 243
248 /* pr_info("scsiglue --- proc_info\n"); */
249 if (inout)
250 return length;
251
252 /* print the controller name */ 244 /* print the controller name */
253 SPRINTF(" Host scsi%d: usb-storage\n", host->host_no); 245 SPRINTF(" Host scsi%d: usb-storage\n", host->host_no);
254 246
@@ -278,29 +270,17 @@ static int proc_info(struct Scsi_Host *host, char *buffer, char **start,
278 SPRINTF(" Transport: %s\n", us->transport_name); 270 SPRINTF(" Transport: %s\n", us->transport_name);
279 271
280 /* show the device flags */ 272 /* show the device flags */
281 if (pos < buffer + length) { 273 SPRINTF(" Quirks:");
282 pos += sprintf(pos, " Quirks:");
283 274
284#define US_FLAG(name, value) \ 275#define US_FLAG(name, value) \
285 do { \ 276 do { \
286 if (us->fflags & value) \ 277 if (us->fflags & value) \
287 pos += sprintf(pos, " " #name); \ 278 SPRINTF(" " #name); \
288 } while (0); 279 } while (0);
289US_DO_ALL_FLAGS 280US_DO_ALL_FLAGS
290#undef US_FLAG 281#undef US_FLAG
291 282 seq_putc(m, '\n');
292 *(pos++) = '\n'; 283 return 0;
293 }
294
295 /* Calculate start of next buffer, and return value. */
296 *start = buffer + offset;
297
298 if ((pos - buffer) < offset)
299 return 0;
300 else if ((pos - buffer - offset) < length)
301 return pos - buffer - offset;
302 else
303 return length;
304} 284}
305 285
306/*********************************************************************** 286/***********************************************************************
@@ -351,7 +331,8 @@ struct scsi_host_template usb_stor_host_template = {
351 /* basic userland interface stuff */ 331 /* basic userland interface stuff */
352 .name = "eucr-storage", 332 .name = "eucr-storage",
353 .proc_name = "eucr-storage", 333 .proc_name = "eucr-storage",
354 .proc_info = proc_info, 334 .write_info = write_info,
335 .show_info = show_info,
355 .info = host_info, 336 .info = host_info,
356 337
357 /* command interface -- queued only */ 338 /* command interface -- queued only */