Commit 91b52cae authored by Shinya Kuribayashi's avatar Shinya Kuribayashi Committed by Ben Dooks

i2c-designware: Use platform_get_irq helper

Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi@necel.com>
Acked-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent e28000a3
...@@ -548,8 +548,8 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev) ...@@ -548,8 +548,8 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
{ {
struct dw_i2c_dev *dev; struct dw_i2c_dev *dev;
struct i2c_adapter *adap; struct i2c_adapter *adap;
struct resource *mem, *irq, *ioarea; struct resource *mem, *ioarea;
int r; int irq, r;
/* NOTE: driver uses the static register mapping */ /* NOTE: driver uses the static register mapping */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -558,10 +558,10 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev) ...@@ -558,10 +558,10 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); irq = platform_get_irq(pdev, 0);
if (!irq) { if (irq < 0) {
dev_err(&pdev->dev, "no irq resource?\n"); dev_err(&pdev->dev, "no irq resource?\n");
return -EINVAL; return irq; /* -ENXIO */
} }
ioarea = request_mem_region(mem->start, resource_size(mem), ioarea = request_mem_region(mem->start, resource_size(mem),
...@@ -581,7 +581,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev) ...@@ -581,7 +581,7 @@ static int __devinit dw_i2c_probe(struct platform_device *pdev)
tasklet_init(&dev->pump_msg, dw_i2c_pump_msg, (unsigned long) dev); tasklet_init(&dev->pump_msg, dw_i2c_pump_msg, (unsigned long) dev);
mutex_init(&dev->lock); mutex_init(&dev->lock);
dev->dev = get_device(&pdev->dev); dev->dev = get_device(&pdev->dev);
dev->irq = irq->start; dev->irq = irq;
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
dev->clk = clk_get(&pdev->dev, NULL); dev->clk = clk_get(&pdev->dev, NULL);
......
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