diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2013-05-10 09:45:08 (GMT) |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-05-15 14:32:47 (GMT) |
commit | 1abd8b3172b701ed626df4ebf09b7fe7f329888a (patch) | |
tree | e5edc969a6f01954507c3cf7224efa64e6f52f0d /drivers/usb/phy/phy-gpio-vbus-usb.c | |
parent | 9d6ab420a9cb475fb99874f06d00df9c8259c973 (diff) | |
download | linux-1abd8b3172b701ed626df4ebf09b7fe7f329888a.tar.xz |
usb: phy: Fix NULL pointer exception during usb_get_phy
Upon initialisation (driver probe) a NULL pointer exception
is triggered. This is due to lack of initialisation of
device field in phy structure, which is used by phy
framework in usb_get_phy().
Fix it by initialising the device field.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-gpio-vbus-usb.c')
-rw-r--r-- | drivers/usb/phy/phy-gpio-vbus-usb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c index 1d32af2..8443335 100644 --- a/drivers/usb/phy/phy-gpio-vbus-usb.c +++ b/drivers/usb/phy/phy-gpio-vbus-usb.c @@ -266,6 +266,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) platform_set_drvdata(pdev, gpio_vbus); gpio_vbus->dev = &pdev->dev; gpio_vbus->phy.label = "gpio-vbus"; + gpio_vbus->phy.dev = gpio_vbus->dev; gpio_vbus->phy.set_power = gpio_vbus_set_power; gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; gpio_vbus->phy.state = OTG_STATE_UNDEFINED; |