diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:10 -0400 |
commit | 7662d046df09e80680b77b68de896beab45e675e (patch) | |
tree | ea2281c59399b3867fb37e1005a0f0e0d2170c5d /drivers/ide/ide-tape.c | |
parent | 1497943ee692aa7519fa972d0e3a339649bf3a96 (diff) |
ide: move IDE settings handling to ide-proc.c
* move
__ide_add_setting()
ide_add_setting()
__ide_remove_setting()
auto_remove_settings()
ide_find_setting_by_name()
ide_read_setting()
ide_write_setting()
set_xfer_rate()
ide_add_generic_settings()
ide_register_subdriver()
ide_unregister_subdriver()
from ide.c to ide-proc.c
* set_{io_32bit,pio_mode,using_dma}() cannot be marked static now, fix it
* rename ide_[un]register_subdriver() to ide_proc_[un]register_driver(),
update device drivers to use new names
* add CONFIG_IDE_PROC_FS=n versions of ide_proc_[un]register_driver()
and ide_add_generic_settings()
* make ide_find_setting_by_name(), ide_{read,write}_setting()
and ide_{add,remove}_proc_entries() static
* cover IDE settings code in device drivers with CONFIG_IDE_PROC_FS #ifdef,
also while at it cover with CONFIG_IDE_PROC_FS #ifdef ide_driver_t.proc
* remove bogus comment from ide.h
* cover with CONFIG_IDE_PROC_FS #ifdef .proc and .settings in ide_drive_t
Besides saner code this patch results in the IDE core smaller by ~2 kB
(on x86-32) and IDE disk driver by ~1 kB (ditto) when CONFIG_IDE_PROC_FS=n.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index fa0d22de37a7..e82bfa5e0ab8 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -4561,6 +4561,8 @@ static void idetape_get_blocksize_from_block_descriptor(ide_drive_t *drive) | |||
4561 | printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); | 4561 | printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); |
4562 | #endif /* IDETAPE_DEBUG_INFO */ | 4562 | #endif /* IDETAPE_DEBUG_INFO */ |
4563 | } | 4563 | } |
4564 | |||
4565 | #ifdef CONFIG_IDE_PROC_FS | ||
4564 | static void idetape_add_settings (ide_drive_t *drive) | 4566 | static void idetape_add_settings (ide_drive_t *drive) |
4565 | { | 4567 | { |
4566 | idetape_tape_t *tape = drive->driver_data; | 4568 | idetape_tape_t *tape = drive->driver_data; |
@@ -4583,6 +4585,9 @@ static void idetape_add_settings (ide_drive_t *drive) | |||
4583 | ide_add_setting(drive, "avg_speed", SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1, &tape->avg_speed, NULL); | 4585 | ide_add_setting(drive, "avg_speed", SETTING_READ, TYPE_INT, 0, 0xffff, 1, 1, &tape->avg_speed, NULL); |
4584 | ide_add_setting(drive, "debug_level", SETTING_RW, TYPE_INT, 0, 0xffff, 1, 1, &tape->debug_level, NULL); | 4586 | ide_add_setting(drive, "debug_level", SETTING_RW, TYPE_INT, 0, 0xffff, 1, 1, &tape->debug_level, NULL); |
4585 | } | 4587 | } |
4588 | #else | ||
4589 | static inline void idetape_add_settings(ide_drive_t *drive) { ; } | ||
4590 | #endif | ||
4586 | 4591 | ||
4587 | /* | 4592 | /* |
4588 | * ide_setup is called to: | 4593 | * ide_setup is called to: |
@@ -4703,7 +4708,7 @@ static void ide_tape_remove(ide_drive_t *drive) | |||
4703 | { | 4708 | { |
4704 | idetape_tape_t *tape = drive->driver_data; | 4709 | idetape_tape_t *tape = drive->driver_data; |
4705 | 4710 | ||
4706 | ide_unregister_subdriver(drive, tape->driver); | 4711 | ide_proc_unregister_driver(drive, tape->driver); |
4707 | 4712 | ||
4708 | ide_unregister_region(tape->disk); | 4713 | ide_unregister_region(tape->disk); |
4709 | 4714 | ||
@@ -4731,7 +4736,6 @@ static void ide_tape_release(struct kref *kref) | |||
4731 | } | 4736 | } |
4732 | 4737 | ||
4733 | #ifdef CONFIG_IDE_PROC_FS | 4738 | #ifdef CONFIG_IDE_PROC_FS |
4734 | |||
4735 | static int proc_idetape_read_name | 4739 | static int proc_idetape_read_name |
4736 | (char *page, char **start, off_t off, int count, int *eof, void *data) | 4740 | (char *page, char **start, off_t off, int count, int *eof, void *data) |
4737 | { | 4741 | { |
@@ -4749,11 +4753,6 @@ static ide_proc_entry_t idetape_proc[] = { | |||
4749 | { "name", S_IFREG|S_IRUGO, proc_idetape_read_name, NULL }, | 4753 | { "name", S_IFREG|S_IRUGO, proc_idetape_read_name, NULL }, |
4750 | { NULL, 0, NULL, NULL } | 4754 | { NULL, 0, NULL, NULL } |
4751 | }; | 4755 | }; |
4752 | |||
4753 | #else | ||
4754 | |||
4755 | #define idetape_proc NULL | ||
4756 | |||
4757 | #endif | 4756 | #endif |
4758 | 4757 | ||
4759 | static int ide_tape_probe(ide_drive_t *); | 4758 | static int ide_tape_probe(ide_drive_t *); |
@@ -4773,7 +4772,9 @@ static ide_driver_t idetape_driver = { | |||
4773 | .end_request = idetape_end_request, | 4772 | .end_request = idetape_end_request, |
4774 | .error = __ide_error, | 4773 | .error = __ide_error, |
4775 | .abort = __ide_abort, | 4774 | .abort = __ide_abort, |
4775 | #ifdef CONFIG_IDE_PROC_FS | ||
4776 | .proc = idetape_proc, | 4776 | .proc = idetape_proc, |
4777 | #endif | ||
4777 | }; | 4778 | }; |
4778 | 4779 | ||
4779 | /* | 4780 | /* |
@@ -4864,7 +4865,7 @@ static int ide_tape_probe(ide_drive_t *drive) | |||
4864 | 4865 | ||
4865 | ide_init_disk(g, drive); | 4866 | ide_init_disk(g, drive); |
4866 | 4867 | ||
4867 | ide_register_subdriver(drive, &idetape_driver); | 4868 | ide_proc_register_driver(drive, &idetape_driver); |
4868 | 4869 | ||
4869 | kref_init(&tape->kref); | 4870 | kref_init(&tape->kref); |
4870 | 4871 | ||