linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
@ 2011-11-03  9:58 Shaohui Xie
  2011-11-03 11:14 ` David Laight
  2011-11-03 11:38 ` Tabi Timur-B04825
  0 siblings, 2 replies; 8+ messages in thread
From: Shaohui Xie @ 2011-11-03  9:58 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: linux-usb, Shaohui Xie

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 unsigned long for both 32-bit and 64-bit.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/usb/gadget/fsl_udc_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index c81fbad..581b7cc 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2498,7 +2498,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);
+				((unsigned long)dr_regs + USB_DR_SYS_OFFSET);
 #endif
 
 	/* Initialize USB clocks */
-- 
1.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-11-03 22:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-03  9:58 [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap Shaohui Xie
2011-11-03 11:14 ` David Laight
2011-11-03 11:38 ` Tabi Timur-B04825
2011-11-03 11:38   ` David Laight
2011-11-03 12:07     ` Tabi Timur-B04825
2011-11-03 12:16       ` David Laight
2011-11-03 14:12         ` Timur Tabi
2011-11-03 22:08         ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).