aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/xsysace.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/block/xsysace.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/block/xsysace.c')
-rw-r--r--drivers/block/xsysace.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 1f38643173c..fb1975d82a7 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -456,7 +456,7 @@ static inline void ace_fsm_yieldirq(struct ace_device *ace)
456{ 456{
457 dev_dbg(ace->dev, "ace_fsm_yieldirq()\n"); 457 dev_dbg(ace->dev, "ace_fsm_yieldirq()\n");
458 458
459 if (!ace->irq) 459 if (ace->irq == NO_IRQ)
460 /* No IRQ assigned, so need to poll */ 460 /* No IRQ assigned, so need to poll */
461 tasklet_schedule(&ace->fsm_tasklet); 461 tasklet_schedule(&ace->fsm_tasklet);
462 ace->fsm_continue_flag = 0; 462 ace->fsm_continue_flag = 0;
@@ -961,7 +961,7 @@ static const struct block_device_operations ace_fops = {
961/* -------------------------------------------------------------------- 961/* --------------------------------------------------------------------
962 * SystemACE device setup/teardown code 962 * SystemACE device setup/teardown code
963 */ 963 */
964static int ace_setup(struct ace_device *ace) 964static int __devinit ace_setup(struct ace_device *ace)
965{ 965{
966 u16 version; 966 u16 version;
967 u16 val; 967 u16 val;
@@ -1034,12 +1034,12 @@ static int ace_setup(struct ace_device *ace)
1034 ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ); 1034 ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ);
1035 1035
1036 /* Now we can hook up the irq handler */ 1036 /* Now we can hook up the irq handler */
1037 if (ace->irq) { 1037 if (ace->irq != NO_IRQ) {
1038 rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace); 1038 rc = request_irq(ace->irq, ace_interrupt, 0, "systemace", ace);
1039 if (rc) { 1039 if (rc) {
1040 /* Failure - fall back to polled mode */ 1040 /* Failure - fall back to polled mode */
1041 dev_err(ace->dev, "request_irq failed\n"); 1041 dev_err(ace->dev, "request_irq failed\n");
1042 ace->irq = 0; 1042 ace->irq = NO_IRQ;
1043 } 1043 }
1044 } 1044 }
1045 1045
@@ -1074,7 +1074,7 @@ err_ioremap:
1074 return -ENOMEM; 1074 return -ENOMEM;
1075} 1075}
1076 1076
1077static void ace_teardown(struct ace_device *ace) 1077static void __devexit ace_teardown(struct ace_device *ace)
1078{ 1078{
1079 if (ace->gd) { 1079 if (ace->gd) {
1080 del_gendisk(ace->gd); 1080 del_gendisk(ace->gd);
@@ -1086,14 +1086,15 @@ static void ace_teardown(struct ace_device *ace)
1086 1086
1087 tasklet_kill(&ace->fsm_tasklet); 1087 tasklet_kill(&ace->fsm_tasklet);
1088 1088
1089 if (ace->irq) 1089 if (ace->irq != NO_IRQ)
1090 free_irq(ace->irq, ace); 1090 free_irq(ace->irq, ace);
1091 1091
1092 iounmap(ace->baseaddr); 1092 iounmap(ace->baseaddr);
1093} 1093}
1094 1094
1095static int ace_alloc(struct device *dev, int id, resource_size_t physaddr, 1095static int __devinit
1096 int irq, int bus_width) 1096ace_alloc(struct device *dev, int id, resource_size_t physaddr,
1097 int irq, int bus_width)
1097{ 1098{
1098 struct ace_device *ace; 1099 struct ace_device *ace;
1099 int rc; 1100 int rc;
@@ -1134,7 +1135,7 @@ err_noreg:
1134 return rc; 1135 return rc;
1135} 1136}
1136 1137
1137static void ace_free(struct device *dev) 1138static void __devexit ace_free(struct device *dev)
1138{ 1139{
1139 struct ace_device *ace = dev_get_drvdata(dev); 1140 struct ace_device *ace = dev_get_drvdata(dev);
1140 dev_dbg(dev, "ace_free(%p)\n", dev); 1141 dev_dbg(dev, "ace_free(%p)\n", dev);
@@ -1150,12 +1151,12 @@ static void ace_free(struct device *dev)
1150 * Platform Bus Support 1151 * Platform Bus Support
1151 */ 1152 */
1152 1153
1153static int ace_probe(struct platform_device *dev) 1154static int __devinit ace_probe(struct platform_device *dev)
1154{ 1155{
1155 resource_size_t physaddr = 0; 1156 resource_size_t physaddr = 0;
1156 int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */ 1157 int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
1157 u32 id = dev->id; 1158 u32 id = dev->id;
1158 int irq = 0; 1159 int irq = NO_IRQ;
1159 int i; 1160 int i;
1160 1161
1161 dev_dbg(&dev->dev, "ace_probe(%p)\n", dev); 1162 dev_dbg(&dev->dev, "ace_probe(%p)\n", dev);
@@ -1181,7 +1182,7 @@ static int ace_probe(struct platform_device *dev)
1181/* 1182/*
1182 * Platform bus remove() method 1183 * Platform bus remove() method
1183 */ 1184 */
1184static int ace_remove(struct platform_device *dev) 1185static int __devexit ace_remove(struct platform_device *dev)
1185{ 1186{
1186 ace_free(&dev->dev); 1187 ace_free(&dev->dev);
1187 return 0; 1188 return 0;
@@ -1189,7 +1190,7 @@ static int ace_remove(struct platform_device *dev)
1189 1190
1190#if defined(CONFIG_OF) 1191#if defined(CONFIG_OF)
1191/* Match table for of_platform binding */ 1192/* Match table for of_platform binding */
1192static const struct of_device_id ace_of_match[] = { 1193static const struct of_device_id ace_of_match[] __devinitconst = {
1193 { .compatible = "xlnx,opb-sysace-1.00.b", }, 1194 { .compatible = "xlnx,opb-sysace-1.00.b", },
1194 { .compatible = "xlnx,opb-sysace-1.00.c", }, 1195 { .compatible = "xlnx,opb-sysace-1.00.c", },
1195 { .compatible = "xlnx,xps-sysace-1.00.a", }, 1196 { .compatible = "xlnx,xps-sysace-1.00.a", },
@@ -1203,7 +1204,7 @@ MODULE_DEVICE_TABLE(of, ace_of_match);
1203 1204
1204static struct platform_driver ace_platform_driver = { 1205static struct platform_driver ace_platform_driver = {
1205 .probe = ace_probe, 1206 .probe = ace_probe,
1206 .remove = ace_remove, 1207 .remove = __devexit_p(ace_remove),
1207 .driver = { 1208 .driver = {
1208 .owner = THIS_MODULE, 1209 .owner = THIS_MODULE,
1209 .name = "xsysace", 1210 .name = "xsysace",