aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:13 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 12:09:13 -0400
commit79cb380397c834a35952d8497651d93b543ef968 (patch)
treecfeb4b1c69327df9f8885d18fa0d0ef3e547cce4 /drivers/scsi/ide-scsi.c
parent9a6eb74d07f9152dd0e0ea551e878e869b8d2fc1 (diff)
ide: allow device drivers to specify per-device type /proc settings
Turn ide_driver_t's 'proc' field into ->proc_entries method (and also 'settings' field into ->proc_devsets method). Then update all device drivers accordingly. There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 740bad435995..afc96e844a25 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -343,6 +343,11 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r
343} 343}
344 344
345#ifdef CONFIG_IDE_PROC_FS 345#ifdef CONFIG_IDE_PROC_FS
346static ide_proc_entry_t idescsi_proc[] = {
347 { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
348 { NULL, 0, NULL, NULL }
349};
350
346#define ide_scsi_devset_get(name, field) \ 351#define ide_scsi_devset_get(name, field) \
347static int get_##name(ide_drive_t *drive) \ 352static int get_##name(ide_drive_t *drive) \
348{ \ 353{ \
@@ -378,6 +383,16 @@ static const struct ide_proc_devset idescsi_settings[] = {
378 IDE_PROC_DEVSET(transform, 0, 3), 383 IDE_PROC_DEVSET(transform, 0, 3),
379 { 0 }, 384 { 0 },
380}; 385};
386
387static ide_proc_entry_t *ide_scsi_proc_entries(ide_drive_t *drive)
388{
389 return idescsi_proc;
390}
391
392static const struct ide_proc_devset *ide_scsi_proc_devsets(ide_drive_t *drive)
393{
394 return idescsi_settings;
395}
381#endif 396#endif
382 397
383/* 398/*
@@ -419,13 +434,6 @@ static void ide_scsi_remove(ide_drive_t *drive)
419 434
420static int ide_scsi_probe(ide_drive_t *); 435static int ide_scsi_probe(ide_drive_t *);
421 436
422#ifdef CONFIG_IDE_PROC_FS
423static ide_proc_entry_t idescsi_proc[] = {
424 { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL },
425 { NULL, 0, NULL, NULL }
426};
427#endif
428
429static ide_driver_t idescsi_driver = { 437static ide_driver_t idescsi_driver = {
430 .gen_driver = { 438 .gen_driver = {
431 .owner = THIS_MODULE, 439 .owner = THIS_MODULE,
@@ -439,8 +447,8 @@ static ide_driver_t idescsi_driver = {
439 .end_request = idescsi_end_request, 447 .end_request = idescsi_end_request,
440 .error = idescsi_atapi_error, 448 .error = idescsi_atapi_error,
441#ifdef CONFIG_IDE_PROC_FS 449#ifdef CONFIG_IDE_PROC_FS
442 .proc = idescsi_proc, 450 .proc_entries = ide_scsi_proc_entries,
443 .settings = idescsi_settings, 451 .proc_devsets = ide_scsi_proc_devsets,
444#endif 452#endif
445}; 453};
446 454