X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Farm%2Fcommon%2Flocomo.c;h=34c8cf33ad9aefd4b4b8236dff9b53ef31ab26ad;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=46550dddec9930c0f5b4ef2a3ea5a4e2f25f2230;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 46550ddde..34c8cf33a 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -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; - return __locomo_probe(dev, mem, irq ? irq->start : NO_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); } static int locomo_remove(struct device *dev) @@ -629,9 +627,6 @@ static int locomo_remove(struct device *dev) if (lchip) { __locomo_remove(lchip); dev_set_drvdata(dev, NULL); - - kfree(dev->saved_state); - dev->saved_state = NULL; } return 0; @@ -673,7 +668,7 @@ static int locomo_match(struct device *_dev, struct device_driver *_drv) return dev->devid == drv->devid; } -static int locomo_bus_suspend(struct device *dev, u32 state) +static int locomo_bus_suspend(struct device *dev, pm_message_t state) { struct locomo_dev *ldev = LOCOMO_DEV(dev); struct locomo_driver *drv = LOCOMO_DRV(dev->driver); @@ -756,7 +751,7 @@ module_exit(locomo_exit); MODULE_DESCRIPTION("Sharp LoCoMo core driver"); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("John Lenz "); +MODULE_AUTHOR("John Lenz "); EXPORT_SYMBOL(locomo_driver_register); EXPORT_SYMBOL(locomo_driver_unregister);