From patchwork Thu Feb 17 12:38:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 569921 X-Patchwork-Delegate: me@felipebalbi.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 p1HCd6DD019540 for ; Thu, 17 Feb 2011 12:39:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756198Ab1BQMjR (ORCPT ); Thu, 17 Feb 2011 07:39:17 -0500 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:50122 "EHLO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756190Ab1BQMjO (ORCPT ); Thu, 17 Feb 2011 07:39:14 -0500 Received: from source ([209.85.214.53]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKTV0W8cI7d11S/Eln/WnjzSzoE7SCAyGA@postini.com; Thu, 17 Feb 2011 04:39:14 PST Received: by mail-bw0-f53.google.com with SMTP id 12so2474630bwg.12 for ; Thu, 17 Feb 2011 04:39:13 -0800 (PST) Received: by 10.204.58.201 with SMTP id i9mr1632175bkh.192.1297946353325; Thu, 17 Feb 2011 04:39:13 -0800 (PST) Received: from localhost (cs181221087.pp.htv.fi [82.181.221.87]) by mx.google.com with ESMTPS id v25sm618608bkt.6.2011.02.17.04.39.11 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Feb 2011 04:39:12 -0800 (PST) From: Felipe Balbi To: Greg KH Cc: Linux USB Mailing List , Linux OMAP Mailing List , Hema HK , Tony Lindgren , Paul Walmsley , Felipe Balbi Subject: [patch-v2.6.39 06/12] usb: otg: Remove one unnecessary I2C read request. Date: Thu, 17 Feb 2011 14:38:43 +0200 Message-Id: <1297946329-9353-7-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.4.rc2 In-Reply-To: <1297946329-9353-1-git-send-email-balbi@ti.com> References: <1297946329-9353-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, 17 Feb 2011 12:39:28 +0000 (UTC) diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index eca4591..88989e6 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c @@ -149,7 +149,6 @@ static int twl6030_set_phy_clk(struct otg_transceiver *x, int on) static int twl6030_phy_init(struct otg_transceiver *x) { - u8 hw_state; struct twl6030_usb *twl; struct device *dev; struct twl4030_usb_data *pdata; @@ -158,9 +157,7 @@ static int twl6030_phy_init(struct otg_transceiver *x) dev = twl->dev; pdata = dev->platform_data; - hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS); - - if (hw_state & STS_USB_ID) + if (twl->linkstat == USB_EVENT_ID) pdata->phy_power(twl->dev, 1, 1); else pdata->phy_power(twl->dev, 0, 1); @@ -290,6 +287,7 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) status = USB_EVENT_ID; twl->otg.default_a = true; twl->otg.state = OTG_STATE_A_IDLE; + twl->linkstat = status; blocking_notifier_call_chain(&twl->otg.notifier, status, twl->otg.gadget); } else { @@ -299,7 +297,6 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) 0x1); } twl6030_writeb(twl, TWL_MODULE_USB, USB_ID_INT_LATCH_CLR, status); - twl->linkstat = status; return IRQ_HANDLED; }