diff mbox

[2/2] pinctrl: mvebu: make pdma clock on dove mandatory

Message ID 1353921634-25210-1-git-send-email-sebastian.hesselbarth@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Hesselbarth Nov. 26, 2012, 9:20 a.m. UTC
With the ability to pass clocks through DT, now make the pdma
clock of dove pinctrl mandatory. Otherwise, pinctrl will hang
the system when accessing some registers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Axel Lin <axel.lin@ingics.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org 
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/pinctrl/mvebu/pinctrl-dove.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Baruch Siach Nov. 26, 2012, 9:30 a.m. UTC | #1
Hi Sebastian,

On Mon, Nov 26, 2012 at 10:20:34AM +0100, Sebastian Hesselbarth wrote:

[...]

> diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c 
> b/drivers/pinctrl/mvebu/pinctrl-dove.c
> index 40c9c3e..90f257d 100644
> --- a/drivers/pinctrl/mvebu/pinctrl-dove.c
> +++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
> @@ -595,8 +595,11 @@ static int __devinit dove_pinctrl_probe(struct platform_device *pdev)
>  	 * grab clk to make sure it is ticking.
>  	 */
>  	clk = devm_clk_get(&pdev->dev, NULL);
> -	if (!IS_ERR(clk))
> -		clk_prepare_enable(clk);
> +	if (IS_ERR(clk)) {
> +		dev_err(&pdev->dev, "Unable to get pdma clock");
> +		return -ENODEV;

Why not propagate the error up using PTR_RET(clk)?

baruch

> +	}
> +	clk_prepare_enable(clk);
>  
>  	return mvebu_pinctrl_probe(pdev);
>  }
diff mbox

Patch

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index 40c9c3e..90f257d 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -595,8 +595,11 @@  static int __devinit dove_pinctrl_probe(struct platform_device *pdev)
 	 * grab clk to make sure it is ticking.
 	 */
 	clk = devm_clk_get(&pdev->dev, NULL);
-	if (!IS_ERR(clk))
-		clk_prepare_enable(clk);
+	if (IS_ERR(clk)) {
+		dev_err(&pdev->dev, "Unable to get pdma clock");
+		return -ENODEV;
+	}
+	clk_prepare_enable(clk);
 
 	return mvebu_pinctrl_probe(pdev);
 }