ARM: shmobile: marzen: Use error values in usb_power_*

This patch updates the marzen board code as if USB PHY isn't enabled
they phy will have a value set by ERR_PTR() rather than be NULL.

Without this patch a NULL pointer dereference  and kernel panic
occurs on initialisation of USB on marzen.

This resolves a regression introduced in 3.10-rc1 by
b7fa5c2aec
("usb: phy: return -ENXIO when PHY layer isn't enabled").

Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
This commit is contained in:
Simon Horman 2013-05-16 12:14:59 +09:00
parent f722406faa
commit 5f10428e4a
1 changed files with 3 additions and 3 deletions

View File

@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
static struct usb_phy *phy;
static int usb_power_on(struct platform_device *pdev)
{
if (!phy)
return -EIO;
if (IS_ERR(phy))
return PTR_ERR(phy);
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);
@ -225,7 +225,7 @@ static int usb_power_on(struct platform_device *pdev)
static void usb_power_off(struct platform_device *pdev)
{
if (!phy)
if (IS_ERR(phy))
return;
usb_phy_shutdown(phy);