From patchwork Thu Feb 10 10:21:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 545941 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1AALbmr005279 for ; Thu, 10 Feb 2011 10:21:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035Ab1BJKVh (ORCPT ); Thu, 10 Feb 2011 05:21:37 -0500 Received: from na3sys009aog116.obsmtp.com ([74.125.149.240]:50585 "EHLO na3sys009aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755992Ab1BJKVg (ORCPT ); Thu, 10 Feb 2011 05:21:36 -0500 Received: from source ([209.85.161.44]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTVO8L9hB1kM08BeK979m7yYtngLE2G9v@postini.com; Thu, 10 Feb 2011 02:21:35 PST Received: by mail-fx0-f44.google.com with SMTP id 9so1397669fxm.31 for ; Thu, 10 Feb 2011 02:21:35 -0800 (PST) Received: by 10.223.74.15 with SMTP id s15mr7066479faj.28.1297333295068; Thu, 10 Feb 2011 02:21:35 -0800 (PST) Received: from localhost (cs181221087.pp.htv.fi [82.181.221.87]) by mx.google.com with ESMTPS id o12sm611276fav.30.2011.02.10.02.21.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 10 Feb 2011 02:21:34 -0800 (PST) From: Felipe Balbi To: Tony Lindgren Cc: Linux OMAP Mailing List , Felipe Balbi Subject: [PATCH 2/4] cbus: retu: headset: grab IRQ via struct resource Date: Thu, 10 Feb 2011 12:21:19 +0200 Message-Id: <1297333281-29853-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.4.rc2 In-Reply-To: <1297333281-29853-1-git-send-email-balbi@ti.com> References: <1297333281-29853-1-git-send-email-balbi@ti.com> Organization: Texas Instruments\n Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 10 Feb 2011 10:21:38 +0000 (UTC) diff --git a/drivers/cbus/retu-headset.c b/drivers/cbus/retu-headset.c index 661534c..acf5cbe7 100644 --- a/drivers/cbus/retu-headset.c +++ b/drivers/cbus/retu-headset.c @@ -45,6 +45,7 @@ struct retu_headset { unsigned pressed; struct timer_list enable_timer; struct timer_list detect_timer; + int irq; }; static void retu_headset_set_bias(int enable) @@ -219,6 +220,7 @@ static void retu_headset_detect_timer(unsigned long arg) static int __init retu_headset_probe(struct platform_device *pdev) { struct retu_headset *hs; + int irq; int r; hs = kzalloc(sizeof(*hs), GFP_KERNEL); @@ -258,8 +260,11 @@ static int __init retu_headset_probe(struct platform_device *pdev) setup_timer(&hs->detect_timer, retu_headset_detect_timer, (unsigned long) hs); - r = request_threaded_irq(CBUS_RETU_IRQ_BASE + RETU_INT_HOOK, NULL, - retu_headset_hook_interrupt, 0, "hookdet", hs); + irq = platform_get_irq(pdev, 0); + hs->irq = irq; + + r = request_threaded_irq(irq, NULL, retu_headset_hook_interrupt, 0, + "hookdet", hs); if (r != 0) { dev_err(&pdev->dev, "hookdet IRQ not available\n"); goto err6; @@ -290,7 +295,7 @@ static int retu_headset_remove(struct platform_device *pdev) device_remove_file(&pdev->dev, &dev_attr_enable_det); retu_headset_disable(hs); retu_headset_det_disable(hs); - free_irq(CBUS_RETU_IRQ_BASE + RETU_INT_HOOK, hs); + free_irq(hs->irq, hs); input_unregister_device(hs->idev); input_free_device(hs->idev);