Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756601Ab2FNQ1Y (ORCPT ); Thu, 14 Jun 2012 12:27:24 -0400 Received: from na3sys009aog120.obsmtp.com ([74.125.149.140]:54001 "EHLO na3sys009aog120.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932190Ab2FNQ1V (ORCPT ); Thu, 14 Jun 2012 12:27:21 -0400 From: Felipe Balbi To: ben-linux@fluff.org Cc: Tony Lindgren , Santosh Shilimkar , Russell King , Linux OMAP Mailing List , Linux ARM Kernel Mailing List , Linux Kernel Mailing List , w.sang@pengutronix.de, Shubhrajyoti Datta , Felipe Balbi Subject: [PATCH v2 12/17] i2c: omap: switch to platform_get_irq() Date: Thu, 14 Jun 2012 19:24:22 +0300 Message-Id: <1339691067-919-13-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1339691067-919-1-git-send-email-balbi@ti.com> References: <1339691067-919-1-git-send-email-balbi@ti.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1779 Lines: 58 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 --- drivers/i2c/busses/i2c-omap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index e368f67..be7ac1a 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1044,11 +1044,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 */ @@ -1058,10 +1059,10 @@ omap_i2c_probe(struct platform_device *pdev) 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); @@ -1089,7 +1090,7 @@ omap_i2c_probe(struct platform_device *pdev) } dev->dev = &pdev->dev; - dev->irq = irq->start; + dev->irq = irq; dev->base = devm_request_and_ioremap(&pdev->dev, mem); if (!dev->base) { dev_err(&pdev->dev, "ioremap failed\n"); -- 1.7.10.4 -- 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/