diff mbox series

[1/4] dmaengine: qcom: bam_dma: make bam clk optional

Message ID 20180116190236.14558-2-srinivas.kandagatla@linaro.org
State New
Headers show
Series [1/4] dmaengine: qcom: bam_dma: make bam clk optional | expand

Commit Message

Srinivas Kandagatla Jan. 16, 2018, 7:02 p.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


When BAM is remotely controlled it does not sound correct to control
its clk on Linux side. Make it optional, so that its not madatory
for remote controlled BAM instances.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

---
 drivers/dma/qcom/bam_dma.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

-- 
2.15.1

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

Comments

Vinod Koul Jan. 19, 2018, 5:52 a.m. UTC | #1
On Tue, Jan 16, 2018 at 07:02:33PM +0000, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> 

> When BAM is remotely controlled it does not sound correct to control

> its clk on Linux side. Make it optional, so that its not madatory


s/madatory/mandatory

> for remote controlled BAM instances.

> 

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---

>  drivers/dma/qcom/bam_dma.c | 15 ++++++++-------

>  1 file changed, 8 insertions(+), 7 deletions(-)

> 

> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c

> index 03c4eb3fd314..78e488e8f96d 100644

> --- a/drivers/dma/qcom/bam_dma.c

> +++ b/drivers/dma/qcom/bam_dma.c

> @@ -1180,13 +1180,14 @@ static int bam_dma_probe(struct platform_device *pdev)

>  						"qcom,controlled-remotely");

>  

>  	bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");


but you still do clk_get unconditionally?

> -	if (IS_ERR(bdev->bamclk))

> -		return PTR_ERR(bdev->bamclk);

> -

> -	ret = clk_prepare_enable(bdev->bamclk);

> -	if (ret) {

> -		dev_err(bdev->dev, "failed to prepare/enable clock\n");

> -		return ret;

> +	if (IS_ERR(bdev->bamclk)) {

> +		bdev->bamclk = NULL;

> +	} else {

> +		ret = clk_prepare_enable(bdev->bamclk);

> +		if (ret) {

> +			dev_err(bdev->dev, "failed to prepare/enable clock\n");

> +			return ret;

> +		}


wouldn't it be better to set that an instance is remote controlled and thus
not at all visible to Linux?

>  	}

>  

>  	ret = bam_init(bdev);

> -- 

> 2.15.1

> 

> --

> To unsubscribe from this list: send the line "unsubscribe dmaengine" in

> the body of a message to majordomo@vger.kernel.org

> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
~Vinod
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 03c4eb3fd314..78e488e8f96d 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1180,13 +1180,14 @@  static int bam_dma_probe(struct platform_device *pdev)
 						"qcom,controlled-remotely");
 
 	bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
-	if (IS_ERR(bdev->bamclk))
-		return PTR_ERR(bdev->bamclk);
-
-	ret = clk_prepare_enable(bdev->bamclk);
-	if (ret) {
-		dev_err(bdev->dev, "failed to prepare/enable clock\n");
-		return ret;
+	if (IS_ERR(bdev->bamclk)) {
+		bdev->bamclk = NULL;
+	} else {
+		ret = clk_prepare_enable(bdev->bamclk);
+		if (ret) {
+			dev_err(bdev->dev, "failed to prepare/enable clock\n");
+			return ret;
+		}
 	}
 
 	ret = bam_init(bdev);