Message ID | 1500435259-5838-1-git-send-email-festevam@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1dXflG-0007dm-PI; Wed, 19 Jul 2017 03:34:54 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.89/mailfrontend-6) with esmtp id 1dXflE-0002Dt-4E; Wed, 19 Jul 2017 05:34:54 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752045AbdGSDet (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 18 Jul 2017 23:34:49 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:34491 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdGSDes (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 18 Jul 2017 23:34:48 -0400 Received: by mail-qk0-f195.google.com with SMTP id q66so4860020qki.1 for <linux-media@vger.kernel.org>; Tue, 18 Jul 2017 20:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yg8vn2t/w5lDGgeuGaFRtA+wrYRjafLlVpafWp8gIYE=; b=cl8yyGjN7iE+I81/T8bRLh/MWtfIsfjpoAiwnoBkT52VdxMIr0XcH5zoWhTjrErg93 okN3xpcW+9ZItn45zPBrSappptur8ydXQJtE57rK6Ye3d8HD0seeZA49oR2wPxAk2GHl FfXouP+wwuk8VOBNQFKh0JJN7SXkI6vAsgP5UoKki/qT4dG4bg6ifm9ZAErdS0DK+8z6 nmnZH1FSSB5uGAAjwd3xLbbvn/o6KwQa6OS1//mZHDK7VKxI35GXaSGUg+J7uEIlAWSe PS2d5ve0Lt9FahDloqISfO+jCP+m2Pf+y7TI+uOvMIeGqy57YDsqi7ovULTJYrR5S6/i pXEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yg8vn2t/w5lDGgeuGaFRtA+wrYRjafLlVpafWp8gIYE=; b=OPeuUYnStYZJkRMVcuaQ8Bu0INuRhjeAUloBj65A+DQ86osoZhr+Wf5OKH/NbvBaWd XmeGR91MZ6VvVoh1TegGp6jcNR+vQu99TPbq49PfX/gYaIrBE8e8a45MvOfbNeDhpD/F 4W+4dh88Ms371G3LswWH3xbXnkYFDeqfjFWk19/Jawyk2QlnOGwte9opBpgXTGENpf8e WI5yeOyGaYDM9H2sH7plG4ki2umqC1mB+a5c7RkpXcEEg9B7P2e+Z4dDaSONGzolI9yN uo7iD2mui3iT+3qfHco6eSGK6XAUIrGcSJHTCImPGjUl4r6V20XfKAxLErUokKtoc6rD qjcA== X-Gm-Message-State: AIVw112mmUs+R9Nwh2rJn58st9UMnRQvLB0MV526FB0lD6d44bk6ZRjX iOu/4YWPL9d3hT00 X-Received: by 10.55.96.6 with SMTP id u6mr936510qkb.104.1500435288007; Tue, 18 Jul 2017 20:34:48 -0700 (PDT) Received: from localhost.localdomain ([189.61.213.245]) by smtp.gmail.com with ESMTPSA id u67sm2963376qkd.67.2017.07.18.20.34.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 18 Jul 2017 20:34:47 -0700 (PDT) From: Fabio Estevam <festevam@gmail.com> To: mchehab@s-opensource.com Cc: hans.verkuil@cisco.com, corbet@lwn.net, linux-media@vger.kernel.org, Fabio Estevam <fabio.estevam@nxp.com> Subject: [PATCH 1/2] [media] ov7670: Return the real error code Date: Wed, 19 Jul 2017 00:34:18 -0300 Message-Id: <1500435259-5838-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.7.19.32115 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_700_799 0, DKIM_SIGNATURE 0, NO_URI_HTTPS 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MULTIPLE_RCPTS_CC_X2 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' |
Commit Message
Fabio Estevam
July 19, 2017, 3:34 a.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com> When devm_clk_get() fails the real error code should be propagated, instead of always returning -EPROBE_DEFER. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> --- drivers/media/i2c/ov7670.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Jul 19, 2017 at 12:34:18AM -0300, Fabio Estevam wrote: > From: Fabio Estevam <fabio.estevam@nxp.com> > > When devm_clk_get() fails the real error code should be propagated, > instead of always returning -EPROBE_DEFER. > > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Hi Fabio, I don't think -EPROBE_DEFER is returned by clk_get() if the clock can't be found. The clock providers often are e.g. ISP drivers that may well be loaded after the sensor driver. In that case this change would prevent successful initialisation of the drivers. > --- > drivers/media/i2c/ov7670.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c > index 7270c68..552a881 100644 > --- a/drivers/media/i2c/ov7670.c > +++ b/drivers/media/i2c/ov7670.c > @@ -1614,7 +1614,7 @@ static int ov7670_probe(struct i2c_client *client, > > info->clk = devm_clk_get(&client->dev, "xclk"); > if (IS_ERR(info->clk)) > - return -EPROBE_DEFER; > + return PTR_ERR(info->clk); > clk_prepare_enable(info->clk); > > ret = ov7670_init_gpio(client, info); > -- > 2.7.4 >
Hi Sakari, On Tue, Aug 8, 2017 at 8:24 AM, Sakari Ailus <sakari.ailus@iki.fi> wrote: > I don't think -EPROBE_DEFER is returned by clk_get() if the clock can't be > found. The clock providers often are e.g. ISP drivers that may well be Yes, it is. Please check: commit a34cd4666f3da84228a82f70c94b8d9b692034ea Author: Jean-Francois Moine <moinejf@free.fr> Date: Mon Nov 25 19:47:04 2013 +0100 clk: return probe defer when DT clock not yet ready At probe time, a clock device may not be ready when some other device wants to use it. This patch lets the functions clk_get/devm_clk_get return a probe defer when the clock is defined in the DT but not yet available. Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Tested-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
On Tue, Aug 08, 2017 at 08:56:14AM -0300, Fabio Estevam wrote: > Hi Sakari, > > On Tue, Aug 8, 2017 at 8:24 AM, Sakari Ailus <sakari.ailus@iki.fi> wrote: > > > I don't think -EPROBE_DEFER is returned by clk_get() if the clock can't be > > found. The clock providers often are e.g. ISP drivers that may well be > > Yes, it is. > > Please check: > > commit a34cd4666f3da84228a82f70c94b8d9b692034ea > Author: Jean-Francois Moine <moinejf@free.fr> > Date: Mon Nov 25 19:47:04 2013 +0100 > > clk: return probe defer when DT clock not yet ready > > At probe time, a clock device may not be ready when some other device > wants to use it. > > This patch lets the functions clk_get/devm_clk_get return a probe defer > when the clock is defined in the DT but not yet available. Nice! I'll apply both then. Thanks!
diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c index 7270c68..552a881 100644 --- a/drivers/media/i2c/ov7670.c +++ b/drivers/media/i2c/ov7670.c @@ -1614,7 +1614,7 @@ static int ov7670_probe(struct i2c_client *client, info->clk = devm_clk_get(&client->dev, "xclk"); if (IS_ERR(info->clk)) - return -EPROBE_DEFER; + return PTR_ERR(info->clk); clk_prepare_enable(info->clk); ret = ov7670_init_gpio(client, info);