• Martin Dalecki's avatar
    [PATCH] 2.5.6-pre1 IDE clean 14 · 48ba6e98
    Martin Dalecki authored
    Most importantly this patch is making ide.c use the
    new automagic for module initialization lists and further
    preparing the rest of the code in question here for proper
    module separation. Despite this the CMOS probe has been removed
    as well... *Iff*, which I don't expect, this breaks anything
    it can be reintroduced easely. During this effort an actual bug
    in the initialization of the main module has been uncovered as well.
    a quite serious BUG has been tagged in ide-scsi.c as well, but
    as far as now I just didn't get along to actually fixing it.
    (The patch is big enough as it is).
    
    Details follow:
    
    - Kill *unused* ide_media_verbose() funciton.
    
    - Remove the unnecessary media and supports_dma fields from
        ide_driver_t.
    
    - Remove the global name field from ide_driver_t struct by pushing it
        down to the places where it's actually used.
    
    - Remove the unused hwif_data field from ide_hwif_t.
    
    - Push the supports_dsc_overlap condition up to the level where it
        belongs: disk type as well.
    
    - Make the initialization of ide main ide.c work with the new module
        initialization auto-magic instead of calling it explicitly in
        ll_rw_block.c This prevents the ide_init() from being called twice. We
        have BTW. renamed it to ata_module_init(), since  ata is more adequate
        then ide and xxx_module_init corresponds better to the naming
        conventions used elsewhere throughout the kernel.
    
        This BUG was there before any ide-clean.  It was worked around by a
        magic variable preventing the second call to succeed.  We have removed
        this variable in one of the previous patches and thus uncovered it.
    
    - Kill proc_ide_read_driver() and proc_ide_write_driver(). The drivers
        already report on syslog which drives they have taken care of.  (Or
        at least they should). In esp. the proc_ide_write_driver() was just
        too offending for me.  Beleve it or not the purpose of it was to
        *request a particular* driver for a device, by echoing some magic
        values to a magic file...
        More importantly this "back door" was getting in the way of a properly
        done modularization of the IDE stuff.
    
    - Made some not externally used functions static or not EXPORT-ed.
    
    - Provide the start of a proper modularization between the main module
        and drivers for particular device types. Changing the name-space
        polluting DRIVER() macro to ata_ops() showed how inconsistently the
        busy (read: module  busy!) field from ide_driver_t
        is currently used across the    different device type modules.
        This has to be fixed soon.
    
    - Make the ide code use the similar device type ID numbers as the SCSI
        code :-).  This is just tedious, but it will help in a distant
        feature. It helps reading the code anyway.
    
    - Mark repettitive code with /* ATA-PATTERN */ comments for later
        consolidation at places where we did came across it.
    
    - Various comments and notes added where some explanations was missing.
    48ba6e98
piix.c 15.1 KB