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

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Sep 11 22:47:32 EDT 2011


On 13:46 Fri 09 Sep     , Hubert Feurstein wrote:
> Signed-off-by: Hubert Feurstein <h.feurstein at gmail.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>

Best Regards,
J.
> ---
>  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);
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox



More information about the barebox mailing list