Skip to content

Commit

Permalink
powerpc/usb: fix type cast for address of ioremap to compatible with …
Browse files Browse the repository at this point in the history
…64-bit

Below are codes for accessing usb sysif_regs in driver:

usb_sys_regs = (struct usb_sys_interface *)
	((u32)dr_regs + USB_DR_SYS_OFFSET);

these codes work in 32-bit, but in 64-bit, use u32 to type cast the address
of ioremap is not right, and accessing members of 'usb_sys_regs' will cause
call trace, so use (void *) for both 32-bit and 64-bit.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Shaohui Xie authored and Greg Kroah-Hartman committed Nov 14, 2011
1 parent 770f0ba commit 8981d76
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/gadget/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2480,8 +2480,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)

#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 = (void *)dr_regs + USB_DR_SYS_OFFSET;
#endif

/* Initialize USB clocks */
Expand Down

0 comments on commit 8981d76

Please sign in to comment.