From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: Re: [PATCH 19/21] usb: chipidea: msm: Be silent on probe defer errors Date: Thu, 30 Jun 2016 09:06:28 +0800 Message-ID: <20160630010628.GA19211@shlinux2> References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-20-stephen.boyd@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160626072838.28082-20-stephen.boyd@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Stephen Boyd Cc: Felipe Balbi , Arnd Bergmann , Neil Armstrong , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Peter Chen , Greg Kroah-Hartman , Andy Gross , linux-arm-kernel@lists.infradead.org List-Id: linux-arm-msm@vger.kernel.org On Sun, Jun 26, 2016 at 12:28:36AM -0700, Stephen Boyd wrote: > If something fails in ci_hdrc_add_device() due to probe defer, we > shouldn't print an error message. Be silent in this case as we'll > try probe again later. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index 7d191928e55b..2ed9a181f4b6 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -241,7 +241,8 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, > pdev->num_resources, &ci->pdata); > if (IS_ERR(plat_ci)) { > - dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > + if (PTR_ERR(plat_ci) != -EPROBE_DEFER) > + dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > ret = PTR_ERR(plat_ci); > goto err_mux; > } Why not let ret equals to PTR_ERR(plat_ci) first, and using ret to compare? -- Best Regards, Peter Chen From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbcF3B20 (ORCPT ); Wed, 29 Jun 2016 21:28:26 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:32852 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751827AbcF3B2Y (ORCPT ); Wed, 29 Jun 2016 21:28:24 -0400 Date: Thu, 30 Jun 2016 09:06:28 +0800 From: Peter Chen To: Stephen Boyd Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson , Neil Armstrong , Arnd Bergmann , Felipe Balbi , Peter Chen , Greg Kroah-Hartman Subject: Re: [PATCH 19/21] usb: chipidea: msm: Be silent on probe defer errors Message-ID: <20160630010628.GA19211@shlinux2> References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-20-stephen.boyd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160626072838.28082-20-stephen.boyd@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 26, 2016 at 12:28:36AM -0700, Stephen Boyd wrote: > If something fails in ci_hdrc_add_device() due to probe defer, we > shouldn't print an error message. Be silent in this case as we'll > try probe again later. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index 7d191928e55b..2ed9a181f4b6 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -241,7 +241,8 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, > pdev->num_resources, &ci->pdata); > if (IS_ERR(plat_ci)) { > - dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > + if (PTR_ERR(plat_ci) != -EPROBE_DEFER) > + dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > ret = PTR_ERR(plat_ci); > goto err_mux; > } Why not let ret equals to PTR_ERR(plat_ci) first, and using ret to compare? -- Best Regards, Peter Chen From mboxrd@z Thu Jan 1 00:00:00 1970 From: hzpeterchen@gmail.com (Peter Chen) Date: Thu, 30 Jun 2016 09:06:28 +0800 Subject: [PATCH 19/21] usb: chipidea: msm: Be silent on probe defer errors In-Reply-To: <20160626072838.28082-20-stephen.boyd@linaro.org> References: <20160626072838.28082-1-stephen.boyd@linaro.org> <20160626072838.28082-20-stephen.boyd@linaro.org> Message-ID: <20160630010628.GA19211@shlinux2> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sun, Jun 26, 2016 at 12:28:36AM -0700, Stephen Boyd wrote: > If something fails in ci_hdrc_add_device() due to probe defer, we > shouldn't print an error message. Be silent in this case as we'll > try probe again later. > > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Signed-off-by: Stephen Boyd > --- > drivers/usb/chipidea/ci_hdrc_msm.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c > index 7d191928e55b..2ed9a181f4b6 100644 > --- a/drivers/usb/chipidea/ci_hdrc_msm.c > +++ b/drivers/usb/chipidea/ci_hdrc_msm.c > @@ -241,7 +241,8 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev) > plat_ci = ci_hdrc_add_device(&pdev->dev, pdev->resource, > pdev->num_resources, &ci->pdata); > if (IS_ERR(plat_ci)) { > - dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > + if (PTR_ERR(plat_ci) != -EPROBE_DEFER) > + dev_err(&pdev->dev, "ci_hdrc_add_device failed!\n"); > ret = PTR_ERR(plat_ci); > goto err_mux; > } Why not let ret equals to PTR_ERR(plat_ci) first, and using ret to compare? -- Best Regards, Peter Chen