Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751729AbdHBWTB (ORCPT ); Wed, 2 Aug 2017 18:19:01 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:39685 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbdHBWS7 (ORCPT ); Wed, 2 Aug 2017 18:18:59 -0400 From: Franklin S Cooper Jr To: , , , , , , , CC: Franklin S Cooper Jr Subject: [PATCH 1/4] i2c: davinci: Preserve return value of devm_clk_get Date: Wed, 2 Aug 2017 17:17:50 -0500 Message-ID: <20170802221753.13786-2-fcooper@ti.com> X-Mailer: git-send-email 2.9.4.dirty In-Reply-To: <20170802221753.13786-1-fcooper@ti.com> References: <20170802221753.13786-1-fcooper@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 28 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 Signed-off-by: Franklin S Cooper Jr Signed-off-by: Sekhar Nori --- 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