[PATCH] dmaengine: dw: support for clockless platforms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux