Commit c14464bf authored by Yuri Tikhonov's avatar Yuri Tikhonov Committed by Grant Likely

xsysace: Fix driver to use resource_size_t instead of unsigned long

This patch is a bug fix to the SystemACE driver to use resource_size_t
for physical address instead of unsigned long.  This makes the driver
work correctly on 32 bit systems with 64-bit resources (e.g. PowerPC 440).
Signed-off-by: default avatarYuri Tikhonov <yur@emcraft.com>
Signed-off-by: default avatarIlya Yanok <yanok@emcraft.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent a1080968
...@@ -194,7 +194,7 @@ struct ace_device { ...@@ -194,7 +194,7 @@ struct ace_device {
int in_irq; int in_irq;
/* Details of hardware device */ /* Details of hardware device */
unsigned long physaddr; resource_size_t physaddr;
void __iomem *baseaddr; void __iomem *baseaddr;
int irq; int irq;
int bus_width; /* 0 := 8 bit; 1 := 16 bit */ int bus_width; /* 0 := 8 bit; 1 := 16 bit */
...@@ -935,7 +935,8 @@ static int __devinit ace_setup(struct ace_device *ace) ...@@ -935,7 +935,8 @@ static int __devinit ace_setup(struct ace_device *ace)
int rc; int rc;
dev_dbg(ace->dev, "ace_setup(ace=0x%p)\n", ace); dev_dbg(ace->dev, "ace_setup(ace=0x%p)\n", ace);
dev_dbg(ace->dev, "physaddr=0x%lx irq=%i\n", ace->physaddr, ace->irq); dev_dbg(ace->dev, "physaddr=0x%llx irq=%i\n",
(unsigned long long)ace->physaddr, ace->irq);
spin_lock_init(&ace->lock); spin_lock_init(&ace->lock);
init_completion(&ace->id_completion); init_completion(&ace->id_completion);
...@@ -1017,8 +1018,8 @@ static int __devinit ace_setup(struct ace_device *ace) ...@@ -1017,8 +1018,8 @@ static int __devinit ace_setup(struct ace_device *ace)
/* Print the identification */ /* Print the identification */
dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n", dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
(version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff); (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
dev_dbg(ace->dev, "physaddr 0x%lx, mapped to 0x%p, irq=%i\n", dev_dbg(ace->dev, "physaddr 0x%llx, mapped to 0x%p, irq=%i\n",
ace->physaddr, ace->baseaddr, ace->irq); (unsigned long long) ace->physaddr, ace->baseaddr, ace->irq);
ace->media_change = 1; ace->media_change = 1;
ace_revalidate_disk(ace->gd); ace_revalidate_disk(ace->gd);
...@@ -1035,8 +1036,8 @@ static int __devinit ace_setup(struct ace_device *ace) ...@@ -1035,8 +1036,8 @@ static int __devinit ace_setup(struct ace_device *ace)
err_blk_initq: err_blk_initq:
iounmap(ace->baseaddr); iounmap(ace->baseaddr);
err_ioremap: err_ioremap:
dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n", dev_info(ace->dev, "xsysace: error initializing device at 0x%llx\n",
ace->physaddr); (unsigned long long) ace->physaddr);
return -ENOMEM; return -ENOMEM;
} }
...@@ -1059,7 +1060,7 @@ static void __devexit ace_teardown(struct ace_device *ace) ...@@ -1059,7 +1060,7 @@ static void __devexit ace_teardown(struct ace_device *ace)
} }
static int __devinit static int __devinit
ace_alloc(struct device *dev, int id, unsigned long physaddr, ace_alloc(struct device *dev, int id, resource_size_t physaddr,
int irq, int bus_width) int irq, int bus_width)
{ {
struct ace_device *ace; struct ace_device *ace;
...@@ -1119,7 +1120,7 @@ static void __devexit ace_free(struct device *dev) ...@@ -1119,7 +1120,7 @@ static void __devexit ace_free(struct device *dev)
static int __devinit ace_probe(struct platform_device *dev) static int __devinit ace_probe(struct platform_device *dev)
{ {
unsigned long physaddr = 0; resource_size_t physaddr = 0;
int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */ int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
int id = dev->id; int id = dev->id;
int irq = NO_IRQ; int irq = NO_IRQ;
...@@ -1165,7 +1166,7 @@ static int __devinit ...@@ -1165,7 +1166,7 @@ static int __devinit
ace_of_probe(struct of_device *op, const struct of_device_id *match) ace_of_probe(struct of_device *op, const struct of_device_id *match)
{ {
struct resource res; struct resource res;
unsigned long physaddr; resource_size_t physaddr;
const u32 *id; const u32 *id;
int irq, bus_width, rc; int irq, bus_width, rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment