From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755390AbbCBVEF (ORCPT ); Mon, 2 Mar 2015 16:04:05 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58181 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755104AbbCBVEC (ORCPT ); Mon, 2 Mar 2015 16:04:02 -0500 Date: Mon, 2 Mar 2015 22:03:59 +0100 From: Pavel Machek To: NeilBrown Cc: Tony Lindgren , Felipe Balbi , Kishon Vijay Abraham I , linux-omap@vger.kernel.org, lkml , GTA04 owners Subject: Re: [PATCH 1/4] usb: phy: twl4030: make runtime pm more reliable. Message-ID: <20150302210359.GG13270@amd> References: <20150224033730.31400.78200.stgit@notabene.brown> <20150224034036.31400.6133.stgit@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150224034036.31400.6133.stgit@notabene.brown> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > + status_changed = > + (twl->linkstat == OMAP_MUSB_VBUS_VALID || > + twl->linkstat == OMAP_MUSB_ID_GROUND) > + != > + (status == OMAP_MUSB_VBUS_VALID || > + status == OMAP_MUSB_ID_GROUND); > twl->linkstat = status; ... > @@ -768,6 +770,10 @@ static int twl4030_usb_remove(struct platform_device *pdev) > > /* disable complete OTG block */ > twl4030_usb_clear_bits(twl, POWER_CTRL, POWER_CTRL_OTG_ENAB); > + > + if (twl->linkstat == OMAP_MUSB_VBUS_VALID || > + twl->linkstat == OMAP_MUSB_ID_GROUND) > + pm_runtime_put_noidle(twl->dev); > pm_runtime_mark_last_busy(twl->dev); inline function returning (x == OMAP_MUSB_VBUS_VALID || x == OMAP_MUSB_ID_GROUND) would really help readability here. Thanks, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html