Commit a8fd9a87 authored by John Lenz's avatar John Lenz Committed by Russell King

[ARM PATCH] 2206/1: convert locomo to use platform_get_resource\platform_get_irq

Patch from John Lenz

Similar to sa1111.c, convert the locomo_probe function to use
the platform_get_resource\platform_get_irq instead of accessing
the pdev->resources array directly.
parent e1e9d8ff
......@@ -609,17 +609,15 @@ static void __locomo_remove(struct locomo *lchip)
static int locomo_probe(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct resource *mem = NULL, *irq = NULL;
int i;
for (i = 0; i < pdev->num_resources; i++) {
if (pdev->resource[i].flags & IORESOURCE_MEM)
mem = &pdev->resource[i];
if (pdev->resource[i].flags & IORESOURCE_IRQ)
irq = &pdev->resource[i];
}
struct resource *mem;
int irq;
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem)
return -EINVAL;
irq = platform_get_irq(pdev, 0);
return __locomo_probe(dev, mem, irq ? irq->start : NO_IRQ);
return __locomo_probe(dev, mem, irq);
}
static int locomo_remove(struct device *dev)
......@@ -756,7 +754,7 @@ module_exit(locomo_exit);
MODULE_DESCRIPTION("Sharp LoCoMo core driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("John Lenz <jelenz@students.wisc.edu>");
MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>");
EXPORT_SYMBOL(locomo_driver_register);
EXPORT_SYMBOL(locomo_driver_unregister);
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