[PATCH] powerpc/usb: use ioremap instead of base plus offset to access regs

David Laight David.Laight at ACULAB.COM
Wed Nov 2 20:06:33 EST 2011


 
>  #ifndef CONFIG_ARCH_MXC
>  	if (pdata->have_sysif_regs)
> -		usb_sys_regs = (struct usb_sys_interface *)
> -				((u32)dr_regs + USB_DR_SYS_OFFSET);
> +		usb_sys_regs = ioremap(res->start + USB_DR_SYS_OFFSET,
> +				sizeof(struct
usb_sys_interface)/sizeof(int));
>  #endif

That ioremap() doesn't look right.
Isn't the 'size' in bytes??
(Although it will only matter if it crosses a page boundary.)
Mind you, I'd have though the original ioremap() should
have covered the entire structure??

	David




More information about the Linuxppc-dev mailing list