[U-Boot] [PATCH] fsl-diu: Using I/O accessor to CCSR space

Timur Tabi timur.tabi at gmail.com
Wed Apr 7 16:35:21 CEST 2010


Dave Liu wrote:

> @@ -369,8 +370,8 @@ static int fsl_diu_enable_panel(struct fb_info *info)
>  	struct diu_ad *ad = &fsl_diu_fb_ad;
>
>  	debug("Entered: enable_panel\n");
> -	if (hw->desc[0] != (unsigned int)ad)
> -		hw->desc[0] = (unsigned int)ad;
> +	if (in_be32(&hw->desc[0]) != (unsigned int)ad)
> +		out_be32(&hw->desc[0], ad);

'ad' should be cast to a u32, not an "unsigned int".  You shouldn't
compare a sized type with an unsized type.

>  	debug("desc[0] = 0x%x\n", hw->desc[0]);
>  	return 0;
>  }
> @@ -380,8 +381,8 @@ static int fsl_diu_disable_panel(struct fb_info *info)
>  	struct diu *hw = dr.diu_reg;
>
>  	debug("Entered: disable_panel\n");
> -	if (hw->desc[0] != (unsigned int)&dummy_ad)
> -		hw->desc[0] = (unsigned int)&dummy_ad;
> +	if (in_be32(&hw->desc[0]) != (unsigned int)&dummy_ad)
> +		out_be32(&hw->desc[0], &dummy_ad);

Same thing here.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list