From c961922b73dab429a759f560952fd4c3f60bd6b3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 26 Sep 2006 17:53:38 +0100 Subject: [PATCH] libata-eh: Remove layering violation and duplication when handling absent ports This removes the layering violation where drivers have to fiddle directly with EH flags. Instead we now recognize -ENOENT means "no port" and do the handling in the core code. This also removes an instance of a call to disable the port, and an identical printk from each driver doing this. Even better - future rule changes will be in one place only. Signed-off-by: Alan Cox Signed-off-by: Jeff Garzik --- drivers/ata/libata-eh.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/ata/libata-eh.c') diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 3fa80f0..02b2b27 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1515,7 +1515,11 @@ static int ata_eh_reset(struct ata_port *ap, int classify, if (prereset) { rc = prereset(ap); if (rc) { - ata_port_printk(ap, KERN_ERR, + if (rc == -ENOENT) { + ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n"); + ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; + } else + ata_port_printk(ap, KERN_ERR, "prereset failed (errno=%d)\n", rc); return rc; } -- cgit v1.1