linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Franklin S Cooper Jr <fcooper@ti.com>
To: wsa@the-dreams.de, robh+dt@kernel.org, linux@armlinux.org.uk,
	nsekhar@ti.com, linux-i2c@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Franklin S Cooper Jr <fcooper@ti.com>
Subject: [PATCH 1/4] i2c: davinci: Preserve return value of devm_clk_get
Date: Wed, 2 Aug 2017 17:17:50 -0500	[thread overview]
Message-ID: <20170802221753.13786-2-fcooper@ti.com> (raw)
In-Reply-To: <20170802221753.13786-1-fcooper@ti.com>

The i2c driver can run into driver dependency issues if its loaded
before a clock driver it depends on. Therefore, EPROBE_DEFER may be
returned by devm_clk_get and should be returned in probe to allow the
kernel to reprobe the driver at a later time. This patch allows the error
value returned by devm_clk_get to be passed through and not overwritten.

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 drivers/i2c/busses/i2c-davinci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 9e7ef5c..5749aac 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -801,7 +801,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 
 	dev->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(dev->clk))
-		return -ENODEV;
+		return PTR_ERR(dev->clk);
 	clk_prepare_enable(dev->clk);
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
2.9.4.dirty

  reply	other threads:[~2017-08-02 22:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-02 22:17 [PATCH 0/4] ARM: dts: keystone-k2g: Add I2C support for 66AK2G Franklin S Cooper Jr
2017-08-02 22:17 ` Franklin S Cooper Jr [this message]
2017-08-11 22:00   ` [PATCH 1/4] i2c: davinci: Preserve return value of devm_clk_get Grygorii Strashko
2017-08-02 22:17 ` [PATCH 2/4] i2c: davinci: Add PM Runtime Support Franklin S Cooper Jr
2017-08-11 22:11   ` Grygorii Strashko
     [not found] ` <20170802221753.13786-1-fcooper-l0cyMroinI0@public.gmane.org>
2017-08-02 22:17   ` [PATCH 3/4] dt-bindings: i2c: i2c-davinci: Update binding for 66AK2Gx pwr dm property Franklin S Cooper Jr
2017-08-10 16:36     ` Rob Herring
2017-08-02 22:17 ` [PATCH 4/4] ARM: dts: keystone-k2g: Add I2C nodes Franklin S Cooper Jr
2017-08-11 22:18   ` Grygorii Strashko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170802221753.13786-2-fcooper@ti.com \
    --to=fcooper@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nsekhar@ti.com \
    --cc=robh+dt@kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).