[PATCH 3/4] atmel_mci: handle clk_get error correctly

Sascha Hauer s.hauer at pengutronix.de
Mon Sep 12 06:28:15 EDT 2011


On Fri, Sep 09, 2011 at 01:46:48PM +0200, Hubert Feurstein wrote:
> Signed-off-by: Hubert Feurstein <h.feurstein at gmail.com>
> ---
>  drivers/mci/atmel_mci.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
> index b4489dd..943ab34 100644
> --- a/drivers/mci/atmel_mci.c
> +++ b/drivers/mci/atmel_mci.c
> @@ -23,6 +23,7 @@
>  #include <asm/io.h>
>  #include <mach/board.h>
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  
>  #include "at91_mci.h"
>  
> @@ -460,9 +461,9 @@ static int mci_probe(struct device_d *hw_dev)
>  	host->hw_dev = hw_dev;
>  	hw_dev->priv = host;
>  	host->clk = clk_get(hw_dev, "mci_clk");
> -	if (host->clk == NULL) {
> +	if (IS_ERR(host->clk)) {
>  		dev_err(hw_dev, "no mci_clk\n");
> -		return -EINVAL;
> +		return PTR_ERR(host->clk);
>  	}
>  
>  	clk_rate = clk_get_rate(host->clk);

Applied 1-3 to next (could have gone to master, but the fixes are
probably not that urgent)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list