libata-link: implement and use link/device iterators
authorTejun Heo <htejun@gmail.com>
Mon, 6 Aug 2007 09:36:23 +0000 (18:36 +0900)
committerJeff Garzik <jeff@garzik.org>
Fri, 12 Oct 2007 18:55:30 +0000 (14:55 -0400)
commitf58229f8060055b08b34008ea08f31de1e2f003c
tree6ca5ef546671cb975ef3632fb032c238eaf1bb4c
parent9af5c9c97dc9d599281778864c72b385f0c63341
libata-link: implement and use link/device iterators

Multiple links and different number of devices per link should be
considered to iterate over links and devices.  This patch implements
and uses link and device iterators - ata_port_for_each_link() and
ata_link_for_each_dev() - and ata_link_max_devices().

This change makes a lot of functions iterate over only possible
devices instead of from dev 0 to dev ATA_MAX_DEVICES.  All such
changes have been examined and nothing should be broken.

While at it, add a separating comment before device helpers to
distinguish them better from link helpers and others.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
13 files changed:
drivers/ata/ata_generic.c
drivers/ata/libata-acpi.c
drivers/ata/libata-core.c
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
drivers/ata/pata_it821x.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_legacy.c
drivers/ata/pata_pdc2027x.c
drivers/ata/pata_platform.c
drivers/ata/pata_rz1000.c
drivers/ata/sata_sil.c
include/linux/libata.h