usb: gadget: renesas_usbhs: bugfix: don't modify platform data

renesas_usbhs has default callback functions and settings.
And it tried overwrite to platform private data
if platform doesn't have them.
So, if renesas_usbhs was compiled as module,
it will be hung-up on 2nd insmod.
This patch fixup it.
Special thanks to Bastian

Reported-by: Bastian Hecht <hechtb@googlemail.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Kuninori Morimoto
2011-10-12 21:02:22 -07:00
committed by Felipe Balbi
parent 034d7c13a7
commit 482982062f
3 changed files with 18 additions and 14 deletions

View File

@@ -242,8 +242,8 @@ struct usbhs_priv {
void __iomem *base;
unsigned int irq;
struct renesas_usbhs_platform_callback *pfunc;
struct renesas_usbhs_driver_param *dparam;
struct renesas_usbhs_platform_callback pfunc;
struct renesas_usbhs_driver_param dparam;
struct delayed_work notify_hotplug_work;
struct platform_device *pdev;
@@ -318,7 +318,7 @@ int usbhs_set_device_speed(struct usbhs_priv *priv, int devnum, u16 upphub,
* data
*/
struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev);
#define usbhs_get_dparam(priv, param) (priv->dparam->param)
#define usbhs_get_dparam(priv, param) (priv->dparam.param)
#define usbhs_priv_to_pdev(priv) (priv->pdev)
#define usbhs_priv_to_dev(priv) (&priv->pdev->dev)
#define usbhs_priv_to_lock(priv) (&priv->lock)