From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Bird Subject: Re: [PATCH] usb: phy: msm: Unregister driver interest for VBUS and ID events Date: Mon, 24 Aug 2015 10:11:28 -0700 Message-ID: <55DB5040.2060002@sonymobile.com> References: <1439884576-28467-1-git-send-email-ivan.ivanov@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: Received: from seldrel01.sonyericsson.com ([37.139.156.2]:15992 "EHLO seldrel01.sonyericsson.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753989AbbHXRLd (ORCPT ); Mon, 24 Aug 2015 13:11:33 -0400 In-Reply-To: <1439884576-28467-1-git-send-email-ivan.ivanov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: "Ivan T. Ivanov" , Felipe Balbi Cc: Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-arm-msm On 08/18/2015 12:56 AM, Ivan T. Ivanov wrote: > Right now even if driver failed to probe extcon framework will > still deliver its VBUS and ID events, which will lead to random > exception codes. > > Fix this by removing driver interest for VBUS and ID events when > probe fail. > > Fixes: 591fc116f330 ("usb: phy: msm: Use extcon framework for VBUS and ID detection") > > Reported-by: Tim Bird > Signed-off-by: Ivan T. Ivanov > --- > drivers/usb/phy/phy-msm-usb.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c > index 00c49bb1bd29..a9082567f114 100644 > --- a/drivers/usb/phy/phy-msm-usb.c > +++ b/drivers/usb/phy/phy-msm-usb.c > @@ -1581,6 +1581,8 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) > ret = extcon_register_interest(&motg->id.conn, ext_id->name, > "USB-HOST", &motg->id.nb); > if (ret < 0) { > + if (!IS_ERR(ext_vbus)) > + extcon_unregister_interest(&motg->vbus.conn); > dev_err(&pdev->dev, "register ID notifier failed\n"); > return ret; > } ... This patch is obsoleted by commit 83b7b67c7, which changes the extcon API a bit (from register_interest to register_notifier, among other things). But, in general, I would expect this approach to work. Do you want me to re-spin this with the new API? -- Tim