From patchwork Wed Mar 9 18:07:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 622111 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 p29I7CKt005197 for ; Wed, 9 Mar 2011 18:07:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757039Ab1CISHL (ORCPT ); Wed, 9 Mar 2011 13:07:11 -0500 Received: from 80-190-117-144.ip-home.de ([80.190.117.144]:34689 "EHLO bu3sch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753439Ab1CISHK (ORCPT ); Wed, 9 Mar 2011 13:07:10 -0500 Received: by bu3sch.de with esmtpsa (Exim 4.69) (envelope-from ) id 1PxNmw-0007xY-OR; Wed, 09 Mar 2011 19:07:10 +0100 Subject: [PATCH] cbus-tahvo-usb: Fix tahvo_usb_device pointer From: Michael Buesch To: Tony Lindgren Cc: Felipe Balbi , linux-omap Date: Wed, 09 Mar 2011 19:07:05 +0100 Message-ID: <1299694025.1911.9.camel@marge> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 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]); Wed, 09 Mar 2011 18:07:14 +0000 (UTC) Index: linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c =================================================================== --- linux-2.6.38-rc7.orig/drivers/cbus/tahvo-usb.c 2011-03-09 18:47:41.147540155 +0100 +++ linux-2.6.38-rc7/drivers/cbus/tahvo-usb.c 2011-03-09 18:50:59.658485748 +0100 @@ -99,7 +99,7 @@ struct tahvo_usb { int tahvo_mode; #endif }; -static struct platform_device tahvo_usb_device; +static struct tahvo_usb *tahvo_usb_device; /* * --------------------------------------------------------------------------- @@ -114,8 +114,7 @@ static struct platform_device *tahvo_otg static irqreturn_t omap_otg_irq(int irq, void *arg) { - struct platform_device *otg_dev = arg; - struct tahvo_usb *tu = platform_get_drvdata(otg_dev); + struct tahvo_usb *tu = arg; u16 otg_irq; otg_irq = omap_readw(OTG_IRQ_SRC); @@ -201,12 +200,12 @@ static int __init omap_otg_probe(struct return request_irq(tahvo_otg_dev->resource[1].start, omap_otg_irq, IRQF_DISABLED, DRIVER_NAME, - &tahvo_usb_device); + tahvo_usb_device); } static int __exit omap_otg_remove(struct platform_device *pdev) { - free_irq(tahvo_otg_dev->resource[1].start, &tahvo_usb_device); + free_irq(tahvo_otg_dev->resource[1].start, tahvo_usb_device); tahvo_otg_dev = NULL; return 0; @@ -659,6 +658,7 @@ static int __init tahvo_usb_probe(struct tu = kzalloc(sizeof(*tu), GFP_KERNEL); if (!tu) return -ENOMEM; + tahvo_usb_device = tu; tu->pt_dev = container_of(dev, struct platform_device, dev); #ifdef CONFIG_USB_OTG @@ -682,6 +682,7 @@ static int __init tahvo_usb_probe(struct (unsigned long) tu, "vbus_interrupt"); if (ret != 0) { kfree(tu); + tahvo_usb_device = NULL; printk(KERN_ERR "Could not register Tahvo interrupt for VBUS\n"); return ret; } @@ -708,6 +709,7 @@ static int __init tahvo_usb_probe(struct ret = otg_set_transceiver(&tu->otg); if (ret < 0) { printk(KERN_ERR "Cannot register USB transceiver\n"); + tahvo_usb_device = NULL; kfree(tu); tahvo_free_irq(TAHVO_INT_VBUSON); return ret; @@ -732,6 +734,8 @@ static int __exit tahvo_usb_remove(struc #ifdef CONFIG_USB_OTG device_remove_file(&pdev->dev, &dev_attr_otg_mode); #endif + tahvo_usb_device = NULL; + return 0; }