]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
i2c: omap: switch to platform_get_irq()
authorFelipe Balbi <balbi@ti.com>
Wed, 12 Sep 2012 10:58:05 +0000 (16:28 +0530)
committerWolfram Sang <w.sang@pengutronix.de>
Wed, 12 Sep 2012 13:02:57 +0000 (15:02 +0200)
that's a nice helper from drivers core which
will give us the exact IRQ number, instead
of a pointer to an IRQ resource.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
drivers/i2c/busses/i2c-omap.c

index bac1f11cc64b36600762545fe778b759fe3e4edf..0da8169ca5b4902505b972a2585d4ee95844c0a4 100644 (file)
@@ -993,11 +993,12 @@ omap_i2c_probe(struct platform_device *pdev)
 {
        struct omap_i2c_dev     *dev;
        struct i2c_adapter      *adap;
-       struct resource         *mem, *irq;
+       struct resource         *mem;
        struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
        struct device_node      *node = pdev->dev.of_node;
        const struct of_device_id *match;
        irq_handler_t isr;
+       int irq;
        int r;
 
        /* NOTE: driver uses the static register mapping */
@@ -1006,10 +1007,11 @@ omap_i2c_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "no mem resource?\n");
                return -ENODEV;
        }
-       irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (!irq) {
+
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0) {
                dev_err(&pdev->dev, "no irq resource?\n");
-               return -ENODEV;
+               return irq;
        }
 
        dev = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL);
@@ -1043,7 +1045,7 @@ omap_i2c_probe(struct platform_device *pdev)
        }
 
        dev->dev = &pdev->dev;
-       dev->irq = irq->start;
+       dev->irq = irq;
 
        platform_set_drvdata(pdev, dev);
        init_completion(&dev->cmd_complete);