public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw: support for clockless platforms
@ 2015-01-20 12:57 Heikki Krogerus
  2015-01-20 14:18 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Heikki Krogerus @ 2015-01-20 12:57 UTC (permalink / raw)
  To: Viresh Kumar, Andy Shevchenko; +Cc: Vinod Koul, linux-kernel, dmaengine

When requesting clock in the platform driver, leaving
chip->clk value as NULL if -ENOENT is returned, and
continue. With other errors returning failure. It makes the
driver usable on platforms that do not provide the clock.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/dma/dw/platform.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c
index 32ea1ac..b183bc0 100644
--- a/drivers/dma/dw/platform.c
+++ b/drivers/dma/dw/platform.c
@@ -180,8 +180,12 @@ static int dw_probe(struct platform_device *pdev)
 	chip->dev = dev;
 
 	chip->clk = devm_clk_get(chip->dev, "hclk");
-	if (IS_ERR(chip->clk))
-		return PTR_ERR(chip->clk);
+	if (IS_ERR(chip->clk)) {
+		if (PTR_ERR(chip->clk) == -ENOENT)
+			chip->clk = NULL;
+		else
+			return PTR_ERR(chip->clk);
+	}
 	err = clk_prepare_enable(chip->clk);
 	if (err)
 		return err;
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-11 12:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 12:57 [PATCH] dmaengine: dw: support for clockless platforms Heikki Krogerus
2015-01-20 14:18 ` Andy Shevchenko
2015-02-11  1:20 ` Vinod Koul
2015-02-11  2:10 ` Viresh Kumar
2015-02-11 12:02   ` Andy Shevchenko
2015-02-11 12:07     ` Russell King - ARM Linux
2015-02-11 12:19       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox