diff options
author | Tejun Heo <htejun@gmail.com> | 2007-08-06 05:36:23 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:31 -0400 |
commit | cc0680a580b5be81a1ca321b58f8e9b80b5c1052 (patch) | |
tree | 57454cdfdc9890f4e8d9f532e9cd240c7361951f /drivers/ata/sata_mv.c | |
parent | 955e57dfde4ff75e4d7329ac7a3d645b16015309 (diff) |
libata-link: linkify reset
Make reset methods and related functions deal with ata_link instead of
ata_port.
* ata_do_reset()
* ata_eh_reset()
* all prereset/reset/postreset methods and related functions
This patch introduces no behavior change.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 8e63c60adaff..56784ce10544 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -2266,10 +2266,11 @@ comreset_retry: | |||
2266 | VPRINTK("EXIT\n"); | 2266 | VPRINTK("EXIT\n"); |
2267 | } | 2267 | } |
2268 | 2268 | ||
2269 | static int mv_prereset(struct ata_port *ap, unsigned long deadline) | 2269 | static int mv_prereset(struct ata_link *link, unsigned long deadline) |
2270 | { | 2270 | { |
2271 | struct ata_port *ap = link->ap; | ||
2271 | struct mv_port_priv *pp = ap->private_data; | 2272 | struct mv_port_priv *pp = ap->private_data; |
2272 | struct ata_eh_context *ehc = &ap->link.eh_context; | 2273 | struct ata_eh_context *ehc = &link->eh_context; |
2273 | int rc; | 2274 | int rc; |
2274 | 2275 | ||
2275 | rc = mv_stop_dma(ap); | 2276 | rc = mv_stop_dma(ap); |
@@ -2285,7 +2286,7 @@ static int mv_prereset(struct ata_port *ap, unsigned long deadline) | |||
2285 | if (ehc->i.action & ATA_EH_HARDRESET) | 2286 | if (ehc->i.action & ATA_EH_HARDRESET) |
2286 | return 0; | 2287 | return 0; |
2287 | 2288 | ||
2288 | if (ata_link_online(&ap->link)) | 2289 | if (ata_link_online(link)) |
2289 | rc = ata_wait_ready(ap, deadline); | 2290 | rc = ata_wait_ready(ap, deadline); |
2290 | else | 2291 | else |
2291 | rc = -ENODEV; | 2292 | rc = -ENODEV; |
@@ -2293,9 +2294,10 @@ static int mv_prereset(struct ata_port *ap, unsigned long deadline) | |||
2293 | return rc; | 2294 | return rc; |
2294 | } | 2295 | } |
2295 | 2296 | ||
2296 | static int mv_hardreset(struct ata_port *ap, unsigned int *class, | 2297 | static int mv_hardreset(struct ata_link *link, unsigned int *class, |
2297 | unsigned long deadline) | 2298 | unsigned long deadline) |
2298 | { | 2299 | { |
2300 | struct ata_port *ap = link->ap; | ||
2299 | struct mv_host_priv *hpriv = ap->host->private_data; | 2301 | struct mv_host_priv *hpriv = ap->host->private_data; |
2300 | void __iomem *mmio = ap->host->iomap[MV_PRIMARY_BAR]; | 2302 | void __iomem *mmio = ap->host->iomap[MV_PRIMARY_BAR]; |
2301 | 2303 | ||
@@ -2308,16 +2310,17 @@ static int mv_hardreset(struct ata_port *ap, unsigned int *class, | |||
2308 | return 0; | 2310 | return 0; |
2309 | } | 2311 | } |
2310 | 2312 | ||
2311 | static void mv_postreset(struct ata_port *ap, unsigned int *classes) | 2313 | static void mv_postreset(struct ata_link *link, unsigned int *classes) |
2312 | { | 2314 | { |
2315 | struct ata_port *ap = link->ap; | ||
2313 | u32 serr; | 2316 | u32 serr; |
2314 | 2317 | ||
2315 | /* print link status */ | 2318 | /* print link status */ |
2316 | sata_print_link_status(&ap->link); | 2319 | sata_print_link_status(link); |
2317 | 2320 | ||
2318 | /* clear SError */ | 2321 | /* clear SError */ |
2319 | sata_scr_read(&ap->link, SCR_ERROR, &serr); | 2322 | sata_scr_read(link, SCR_ERROR, &serr); |
2320 | sata_scr_write_flush(&ap->link, SCR_ERROR, serr); | 2323 | sata_scr_write_flush(link, SCR_ERROR, serr); |
2321 | 2324 | ||
2322 | /* bail out if no device is present */ | 2325 | /* bail out if no device is present */ |
2323 | if (classes[0] == ATA_DEV_NONE && classes[1] == ATA_DEV_NONE) { | 2326 | if (classes[0] == ATA_DEV_NONE && classes[1] == ATA_DEV_NONE) { |