Commit 2c6ef04f authored by Grygorii Strashko's avatar Grygorii Strashko Committed by Wolfram Sang

i2c: davinci: switch to use platform_get_irq

Switch Davinci I2C driver to use platform_get_irq(), because
it is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ, ..)
for requesting IRQ resources any more, as they can be not ready yet
in case of DT-boot.
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 5f835cef
...@@ -634,13 +634,17 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -634,13 +634,17 @@ static int davinci_i2c_probe(struct platform_device *pdev)
{ {
struct davinci_i2c_dev *dev; struct davinci_i2c_dev *dev;
struct i2c_adapter *adap; struct i2c_adapter *adap;
struct resource *mem, *irq; struct resource *mem;
int r; int r, irq;
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"); if (!irq)
return -ENODEV; irq = -ENXIO;
if (irq != -EPROBE_DEFER)
dev_err(&pdev->dev,
"can't get irq resource ret=%d\n", irq);
return irq;
} }
dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev), dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
...@@ -655,7 +659,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) ...@@ -655,7 +659,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
init_completion(&dev->xfr_complete); init_completion(&dev->xfr_complete);
#endif #endif
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev->irq = irq->start; dev->irq = irq;
dev->pdata = dev_get_platdata(&pdev->dev); dev->pdata = dev_get_platdata(&pdev->dev);
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
......
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