mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Viresh Kumar <viresh.linux@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>,
	linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org
Subject: [PATCH] dmaengine: dw: support for clockless platforms
Date: Tue, 20 Jan 2015 14:57:57 +0200	[thread overview]
Message-ID: <1421758677-183443-1-git-send-email-heikki.krogerus@linux.intel.com> (raw)

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


             reply	other threads:[~2015-01-20 12:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 12:57 Heikki Krogerus [this message]
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

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=1421758677-183443-1-git-send-email-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    --cc=viresh.linux@gmail.com \
    /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

all inboxes | Powered by JetHome®