Subject: [PATCH] ARM: Orion: fix driver probe error handling with respect to clk

From: [email-masked] (Andrew Lunn)
Date: Thu, 19 Jul 2012 08:37:36 +0200

On Thu, Jul 19, 2012 at 12:04:09AM +0200, Simon Baatz wrote:
> The clk patches added code to get and enable clocks in the
> respective driver probe functions.  If the probe function failed
> for some reason after enabling the clock, the clock was not
> disabled again in many cases.
> 
> Signed-off-by: Simon Baatz <[email-masked]>

Hi Simon

Looks mostly good. I can pull this into my collection of orion
patches.

> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index f0f06b2..c496720 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2983,6 +2983,10 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
>  	return 0;
>  
>  out:
> +	if (!IS_ERR(mp->clk)) {
> +		clk_disable_unprepare(mp->clk);
> +		clk_put(mp->clk);
> +	}
>  	free_netdev(dev);
>  
>  	return err;

The ethernet driver is build on platforms which don't have clk
support. So this needs to be inside

#if defined(CONFIG_HAVE_CLK)
#endif

I will add this.

  Andrew