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:30 -0400 |
commit | 955e57dfde4ff75e4d7329ac7a3d645b16015309 (patch) | |
tree | 8d1527aa575535963709dbef5133c81a1e519eb2 | |
parent | 936fd7328657884d5a69a55666c74a55aa83ca27 (diff) |
libata-link: linkify EH action helpers
Make ata_eh_about_to_do() and ata_eh_done() deal with ata_link instead
of ata_port.
This patch introduces no behavior change.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/ata/libata-eh.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 48ca68b3979b..fc4b6413b192 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -947,23 +947,24 @@ static void ata_eh_detach_dev(struct ata_device *dev) | |||
947 | 947 | ||
948 | /** | 948 | /** |
949 | * ata_eh_about_to_do - about to perform eh_action | 949 | * ata_eh_about_to_do - about to perform eh_action |
950 | * @ap: target ATA port | 950 | * @link: target ATA link |
951 | * @dev: target ATA dev for per-dev action (can be NULL) | 951 | * @dev: target ATA dev for per-dev action (can be NULL) |
952 | * @action: action about to be performed | 952 | * @action: action about to be performed |
953 | * | 953 | * |
954 | * Called just before performing EH actions to clear related bits | 954 | * Called just before performing EH actions to clear related bits |
955 | * in @ap->link.eh_info such that eh actions are not | 955 | * in @link->eh_info such that eh actions are not unnecessarily |
956 | * unnecessarily repeated. | 956 | * repeated. |
957 | * | 957 | * |
958 | * LOCKING: | 958 | * LOCKING: |
959 | * None. | 959 | * None. |
960 | */ | 960 | */ |
961 | static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, | 961 | static void ata_eh_about_to_do(struct ata_link *link, struct ata_device *dev, |
962 | unsigned int action) | 962 | unsigned int action) |
963 | { | 963 | { |
964 | struct ata_port *ap = link->ap; | ||
965 | struct ata_eh_info *ehi = &link->eh_info; | ||
966 | struct ata_eh_context *ehc = &link->eh_context; | ||
964 | unsigned long flags; | 967 | unsigned long flags; |
965 | struct ata_eh_info *ehi = &ap->link.eh_info; | ||
966 | struct ata_eh_context *ehc = &ap->link.eh_context; | ||
967 | 968 | ||
968 | spin_lock_irqsave(ap->lock, flags); | 969 | spin_lock_irqsave(ap->lock, flags); |
969 | 970 | ||
@@ -980,7 +981,7 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, | |||
980 | ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK; | 981 | ehi->flags &= ~ATA_EHI_RESET_MODIFIER_MASK; |
981 | } | 982 | } |
982 | 983 | ||
983 | ata_eh_clear_action(&ap->link, dev, ehi, action); | 984 | ata_eh_clear_action(link, dev, ehi, action); |
984 | 985 | ||
985 | if (!(ehc->i.flags & ATA_EHI_QUIET)) | 986 | if (!(ehc->i.flags & ATA_EHI_QUIET)) |
986 | ap->pflags |= ATA_PFLAG_RECOVERED; | 987 | ap->pflags |= ATA_PFLAG_RECOVERED; |
@@ -990,20 +991,20 @@ static void ata_eh_about_to_do(struct ata_port *ap, struct ata_device *dev, | |||
990 | 991 | ||
991 | /** | 992 | /** |
992 | * ata_eh_done - EH action complete | 993 | * ata_eh_done - EH action complete |
993 | * @ap: target ATA port | 994 | * @ap: target ATA port |
994 | * @dev: target ATA dev for per-dev action (can be NULL) | 995 | * @dev: target ATA dev for per-dev action (can be NULL) |
995 | * @action: action just completed | 996 | * @action: action just completed |
996 | * | 997 | * |
997 | * Called right after performing EH actions to clear related bits | 998 | * Called right after performing EH actions to clear related bits |
998 | * in @ap->link.eh_context. | 999 | * in @link->eh_context. |
999 | * | 1000 | * |
1000 | * LOCKING: | 1001 | * LOCKING: |
1001 | * None. | 1002 | * None. |
1002 | */ | 1003 | */ |
1003 | static void ata_eh_done(struct ata_port *ap, struct ata_device *dev, | 1004 | static void ata_eh_done(struct ata_link *link, struct ata_device *dev, |
1004 | unsigned int action) | 1005 | unsigned int action) |
1005 | { | 1006 | { |
1006 | struct ata_eh_context *ehc = &ap->link.eh_context; | 1007 | struct ata_eh_context *ehc = &link->eh_context; |
1007 | 1008 | ||
1008 | /* if reset is complete, clear all reset actions & reset modifier */ | 1009 | /* if reset is complete, clear all reset actions & reset modifier */ |
1009 | if (action & ATA_EH_RESET_MASK) { | 1010 | if (action & ATA_EH_RESET_MASK) { |
@@ -1011,7 +1012,7 @@ static void ata_eh_done(struct ata_port *ap, struct ata_device *dev, | |||
1011 | ehc->i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK; | 1012 | ehc->i.flags &= ~ATA_EHI_RESET_MODIFIER_MASK; |
1012 | } | 1013 | } |
1013 | 1014 | ||
1014 | ata_eh_clear_action(&ap->link, dev, &ehc->i, action); | 1015 | ata_eh_clear_action(link, dev, &ehc->i, action); |
1015 | } | 1016 | } |
1016 | 1017 | ||
1017 | /** | 1018 | /** |
@@ -1795,7 +1796,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1795 | int rc; | 1796 | int rc; |
1796 | 1797 | ||
1797 | /* about to reset */ | 1798 | /* about to reset */ |
1798 | ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK); | 1799 | ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK); |
1799 | 1800 | ||
1800 | /* Determine which reset to use and record in ehc->i.action. | 1801 | /* Determine which reset to use and record in ehc->i.action. |
1801 | * prereset() may examine and modify it. | 1802 | * prereset() may examine and modify it. |
@@ -1877,7 +1878,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1877 | goto out; | 1878 | goto out; |
1878 | } | 1879 | } |
1879 | 1880 | ||
1880 | ata_eh_about_to_do(ap, NULL, ATA_EH_RESET_MASK); | 1881 | ata_eh_about_to_do(link, NULL, ATA_EH_RESET_MASK); |
1881 | rc = ata_do_reset(ap, reset, classes, deadline); | 1882 | rc = ata_do_reset(ap, reset, classes, deadline); |
1882 | 1883 | ||
1883 | if (rc == 0 && classify && | 1884 | if (rc == 0 && classify && |
@@ -1927,7 +1928,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1927 | postreset(ap, classes); | 1928 | postreset(ap, classes); |
1928 | 1929 | ||
1929 | /* reset successful, schedule revalidation */ | 1930 | /* reset successful, schedule revalidation */ |
1930 | ata_eh_done(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK); | 1931 | ata_eh_done(link, NULL, ehc->i.action & ATA_EH_RESET_MASK); |
1931 | ehc->i.action |= ATA_EH_REVALIDATE; | 1932 | ehc->i.action |= ATA_EH_REVALIDATE; |
1932 | } | 1933 | } |
1933 | out: | 1934 | out: |
@@ -1964,12 +1965,12 @@ static int ata_eh_revalidate_and_attach(struct ata_port *ap, | |||
1964 | goto err; | 1965 | goto err; |
1965 | } | 1966 | } |
1966 | 1967 | ||
1967 | ata_eh_about_to_do(ap, dev, ATA_EH_REVALIDATE); | 1968 | ata_eh_about_to_do(&ap->link, dev, ATA_EH_REVALIDATE); |
1968 | rc = ata_dev_revalidate(dev, readid_flags); | 1969 | rc = ata_dev_revalidate(dev, readid_flags); |
1969 | if (rc) | 1970 | if (rc) |
1970 | goto err; | 1971 | goto err; |
1971 | 1972 | ||
1972 | ata_eh_done(ap, dev, ATA_EH_REVALIDATE); | 1973 | ata_eh_done(&ap->link, dev, ATA_EH_REVALIDATE); |
1973 | 1974 | ||
1974 | /* Configuration may have changed, reconfigure | 1975 | /* Configuration may have changed, reconfigure |
1975 | * transfer mode. | 1976 | * transfer mode. |