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-floppy.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-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 38fe45cf4019..f429be88c4f9 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -1811,6 +1811,7 @@ static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id) | |||
1811 | return 0; | 1811 | return 0; |
1812 | } | 1812 | } |
1813 | 1813 | ||
1814 | #ifdef CONFIG_IDE_PROC_FS | ||
1814 | static void idefloppy_add_settings(ide_drive_t *drive) | 1815 | static void idefloppy_add_settings(ide_drive_t *drive) |
1815 | { | 1816 | { |
1816 | idefloppy_floppy_t *floppy = drive->driver_data; | 1817 | idefloppy_floppy_t *floppy = drive->driver_data; |
@@ -1823,6 +1824,9 @@ static void idefloppy_add_settings(ide_drive_t *drive) | |||
1823 | ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); | 1824 | ide_add_setting(drive, "bios_sect", SETTING_RW, TYPE_BYTE, 0, 63, 1, 1, &drive->bios_sect, NULL); |
1824 | ide_add_setting(drive, "ticks", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &floppy->ticks, NULL); | 1825 | ide_add_setting(drive, "ticks", SETTING_RW, TYPE_BYTE, 0, 255, 1, 1, &floppy->ticks, NULL); |
1825 | } | 1826 | } |
1827 | #else | ||
1828 | static inline void idefloppy_add_settings(ide_drive_t *drive) { ; } | ||
1829 | #endif | ||
1826 | 1830 | ||
1827 | /* | 1831 | /* |
1828 | * Driver initialization. | 1832 | * Driver initialization. |
@@ -1873,7 +1877,7 @@ static void ide_floppy_remove(ide_drive_t *drive) | |||
1873 | idefloppy_floppy_t *floppy = drive->driver_data; | 1877 | idefloppy_floppy_t *floppy = drive->driver_data; |
1874 | struct gendisk *g = floppy->disk; | 1878 | struct gendisk *g = floppy->disk; |
1875 | 1879 | ||
1876 | ide_unregister_subdriver(drive, floppy->driver); | 1880 | ide_proc_unregister_driver(drive, floppy->driver); |
1877 | 1881 | ||
1878 | del_gendisk(g); | 1882 | del_gendisk(g); |
1879 | 1883 | ||
@@ -1893,7 +1897,6 @@ static void ide_floppy_release(struct kref *kref) | |||
1893 | } | 1897 | } |
1894 | 1898 | ||
1895 | #ifdef CONFIG_IDE_PROC_FS | 1899 | #ifdef CONFIG_IDE_PROC_FS |
1896 | |||
1897 | static int proc_idefloppy_read_capacity | 1900 | static int proc_idefloppy_read_capacity |
1898 | (char *page, char **start, off_t off, int count, int *eof, void *data) | 1901 | (char *page, char **start, off_t off, int count, int *eof, void *data) |
1899 | { | 1902 | { |
@@ -1909,11 +1912,6 @@ static ide_proc_entry_t idefloppy_proc[] = { | |||
1909 | { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, | 1912 | { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, |
1910 | { NULL, 0, NULL, NULL } | 1913 | { NULL, 0, NULL, NULL } |
1911 | }; | 1914 | }; |
1912 | |||
1913 | #else | ||
1914 | |||
1915 | #define idefloppy_proc NULL | ||
1916 | |||
1917 | #endif /* CONFIG_IDE_PROC_FS */ | 1915 | #endif /* CONFIG_IDE_PROC_FS */ |
1918 | 1916 | ||
1919 | static int ide_floppy_probe(ide_drive_t *); | 1917 | static int ide_floppy_probe(ide_drive_t *); |
@@ -1933,7 +1931,9 @@ static ide_driver_t idefloppy_driver = { | |||
1933 | .end_request = idefloppy_do_end_request, | 1931 | .end_request = idefloppy_do_end_request, |
1934 | .error = __ide_error, | 1932 | .error = __ide_error, |
1935 | .abort = __ide_abort, | 1933 | .abort = __ide_abort, |
1934 | #ifdef CONFIG_IDE_PROC_FS | ||
1936 | .proc = idefloppy_proc, | 1935 | .proc = idefloppy_proc, |
1936 | #endif | ||
1937 | }; | 1937 | }; |
1938 | 1938 | ||
1939 | static int idefloppy_open(struct inode *inode, struct file *filp) | 1939 | static int idefloppy_open(struct inode *inode, struct file *filp) |
@@ -2159,7 +2159,7 @@ static int ide_floppy_probe(ide_drive_t *drive) | |||
2159 | 2159 | ||
2160 | ide_init_disk(g, drive); | 2160 | ide_init_disk(g, drive); |
2161 | 2161 | ||
2162 | ide_register_subdriver(drive, &idefloppy_driver); | 2162 | ide_proc_register_driver(drive, &idefloppy_driver); |
2163 | 2163 | ||
2164 | kref_init(&floppy->kref); | 2164 | kref_init(&floppy->kref); |
2165 | 2165 | ||