提交 456bb169 编写于 作者: M Ming Lei 提交者: Felipe Balbi

usb: musb: fix kernel panic during s2ram(v2)

This patch fixes kernel panic during s2ram, which is caused
by the below:

	- musb is not put into drv data of musb platform device if
	CONFIG_USB_MUSB_HDRC_HCD is defined

	- glue layer driver always get musb instance via platform_get_drvdata.

The patch fixes the issue by always puting musb into drv data
of musb platform device, which is doable even the platform device
is a host controller device.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: NMing Lei <tom.leiming@gmail.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 ebf53826
...@@ -128,12 +128,7 @@ MODULE_ALIAS("platform:" MUSB_DRIVER_NAME); ...@@ -128,12 +128,7 @@ MODULE_ALIAS("platform:" MUSB_DRIVER_NAME);
static inline struct musb *dev_to_musb(struct device *dev) static inline struct musb *dev_to_musb(struct device *dev)
{ {
#ifdef CONFIG_USB_MUSB_HDRC_HCD
/* usbcore insists dev->driver_data is a "struct hcd *" */
return hcd_to_musb(dev_get_drvdata(dev));
#else
return dev_get_drvdata(dev); return dev_get_drvdata(dev);
#endif
} }
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -1876,10 +1871,9 @@ allocate_instance(struct device *dev, ...@@ -1876,10 +1871,9 @@ allocate_instance(struct device *dev,
musb = kzalloc(sizeof *musb, GFP_KERNEL); musb = kzalloc(sizeof *musb, GFP_KERNEL);
if (!musb) if (!musb)
return NULL; return NULL;
dev_set_drvdata(dev, musb);
#endif #endif
dev_set_drvdata(dev, musb);
musb->mregs = mbase; musb->mregs = mbase;
musb->ctrl_base = mbase; musb->ctrl_base = mbase;
musb->nIrq = -ENODEV; musb->nIrq = -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册