Commit 918f0f23 authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Greg Kroah-Hartman

usb: mtu3: rebuild the code of getting vbus regulator

Remove local variable @vbus and use @dev instead of @pdev->dev
Signed-off-by: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 13d944eb
...@@ -228,7 +228,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) ...@@ -228,7 +228,6 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
struct device_node *node = pdev->dev.of_node; struct device_node *node = pdev->dev.of_node;
struct otg_switch_mtk *otg_sx = &ssusb->otg_switch; struct otg_switch_mtk *otg_sx = &ssusb->otg_switch;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct regulator *vbus;
struct resource *res; struct resource *res;
int i; int i;
int ret; int ret;
...@@ -299,12 +298,11 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) ...@@ -299,12 +298,11 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
of_property_read_u32(node, "mediatek,u3p-dis-msk", of_property_read_u32(node, "mediatek,u3p-dis-msk",
&ssusb->u3p_dis_msk); &ssusb->u3p_dis_msk);
vbus = devm_regulator_get(&pdev->dev, "vbus"); otg_sx->vbus = devm_regulator_get(dev, "vbus");
if (IS_ERR(vbus)) { if (IS_ERR(otg_sx->vbus)) {
dev_err(dev, "failed to get vbus\n"); dev_err(dev, "failed to get vbus\n");
return PTR_ERR(vbus); return PTR_ERR(otg_sx->vbus);
} }
otg_sx->vbus = vbus;
if (ssusb->dr_mode == USB_DR_MODE_HOST) if (ssusb->dr_mode == USB_DR_MODE_HOST)
goto out; goto out;
......
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