Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932086AbaKTKFl (ORCPT ); Thu, 20 Nov 2014 05:05:41 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:41029 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757292AbaKTKDV (ORCPT ); Thu, 20 Nov 2014 05:03:21 -0500 From: Grygorii Strashko To: Wolfram Sang CC: , , Grygorii Strashko , Sekhar Nori , Kevin Hilman , Santosh Shilimkar , Murali Karicheri Subject: [PATCH 1/5] i2c: i2c-davinci: switch to use platform_get_irq Date: Thu, 20 Nov 2014 12:03:04 +0200 Message-ID: <1416477788-5544-2-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1416477788-5544-1-git-send-email-grygorii.strashko@ti.com> References: <1416477788-5544-1-git-send-email-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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's resources any more, as they can be not ready yet in case of DT-booting. - it makes code simpler CC: Sekhar Nori CC: Kevin Hilman CC: Santosh Shilimkar CC: Murali Karicheri Signed-off-by: Grygorii Strashko --- drivers/i2c/busses/i2c-davinci.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 4d96147..9bbfb8f 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -640,13 +640,13 @@ static int davinci_i2c_probe(struct platform_device *pdev) { struct davinci_i2c_dev *dev; struct i2c_adapter *adap; - struct resource *mem, *irq; - int r; + struct resource *mem; + int r, irq; - irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!irq) { - dev_err(&pdev->dev, "no irq resource?\n"); - return -ENODEV; + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + 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), @@ -661,7 +661,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) init_completion(&dev->xfr_complete); #endif dev->dev = &pdev->dev; - dev->irq = irq->start; + dev->irq = irq; dev->pdata = dev_get_platdata(&pdev->dev); platform_set_drvdata(pdev, dev); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/