Commit Graph

1156 Commits (807b90d0be23b8d088d4369b02539dada70f03f4)

Author SHA1 Message Date
Bartlomiej Zolnierkiewicz 807b90d0be ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags
* Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
  (both are used only by cs5520 host driver currently).

* Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
  ide_hwif_t field.

* Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
  host drivers to use it.

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:40 +01:00
Bartlomiej Zolnierkiewicz 7704ca2a3e ide: factor out code initializing devices from ide_init_port()
* Factor out code initializing devices from ide_init_port() to
  ide_port_init_devices().

* Call the new function from ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz 909f4369bc ide: fix ide_unregister() usage in host drivers
bast-ide.c/ide-cs.c/delkin_cb.c:

* Don't set 'restore' flag for ide_unregister() when initializing new
  interface.

rapide.c/ide-pnp.c/ide-cs.c/ide_platform.c/au1xxx-ide.c/delkin_cb.c/scc_pata.c:

* Don't set 'init_default' and 'restore' flags for ide_unregister() when
  removing interface.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz 9e016a7192 ide: add ide_deprecated_find_port() helper
* Factor out code for finding ide_hwifs[] slot from ide_register_hw()
  to ide_deprecated_find_port().

* Convert bast-ide, ide-cs and delkin_cb host drivers to use ide_device_add()
  instead of ide_register_hw() (while at it drop doing "ide_unregister()" loop
  which tries to unregister _all_ IDE interfaces if useable ide_hwifs[] slot
  cannot be find).

This patch leaves us with only two ide_register_hw() users:
- drivers/macintosh/mediabay.c
- drivers/ide/ide.c

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz f82c2b1719 ide: add 'init_default' and 'restore' arguments to ide_unregister()
* Add 'init_default' (flag for calling init_hwif_default()) and 'restore'
  (flag for calling ide_hwif_restore()) arguments to ide_unregister().

* Update ide_unregister() users to set 'init_default' and 'restore' flags.

* No need to set 'init_default' flag in ide_register_hw() if the setup done
  by init_hwif_default() is going to be overridden by ide_init_port_hw().

