diff options
author | Tejun Heo <htejun@gmail.com> | 2008-04-07 09:47:16 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:21 -0400 |
commit | 9363c3825ea9ad76561eb48a395349dd29211ed6 (patch) | |
tree | abe89a0f7c82b805d84b1a211c97b317f6628d5f /drivers/ata/pata_bf54x.c | |
parent | b67a1064cb1c1d3b43e01e8b43a6a8dcdefed733 (diff) |
libata: rename SFF functions
SFF functions have confusing names. Some have sff prefix, some have
bmdma, some std, some pci and some none. Unify the naming by...
* SFF functions which are common to both BMDMA and non-BMDMA are
prefixed with ata_sff_.
* SFF functions which are specific to BMDMA are prefixed with
ata_bmdma_.
* SFF functions which are specific to PCI but apply to both BMDMA and
non-BMDMA are prefixed with ata_pci_sff_.
* SFF functions which are specific to PCI and BMDMA are prefixed with
ata_pci_bmdma_.
* Drop generic prefixes from LLD specific routines. For example,
bfin_std_dev_select -> bfin_dev_select.
The following renames are noteworthy.
ata_qc_issue_prot() -> ata_sff_qc_issue()
ata_pci_default_filter() -> ata_bmdma_mode_filter()
ata_dev_try_classify() -> ata_sff_dev_classify()
This rename is in preparation of separating SFF support out of libata
core layer. This patch strictly renames functions and doesn't
introduce any behavior difference.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/ata/pata_bf54x.c')
-rw-r--r-- | drivers/ata/pata_bf54x.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c index 457ac800cd5e..c854e882d4a9 100644 --- a/drivers/ata/pata_bf54x.c +++ b/drivers/ata/pata_bf54x.c | |||
@@ -674,7 +674,7 @@ static void read_atapi_data(void __iomem *base, | |||
674 | * @ap: Port to which output is sent | 674 | * @ap: Port to which output is sent |
675 | * @tf: ATA taskfile register set | 675 | * @tf: ATA taskfile register set |
676 | * | 676 | * |
677 | * Note: Original code is ata_tf_load(). | 677 | * Note: Original code is ata_sff_tf_load(). |
678 | */ | 678 | */ |
679 | 679 | ||
680 | static void bfin_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | 680 | static void bfin_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) |
@@ -745,7 +745,7 @@ static u8 bfin_check_status(struct ata_port *ap) | |||
745 | * @ap: Port from which input is read | 745 | * @ap: Port from which input is read |
746 | * @tf: ATA taskfile register set for storing input | 746 | * @tf: ATA taskfile register set for storing input |
747 | * | 747 | * |
748 | * Note: Original code is ata_tf_read(). | 748 | * Note: Original code is ata_sff_tf_read(). |
749 | */ | 749 | */ |
750 | 750 | ||
751 | static void bfin_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | 751 | static void bfin_tf_read(struct ata_port *ap, struct ata_taskfile *tf) |
@@ -775,7 +775,7 @@ static void bfin_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | |||
775 | * @ap: port to which command is being issued | 775 | * @ap: port to which command is being issued |
776 | * @tf: ATA taskfile register set | 776 | * @tf: ATA taskfile register set |
777 | * | 777 | * |
778 | * Note: Original code is ata_exec_command(). | 778 | * Note: Original code is ata_sff_exec_command(). |
779 | */ | 779 | */ |
780 | 780 | ||
781 | static void bfin_exec_command(struct ata_port *ap, | 781 | static void bfin_exec_command(struct ata_port *ap, |
@@ -785,7 +785,7 @@ static void bfin_exec_command(struct ata_port *ap, | |||
785 | dev_dbg(ap->dev, "ata%u: cmd 0x%X\n", ap->print_id, tf->command); | 785 | dev_dbg(ap->dev, "ata%u: cmd 0x%X\n", ap->print_id, tf->command); |
786 | 786 | ||
787 | write_atapi_register(base, ATA_REG_CMD, tf->command); | 787 | write_atapi_register(base, ATA_REG_CMD, tf->command); |
788 | ata_pause(ap); | 788 | ata_sff_pause(ap); |
789 | } | 789 | } |
790 | 790 | ||
791 | /** | 791 | /** |
@@ -800,14 +800,14 @@ static u8 bfin_check_altstatus(struct ata_port *ap) | |||
800 | } | 800 | } |
801 | 801 | ||
802 | /** | 802 | /** |
803 | * bfin_std_dev_select - Select device 0/1 on ATA bus | 803 | * bfin_dev_select - Select device 0/1 on ATA bus |
804 | * @ap: ATA channel to manipulate | 804 | * @ap: ATA channel to manipulate |
805 | * @device: ATA device (numbered from zero) to select | 805 | * @device: ATA device (numbered from zero) to select |
806 | * | 806 | * |
807 | * Note: Original code is ata_std_dev_select(). | 807 | * Note: Original code is ata_sff_dev_select(). |
808 | */ | 808 | */ |
809 | 809 | ||
810 | static void bfin_std_dev_select(struct ata_port *ap, unsigned int device) | 810 | static void bfin_dev_select(struct ata_port *ap, unsigned int device) |
811 | { | 811 | { |
812 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; | 812 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; |
813 | u8 tmp; | 813 | u8 tmp; |
@@ -818,7 +818,7 @@ static void bfin_std_dev_select(struct ata_port *ap, unsigned int device) | |||
818 | tmp = ATA_DEVICE_OBS | ATA_DEV1; | 818 | tmp = ATA_DEVICE_OBS | ATA_DEV1; |
819 | 819 | ||
820 | write_atapi_register(base, ATA_REG_DEVICE, tmp); | 820 | write_atapi_register(base, ATA_REG_DEVICE, tmp); |
821 | ata_pause(ap); | 821 | ata_sff_pause(ap); |
822 | } | 822 | } |
823 | 823 | ||
824 | /** | 824 | /** |
@@ -977,7 +977,7 @@ static unsigned int bfin_devchk(struct ata_port *ap, | |||
977 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; | 977 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; |
978 | u8 nsect, lbal; | 978 | u8 nsect, lbal; |
979 | 979 | ||
980 | bfin_std_dev_select(ap, device); | 980 | bfin_dev_select(ap, device); |
981 | 981 | ||
982 | write_atapi_register(base, ATA_REG_NSECT, 0x55); | 982 | write_atapi_register(base, ATA_REG_NSECT, 0x55); |
983 | write_atapi_register(base, ATA_REG_LBAL, 0xaa); | 983 | write_atapi_register(base, ATA_REG_LBAL, 0xaa); |
@@ -1014,7 +1014,7 @@ static void bfin_bus_post_reset(struct ata_port *ap, unsigned int devmask) | |||
1014 | * BSY bit to clear | 1014 | * BSY bit to clear |
1015 | */ | 1015 | */ |
1016 | if (dev0) | 1016 | if (dev0) |
1017 | ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); | 1017 | ata_sff_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); |
1018 | 1018 | ||
1019 | /* if device 1 was found in ata_devchk, wait for | 1019 | /* if device 1 was found in ata_devchk, wait for |
1020 | * register access, then wait for BSY to clear | 1020 | * register access, then wait for BSY to clear |
@@ -1023,7 +1023,7 @@ static void bfin_bus_post_reset(struct ata_port *ap, unsigned int devmask) | |||
1023 | while (dev1) { | 1023 | while (dev1) { |
1024 | u8 nsect, lbal; | 1024 | u8 nsect, lbal; |
1025 | 1025 | ||
1026 | bfin_std_dev_select(ap, 1); | 1026 | bfin_dev_select(ap, 1); |
1027 | nsect = read_atapi_register(base, ATA_REG_NSECT); | 1027 | nsect = read_atapi_register(base, ATA_REG_NSECT); |
1028 | lbal = read_atapi_register(base, ATA_REG_LBAL); | 1028 | lbal = read_atapi_register(base, ATA_REG_LBAL); |
1029 | if ((nsect == 1) && (lbal == 1)) | 1029 | if ((nsect == 1) && (lbal == 1)) |
@@ -1035,14 +1035,14 @@ static void bfin_bus_post_reset(struct ata_port *ap, unsigned int devmask) | |||
1035 | msleep(50); /* give drive a breather */ | 1035 | msleep(50); /* give drive a breather */ |
1036 | } | 1036 | } |
1037 | if (dev1) | 1037 | if (dev1) |
1038 | ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); | 1038 | ata_sff_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT); |
1039 | 1039 | ||
1040 | /* is all this really necessary? */ | 1040 | /* is all this really necessary? */ |
1041 | bfin_std_dev_select(ap, 0); | 1041 | bfin_dev_select(ap, 0); |
1042 | if (dev1) | 1042 | if (dev1) |
1043 | bfin_std_dev_select(ap, 1); | 1043 | bfin_dev_select(ap, 1); |
1044 | if (dev0) | 1044 | if (dev0) |
1045 | bfin_std_dev_select(ap, 0); | 1045 | bfin_dev_select(ap, 0); |
1046 | } | 1046 | } |
1047 | 1047 | ||
1048 | /** | 1048 | /** |
@@ -1088,15 +1088,15 @@ static unsigned int bfin_bus_softreset(struct ata_port *ap, | |||
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | /** | 1090 | /** |
1091 | * bfin_std_softreset - reset host port via ATA SRST | 1091 | * bfin_softreset - reset host port via ATA SRST |
1092 | * @ap: port to reset | 1092 | * @ap: port to reset |
1093 | * @classes: resulting classes of attached devices | 1093 | * @classes: resulting classes of attached devices |
1094 | * | 1094 | * |
1095 | * Note: Original code is ata_std_softreset(). | 1095 | * Note: Original code is ata_sff_softreset(). |
1096 | */ | 1096 | */ |
1097 | 1097 | ||
1098 | static int bfin_std_softreset(struct ata_link *link, unsigned int *classes, | 1098 | static int bfin_softreset(struct ata_link *link, unsigned int *classes, |
1099 | unsigned long deadline) | 1099 | unsigned long deadline) |
1100 | { | 1100 | { |
1101 | struct ata_port *ap = link->ap; | 1101 | struct ata_port *ap = link->ap; |
1102 | unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; | 1102 | unsigned int slave_possible = ap->flags & ATA_FLAG_SLAVE_POSS; |
@@ -1115,7 +1115,7 @@ static int bfin_std_softreset(struct ata_link *link, unsigned int *classes, | |||
1115 | devmask |= (1 << 1); | 1115 | devmask |= (1 << 1); |
1116 | 1116 | ||
1117 | /* select device 0 again */ | 1117 | /* select device 0 again */ |
1118 | bfin_std_dev_select(ap, 0); | 1118 | bfin_dev_select(ap, 0); |
1119 | 1119 | ||
1120 | /* issue bus reset */ | 1120 | /* issue bus reset */ |
1121 | err_mask = bfin_bus_softreset(ap, devmask); | 1121 | err_mask = bfin_bus_softreset(ap, devmask); |
@@ -1126,10 +1126,10 @@ static int bfin_std_softreset(struct ata_link *link, unsigned int *classes, | |||
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | /* determine by signature whether we have ATA or ATAPI devices */ | 1128 | /* determine by signature whether we have ATA or ATAPI devices */ |
1129 | classes[0] = ata_dev_try_classify(&ap->link.device[0], | 1129 | classes[0] = ata_sff_dev_classify(&ap->link.device[0], |
1130 | devmask & (1 << 0), &err); | 1130 | devmask & (1 << 0), &err); |
1131 | if (slave_possible && err != 0x81) | 1131 | if (slave_possible && err != 0x81) |
1132 | classes[1] = ata_dev_try_classify(&ap->link.device[1], | 1132 | classes[1] = ata_sff_dev_classify(&ap->link.device[1], |
1133 | devmask & (1 << 1), &err); | 1133 | devmask & (1 << 1), &err); |
1134 | 1134 | ||
1135 | out: | 1135 | out: |
@@ -1167,7 +1167,7 @@ static unsigned char bfin_bmdma_status(struct ata_port *ap) | |||
1167 | * @buflen: buffer length | 1167 | * @buflen: buffer length |
1168 | * @write_data: read/write | 1168 | * @write_data: read/write |
1169 | * | 1169 | * |
1170 | * Note: Original code is ata_data_xfer(). | 1170 | * Note: Original code is ata_sff_data_xfer(). |
1171 | */ | 1171 | */ |
1172 | 1172 | ||
1173 | static unsigned int bfin_data_xfer(struct ata_device *dev, unsigned char *buf, | 1173 | static unsigned int bfin_data_xfer(struct ata_device *dev, unsigned char *buf, |
@@ -1206,7 +1206,7 @@ static unsigned int bfin_data_xfer(struct ata_device *dev, unsigned char *buf, | |||
1206 | * bfin_irq_clear - Clear ATAPI interrupt. | 1206 | * bfin_irq_clear - Clear ATAPI interrupt. |
1207 | * @ap: Port associated with this ATA transaction. | 1207 | * @ap: Port associated with this ATA transaction. |
1208 | * | 1208 | * |
1209 | * Note: Original code is ata_bmdma_irq_clear(). | 1209 | * Note: Original code is ata_sff_irq_clear(). |
1210 | */ | 1210 | */ |
1211 | 1211 | ||
1212 | static void bfin_irq_clear(struct ata_port *ap) | 1212 | static void bfin_irq_clear(struct ata_port *ap) |
@@ -1223,7 +1223,7 @@ static void bfin_irq_clear(struct ata_port *ap) | |||
1223 | * bfin_irq_on - Enable interrupts on a port. | 1223 | * bfin_irq_on - Enable interrupts on a port. |
1224 | * @ap: Port on which interrupts are enabled. | 1224 | * @ap: Port on which interrupts are enabled. |
1225 | * | 1225 | * |
1226 | * Note: Original code is ata_irq_on(). | 1226 | * Note: Original code is ata_sff_irq_on(). |
1227 | */ | 1227 | */ |
1228 | 1228 | ||
1229 | static unsigned char bfin_irq_on(struct ata_port *ap) | 1229 | static unsigned char bfin_irq_on(struct ata_port *ap) |
@@ -1244,13 +1244,13 @@ static unsigned char bfin_irq_on(struct ata_port *ap) | |||
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | /** | 1246 | /** |
1247 | * bfin_bmdma_freeze - Freeze DMA controller port | 1247 | * bfin_freeze - Freeze DMA controller port |
1248 | * @ap: port to freeze | 1248 | * @ap: port to freeze |
1249 | * | 1249 | * |
1250 | * Note: Original code is ata_bmdma_freeze(). | 1250 | * Note: Original code is ata_sff_freeze(). |
1251 | */ | 1251 | */ |
1252 | 1252 | ||
1253 | static void bfin_bmdma_freeze(struct ata_port *ap) | 1253 | static void bfin_freeze(struct ata_port *ap) |
1254 | { | 1254 | { |
1255 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; | 1255 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; |
1256 | 1256 | ||
@@ -1270,13 +1270,13 @@ static void bfin_bmdma_freeze(struct ata_port *ap) | |||
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | /** | 1272 | /** |
1273 | * bfin_bmdma_thaw - Thaw DMA controller port | 1273 | * bfin_thaw - Thaw DMA controller port |
1274 | * @ap: port to thaw | 1274 | * @ap: port to thaw |
1275 | * | 1275 | * |
1276 | * Note: Original code is ata_bmdma_thaw(). | 1276 | * Note: Original code is ata_sff_thaw(). |
1277 | */ | 1277 | */ |
1278 | 1278 | ||
1279 | void bfin_bmdma_thaw(struct ata_port *ap) | 1279 | void bfin_thaw(struct ata_port *ap) |
1280 | { | 1280 | { |
1281 | bfin_check_status(ap); | 1281 | bfin_check_status(ap); |
1282 | bfin_irq_clear(ap); | 1282 | bfin_irq_clear(ap); |
@@ -1284,14 +1284,14 @@ void bfin_bmdma_thaw(struct ata_port *ap) | |||
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | /** | 1286 | /** |
1287 | * bfin_std_postreset - standard postreset callback | 1287 | * bfin_postreset - standard postreset callback |
1288 | * @ap: the target ata_port | 1288 | * @ap: the target ata_port |
1289 | * @classes: classes of attached devices | 1289 | * @classes: classes of attached devices |
1290 | * | 1290 | * |
1291 | * Note: Original code is ata_std_postreset(). | 1291 | * Note: Original code is ata_sff_postreset(). |
1292 | */ | 1292 | */ |
1293 | 1293 | ||
1294 | static void bfin_std_postreset(struct ata_link *link, unsigned int *classes) | 1294 | static void bfin_postreset(struct ata_link *link, unsigned int *classes) |
1295 | { | 1295 | { |
1296 | struct ata_port *ap = link->ap; | 1296 | struct ata_port *ap = link->ap; |
1297 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; | 1297 | void __iomem *base = (void __iomem *)ap->ioaddr.ctl_addr; |
@@ -1301,9 +1301,9 @@ static void bfin_std_postreset(struct ata_link *link, unsigned int *classes) | |||
1301 | 1301 | ||
1302 | /* is double-select really necessary? */ | 1302 | /* is double-select really necessary? */ |
1303 | if (classes[0] != ATA_DEV_NONE) | 1303 | if (classes[0] != ATA_DEV_NONE) |
1304 | bfin_std_dev_select(ap, 1); | 1304 | bfin_dev_select(ap, 1); |
1305 | if (classes[1] != ATA_DEV_NONE) | 1305 | if (classes[1] != ATA_DEV_NONE) |
1306 | bfin_std_dev_select(ap, 0); | 1306 | bfin_dev_select(ap, 0); |
1307 | 1307 | ||
1308 | /* bail out if no device is present */ | 1308 | /* bail out if no device is present */ |
1309 | if (classes[0] == ATA_DEV_NONE && classes[1] == ATA_DEV_NONE) { | 1309 | if (classes[0] == ATA_DEV_NONE && classes[1] == ATA_DEV_NONE) { |
@@ -1362,7 +1362,7 @@ static const struct ata_port_operations bfin_pata_ops = { | |||
1362 | .exec_command = bfin_exec_command, | 1362 | .exec_command = bfin_exec_command, |
1363 | .check_status = bfin_check_status, | 1363 | .check_status = bfin_check_status, |
1364 | .check_altstatus = bfin_check_altstatus, | 1364 | .check_altstatus = bfin_check_altstatus, |
1365 | .dev_select = bfin_std_dev_select, | 1365 | .dev_select = bfin_dev_select, |
1366 | 1366 | ||
1367 | .bmdma_setup = bfin_bmdma_setup, | 1367 | .bmdma_setup = bfin_bmdma_setup, |
1368 | .bmdma_start = bfin_bmdma_start, | 1368 | .bmdma_start = bfin_bmdma_start, |
@@ -1372,10 +1372,10 @@ static const struct ata_port_operations bfin_pata_ops = { | |||
1372 | 1372 | ||
1373 | .qc_prep = ata_noop_qc_prep, | 1373 | .qc_prep = ata_noop_qc_prep, |
1374 | 1374 | ||
1375 | .freeze = bfin_bmdma_freeze, | 1375 | .freeze = bfin_freeze, |
1376 | .thaw = bfin_bmdma_thaw, | 1376 | .thaw = bfin_thaw, |
1377 | .softreset = bfin_std_softreset, | 1377 | .softreset = bfin_softreset, |
1378 | .postreset = bfin_std_postreset, | 1378 | .postreset = bfin_postreset, |
1379 | .post_internal_cmd = bfin_bmdma_stop, | 1379 | .post_internal_cmd = bfin_bmdma_stop, |
1380 | 1380 | ||
1381 | .irq_clear = bfin_irq_clear, | 1381 | .irq_clear = bfin_irq_clear, |
@@ -1513,7 +1513,7 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev) | |||
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | if (ata_host_activate(host, platform_get_irq(pdev, 0), | 1515 | if (ata_host_activate(host, platform_get_irq(pdev, 0), |
1516 | ata_interrupt, IRQF_SHARED, &bfin_sht) != 0) { | 1516 | ata_sff_interrupt, IRQF_SHARED, &bfin_sht) != 0) { |
1517 | peripheral_free_list(atapi_io_port); | 1517 | peripheral_free_list(atapi_io_port); |
1518 | dev_err(&pdev->dev, "Fail to attach ATAPI device\n"); | 1518 | dev_err(&pdev->dev, "Fail to attach ATAPI device\n"); |
1519 | return -ENODEV; | 1519 | return -ENODEV; |