Commit 1abd8b31 authored by Robert Jarzmik's avatar Robert Jarzmik Committed by Felipe Balbi

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: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 9d6ab420
...@@ -799,6 +799,7 @@ static int fsl_otg_conf(struct platform_device *pdev) ...@@ -799,6 +799,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
/* initialize the otg structure */ /* initialize the otg structure */
fsl_otg_tc->phy.label = DRIVER_DESC; fsl_otg_tc->phy.label = DRIVER_DESC;
fsl_otg_tc->phy.dev = &pdev->dev;
fsl_otg_tc->phy.set_power = fsl_otg_set_power; fsl_otg_tc->phy.set_power = fsl_otg_set_power;
fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy;
......
...@@ -266,6 +266,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev) ...@@ -266,6 +266,7 @@ static int __init gpio_vbus_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, gpio_vbus); platform_set_drvdata(pdev, gpio_vbus);
gpio_vbus->dev = &pdev->dev; gpio_vbus->dev = &pdev->dev;
gpio_vbus->phy.label = "gpio-vbus"; 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_power = gpio_vbus_set_power;
gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend; gpio_vbus->phy.set_suspend = gpio_vbus_set_suspend;
gpio_vbus->phy.state = OTG_STATE_UNDEFINED; gpio_vbus->phy.state = OTG_STATE_UNDEFINED;
......
...@@ -102,6 +102,7 @@ static int isp1301_probe(struct i2c_client *client, ...@@ -102,6 +102,7 @@ static int isp1301_probe(struct i2c_client *client,
mutex_init(&isp->mutex); mutex_init(&isp->mutex);
phy = &isp->phy; phy = &isp->phy;
phy->dev = &client->dev;
phy->label = DRV_NAME; phy->label = DRV_NAME;
phy->init = isp1301_phy_init; phy->init = isp1301_phy_init;
phy->set_vbus = isp1301_phy_set_vbus; phy->set_vbus = isp1301_phy_set_vbus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment