aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-09-12 06:58:05 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-09-12 09:02:57 -0400
commitac79e4b24972c69debef90a5e16b145e59222388 (patch)
treec1db2f436a05e9f8b3ba69fddebce1f0c5955832 /drivers/i2c
parent1d7afc95946487945cc7f5019b41255b72224b70 (diff)
i2c: omap: switch to platform_get_irq()
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-omap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index bac1f11cc64b..0da8169ca5b4 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -993,11 +993,12 @@ omap_i2c_probe(struct platform_device *pdev)
993{ 993{
994 struct omap_i2c_dev *dev; 994 struct omap_i2c_dev *dev;
995 struct i2c_adapter *adap; 995 struct i2c_adapter *adap;
996 struct resource *mem, *irq; 996 struct resource *mem;
997 struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data; 997 struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
998 struct device_node *node = pdev->dev.of_node; 998 struct device_node *node = pdev->dev.of_node;
999 const struct of_device_id *match; 999 const struct of_device_id *match;
1000 irq_handler_t isr; 1000 irq_handler_t isr;
1001 int irq;
1001 int r; 1002 int r;
1002 1003
1003 /* NOTE: driver uses the static register mapping */ 1004 /* NOTE: driver uses the static register mapping */
@@ -1006,10 +1007,11 @@ omap_i2c_probe(struct platform_device *pdev)
1006 dev_err(&pdev->dev, "no mem resource?\n"); 1007 dev_err(&pdev->dev, "no mem resource?\n");
1007 return -ENODEV; 1008 return -ENODEV;
1008 } 1009 }
1009 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 1010
1010 if (!irq) { 1011 irq = platform_get_irq(pdev, 0);
1012 if (irq < 0) {
1011 dev_err(&pdev->dev, "no irq resource?\n"); 1013 dev_err(&pdev->dev, "no irq resource?\n");
1012 return -ENODEV; 1014 return irq;
1013 } 1015 }
1014 1016
1015 dev = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL); 1017 dev = devm_kzalloc(&pdev->dev, sizeof(struct omap_i2c_dev), GFP_KERNEL);
@@ -1043,7 +1045,7 @@ omap_i2c_probe(struct platform_device *pdev)
1043 } 1045 }
1044 1046
1045 dev->dev = &pdev->dev; 1047 dev->dev = &pdev->dev;
1046 dev->irq = irq->start; 1048 dev->irq = irq;
1047 1049
1048 platform_set_drvdata(pdev, dev); 1050 platform_set_drvdata(pdev, dev);
1049 init_completion(&dev->cmd_complete); 1051 init_completion(&dev->cmd_complete);