* No need to set 'init_default' and 'restore' flags in cleanup_module().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:39 +01:00
Bartlomiej Zolnierkiewicz ead741df38 ide: remove redundant init_hwif_default() call from ide_register_hw()
ide_init_port_hw() call overrides setup done by init_hwif_default().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Bartlomiej Zolnierkiewicz 2244e85063 ide: remove redundant hwif->present check from ide_register_hw()
We check earlier for hwif->present and call ide_unregister() if necessary
(after ide_unregister() hwif->present will be always cleared).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Alan Cox 1bee4d1dce pdc202xx_old: remove surplus initialiser
Bart:
- drive-by CodingStyle fixups

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov fc6c5bc7c1 ide-floppy: bump driver version number
Acknowledge major ide-floppy code refactoring and cleanup by bumping the driver
version number. Also, remove a wrong comment.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov 0571c7a4f5 ide-floppy: fix most of the remaining checkpatch.pl issues
such as
ERROR: switch and case should be at the same indent
ERROR: need spaces around that '=' (ctx:VxV)
ERROR: trailing statements should be on next line
WARNING: no space between function name and open parenthesis '('
WARNING: printk() should include KERN_ facility level
ERROR: That open brace { should be on the previous line
ERROR: use tabs not spaces
ERROR: do not use assignment in if condition
WARNING: braces {} are not necessary for single statement blocks
ERROR: need space after that ',' (ctx:VxV)
WARNING: line over 80 characters
ERROR: do not use assignment in if condition
...
and so on.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:38 +01:00
Borislav Petkov 6e5fa7b88c ide-floppy: remove atomic test_*bit macros
..and replace them with flag enums.

Bart:
- fix idefloppy_media_changed() return value

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:37 +01:00
Borislav Petkov 757ced8983 ide-floppy: remove unused flag PC_ABORT
This flag was never being set in the code so remove it. By the way, the
code in the second patch was being executed unconditionally, i.e. in case
pc->retries > IDEFLOPPY_MAX_PC_RETRIES is true (actually that is the only case
when the outer if-test passed), !test_bit(PC_ABORT, &pc->flags)
was always true so the comment is now incorrect and has to go.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:37 +01:00
Borislav Petkov f373bd820d ide-floppy: remove IDEFLOPPY_DEBUG_INFO
This info is already available through ioctl() and /proc

Bart:
- dump 'gcw.packet_size' for unsupported packet sizes

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov ae7e8ddc34 ide-floppy: remove unused IDEFLOPPY_USE_READ12
This flag is not being set anywhere in the driver so it can go.

Bart:
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 32925e1a16 ide-floppy: merge idefloppy_{input,output}_buffers
We merge idefloppy_{input,output}_buffers() into idefloppy_io_buffers() by
introducing a 4th arg. called direction. According to its value
we atapi_input_bytes() or atapi_output_bytes(). Also, this simplifies the
interrupt handler logic a bit. Finally, rename idefloppy_io_buffers() to
ide_floppy_io_buffers().

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 0eea6458c0 ide-floppy: use an xfer_func_t and io_buf_t typedefs in order to unify rw
Also, move xfer_func_t typedef to the ide.h since it is used by two drivers
now (more coming).

Bart:
- use __func__ while at it

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov 0bf399e69c ide-floppy: remove IDEFLOPPY_DEBUG_BUGS macro
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:36 +01:00
Borislav Petkov d652c13808 ide-floppy: mv idefloppy_{should_,}report_error
In addition to shortening the function name, move the printk-call into the
function thereby saving some code lines. Also, make the function out_of_line
since it is not on a performance critical path. Finally, rename the reworked
function to ide_floppy..().

Bart:
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov d30a7fba43 ide-floppy: report DMA handling in idefloppy_pc_intr() properly
Bart:
- use 'hwif' instead of 'HWIF(drive)'
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 20bf7bdad4 ide-floppy: factor out ioctl handlers from idefloppy_ioctl()
By passing idefloppy_floppy_t *floppy to the factored out functions, we get
rid of (almost) all local vars so stack usage should be at minimum here. Also,
we merge idefloppy_begin_format() into idefloppy_format_start() since it is its
only user. Also, rename idefloppy_format_start() to idefloppy_format_unit().
Finally, rename the reworked functions to ide_floppy..().

Bart
- minor CodingStyle fixup

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 194ec0c078 ide-floppy: remove struct idefloppy_capacity_descriptor
Also,
- remove the accompanying 4 byte idefloppy_capacity_header.
- rename functions from idefloppy_... to ide_floppy_... after cleanup.
- simplify loop in ide_floppy_get_capacity() by reversing if-test condition
  logically.
- finally, fix white space and checkpatch.pl issues

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 8e81bbba72 ide-floppy: remove struct idefloppy_flexible_disk_page
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:35 +01:00
Borislav Petkov 24a5d7033b ide-floppy: remove struct idefloppy_mode_parameter_header
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov a6ff2d3b08 ide-floppy: remove struct idefloppy_request_sense_result
While at it, collapse idefloppy_analyze_error() into
idefloppy_request_sense_callback() since the latter was its only user.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 4d37d32e4a ide-floppy: remove struct idefloppy_inquiry_result
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 948391d17c ide-floppy: remove struct idefloppy_capabilities_page
This change is rather temporary and is in preparation of using generic commands
as is the case with ide-cd and the uniform cdrom layer (i.e. init_cdrom_command())
However, before this happens, we'll have to remove all typedefs and teach
idefloppy_create_mode_sense_cmd() to work directly on u8 buffers.

Also, since idefloppy_get_capability_page() was used to read only the sfrp bit,
rename the latter so that the name reflects what it does.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov bcc77d9cc1 ide-floppy: cleanup and unify debugging macro calls
* some debug_log() calls were not using "ide-floppy: " prefix

* a few used printk levels different than KERN_INFO (KERN_NOTICE
  and KERN_ERR, which is the default one if no level is given)

Bart:
- fix build issues for IDEFLOPPY_DEBUG_LOG set to 1 while at it
- s/__FUNCTION__/__func__/

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 7e8b163b25 ide-floppy: include the proper headers
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:34 +01:00
Borislav Petkov 9a24b63db0 ide-floppy: disambiguate function names
There were two almost identical function names in ide-floppy.c, which makes
their distinction almost impossible. While ide_floppy_release() cleans up the
object after the last reference to it has been dropped, idefloppy_release() is
the blkdev .release method from struct block_device_operations which releases
that last reference.

Rename ide_floppy_release() to idefloppy_cleanup_obj() in order to make its
purpose more clear.

There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 0078df2ece ide-floppy: remove unnecessary ->handler != NULL check
This BUG_ON is unneeded since the ->handler != NULL check is performed in
ide_set_handler().

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 8f6224308b ide-floppy: replace ntoh{s,l} and hton{s,l} calls with the generic byteorder
Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Borislav Petkov 30d6709938 ide-floppy: convert to generic packet commands
Replace the ide-floppy packet commands opcode defines with the generic ones.
Add a missing GPCMD_WRITE_12 (opcode 0xaa) to the generic ones in cdrom.h. The
last one can be found in the current version of INF-8090, p.905.

[ Bart: Tejun's libata patch also adding GPCMD_WRITE_12 got merged first ]

Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Bartlomiej Zolnierkiewicz 78829dd922 ide: remove needless includes from PCI host drivers
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:33 +01:00
Bartlomiej Zolnierkiewicz bfa14b42a3 ide: add ->cable_detect method to ide_hwif_t
* Add ->cable_detect method to ide_hwif_t.

* Call the new method in ide_init_port() if:
  - the host supports UDMA modes > UDMA2 ('hwif->ultra_mask & 78')
  - DMA initialization was successful (if hwif->dma_base is not set
    ide_init_port() sets hwif->ultra_mask to zero)
  - "idex=ata66" is not used ('hwif->cbl != ATA_CBL_PATA40_SHORT')

* Convert PCI host drivers to use ->cable_detect method.

While at it:

* Factor out cable detection to separate functions (if not already done).

* hpt366.c/it8213.c/slc90e66.c:
  - don't check cable type if "idex=ata66" is used

* pdc202xx_new.c:
  - add __devinit tag to pdcnew_cable_detect()

* pdc202xx_old.c:
  - rename pdc202xx_old_cable_detect() to pdc2026x_old_cable_detect()
  - add __devinit tag to pdc2026x_old_cable_detect()

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz c413b9b94d ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().

* Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.

* Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().

* Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
  move it to ide-probe.c and call it in in ide_device_add_all() instead of
  ide_pci_setup_ports().

* Move ->mate setup to ide_device_add_all() from ide_port_init().

* Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
  ->autotune currently.

* Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
  (to not override setup done by ide_hwif_configure()).

* Add ETRAX host handling to ide_device_add_all().

* cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.

* pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
  setup to pmac_ide_setup_device().

* Add 'struct ide_port_info' instances to legacy host drivers, pass them to
  ide_device_add() calls and then remove open-coded ports initialization.

Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:31 +01:00
Bartlomiej Zolnierkiewicz 1ebf74936b ide: separate PCI specific init from generic init in ide_pci_setup_ports()
* Setup ->mate and ->channel in ide_pci_setup_ports() instead of
  in ide_hwif_configure().

* Make 'port' parameter for ide_hwif_configure() 'unsigned int'.

* Separate PCI specific init from generic init in ide_pci_setup_ports().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz bf77c53171 ide: always set DMA masks in ide_pci_setup_ports()
Always set DMA masks in ide_pci_setup_ports() to make sure that the valid
masks for a host are set.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz d4e6d4eb16 macide: remove drive->capacity64 quirk
Nowadays IDE core always provides drive ID and ide-disk always setups
drive->capacity64 so this quirk is no longer needed.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:30 +01:00
Bartlomiej Zolnierkiewicz b4d1c73dcd atiixp/cs5535/scc_pata: fix "idex=ata66" parameter handling
Don't override the cable type if the "idex=ata66" parameter was used.

While at it:

* atiixp.c: factor out cable detection to atiixp_cable_detect() from
  init_hwif_atiixp().

* cs5535.c: pass 'ide_hwif_t *hwif' instead of 'struct pci_dev *dev' to
  cs5535_cable_detect().

* scc_pata.c: factor out cable detection to scc_cable_detect() from
  init_hwif_scc() and remove incorrect comment.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:29 +01:00
Bartlomiej Zolnierkiewicz bd38dd3c13 au1xxx-ide: fix ->io_32bit handling
The host driver must set hwif's ->no_io_32bit setting not drive's one
(ide_port_tune_devices() overrides drive's setting).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:29 +01:00
Bartlomiej Zolnierkiewicz 36e9dc469b dtc2278: fix ->io_32bit handling
On DTC2278 32-bit I/O has to be enabled for both devices on the port
so always enable it during init time and disallow further changes.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02 19:56:28 +01:00
Linus Torvalds 215e871aaa Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/pci-2.6: (64 commits)
  PCI: make pci_bus a struct device
  PCI: fix codingstyle issues in include/linux/pci.h
  PCI: fix codingstyle issues in drivers/pci/pci.h
  PCI: PCIE ASPM support
  PCI: Fix fakephp deadlock
  PCI: modify SB700 SATA MSI quirk
  PCI: Run ACPI _OSC method on root bridges only
  PCI ACPI: AER driver should only register PCIe devices with _OSC
  PCI ACPI: Added a function to register _OSC with only PCIe devices.
  PCI: constify function pointer tables
  PCI: Convert drivers/pci/proc.c to use unlocked_ioctl
  pciehp: block new requests from the device before power off
  pciehp: workaround against Bad DLLP during power off
  pciehp: wait for 1000ms before LED operation after power off
  PCI: Remove pci_enable_device_bars() from documentation
  PCI: Remove pci_enable_device_bars()
  PCI: Remove users of pci_enable_device_bars()
  PCI: Add pci_enable_device_{io,mem} intefaces
  PCI: avoid save the same type of cap multiple times
  PCI: correctly initialize a structure for pcie_save_pcix_state()
  ...
2008-02-02 14:29:33 +11:00
Benjamin Herrenschmidt 0948391641 PCI: Remove users of pci_enable_device_bars()
This patch converts users of pci_enable_device_bars() to the new
pci_enable_device_{io,mem} interface.

The new API fits nicely, except maybe for the QLA case where a bit of
code re-organization might be a good idea but I prefer sticking to the
simple patch as I don't have hardware to test on.

I'll also need some feedback on the cs5520 change.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-02-01 15:04:27 -08:00
Bartlomiej Zolnierkiewicz a14dc57495 ide: move hwif_register() call out of ide_probe_port()
* Add BUG_ON(hwif->present) at the start of ide_probe_port().

* Move hwif_register() call (along with setting hwif->present) from
  ide_probe_port() to ide_device_add_all().

  As a result the port will be registered with the device tree _after_:
  - probing both devices (if both are present)
  - port reset (if hwif->reset is set)
  - restoring local IRQs state and re-enabling port IRQ

While at it:

* Rename hwif_register() to ide_register_port().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz e84e7ea7c4 ide: factor out code for tuning devices from ide_probe_port()
* Factor out code for tuning devices from ide_probe_port()
  to ide_port_tune_devices().

* Move ide_port_tune_devices() call from ide_probe_port()
  to ide_device_add_all().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz 139ddfcab5 ide: move handling of I/O resources out of ide_probe_port()
Reserve/release I/O resources in ide_device_add_all() instead of
ide_probe_port().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz 9d501529b6 ide: make probe_hwif() return an error value
Make probe_hwif() return an error value.

While at it:

* Remove comment about MAX_DRIVES == 2 limitation (it is not special to
  probe_hwif(), it is a general assumption taken by a lot of IDE code).

* Rename probe_hwif() to ide_probe_port().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz fbd130887a ide: use ide_remove_port_from_hwgroup in init_irq()
There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz cae5c82022 ide: prepare init_irq() for using ide_remove_port_from_hwgroup()
* BUG_ON() early if 'hwif->next == hwif' and there is a 'match' hwgroup.

* Remove printk() for impossible condition and add a BUG_ON(hwgroup->drive)
  to match code in ide_unregister().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:36 +01:00
Bartlomiej Zolnierkiewicz 96e5ad309c ide: factor out code removing port from hwgroup from ide_unregister()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01 23:09:35 +01:00