提交 185d0fd5 编写于 作者: T Tuomas Tynkkynen 提交者: Felipe Balbi

usb: phy: tegra: Remove unnecessary 'dev' field

struct usb_phy already has a field for the device pointer, so this
unnecessary field can be removed.
Signed-off-by: NTuomas Tynkkynen <ttynkkynen@nvidia.com>
Reviewed-by: NStephen Warren <swarren@nvidia.com>
Tested-by: NStephen Warren <swarren@nvidia.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 103566e4
...@@ -211,7 +211,7 @@ static void set_phcd(struct tegra_usb_phy *phy, bool enable) ...@@ -211,7 +211,7 @@ static void set_phcd(struct tegra_usb_phy *phy, bool enable)
static int utmip_pad_open(struct tegra_usb_phy *phy) static int utmip_pad_open(struct tegra_usb_phy *phy)
{ {
phy->pad_clk = devm_clk_get(phy->dev, "utmi-pads"); phy->pad_clk = devm_clk_get(phy->u_phy.dev, "utmi-pads");
if (IS_ERR(phy->pad_clk)) { if (IS_ERR(phy->pad_clk)) {
pr_err("%s: can't get utmip pad clock\n", __func__); pr_err("%s: can't get utmip pad clock\n", __func__);
return PTR_ERR(phy->pad_clk); return PTR_ERR(phy->pad_clk);
...@@ -540,13 +540,15 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy) ...@@ -540,13 +540,15 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
ret = gpio_direction_output(phy->reset_gpio, 0); ret = gpio_direction_output(phy->reset_gpio, 0);
if (ret < 0) { if (ret < 0) {
dev_err(phy->dev, "gpio %d not set to 0\n", phy->reset_gpio); dev_err(phy->u_phy.dev, "gpio %d not set to 0\n",
phy->reset_gpio);
return ret; return ret;
} }
msleep(5); msleep(5);
ret = gpio_direction_output(phy->reset_gpio, 1); ret = gpio_direction_output(phy->reset_gpio, 1);
if (ret < 0) { if (ret < 0) {
dev_err(phy->dev, "gpio %d not set to 1\n", phy->reset_gpio); dev_err(phy->u_phy.dev, "gpio %d not set to 1\n",
phy->reset_gpio);
return ret; return ret;
} }
...@@ -649,29 +651,30 @@ static int ulpi_open(struct tegra_usb_phy *phy) ...@@ -649,29 +651,30 @@ static int ulpi_open(struct tegra_usb_phy *phy)
{ {
int err; int err;
phy->clk = devm_clk_get(phy->dev, "ulpi-link"); phy->clk = devm_clk_get(phy->u_phy.dev, "ulpi-link");
if (IS_ERR(phy->clk)) { if (IS_ERR(phy->clk)) {
pr_err("%s: can't get ulpi clock\n", __func__); pr_err("%s: can't get ulpi clock\n", __func__);
return PTR_ERR(phy->clk); return PTR_ERR(phy->clk);
} }
err = devm_gpio_request(phy->dev, phy->reset_gpio, "ulpi_phy_reset_b"); err = devm_gpio_request(phy->u_phy.dev, phy->reset_gpio,
"ulpi_phy_reset_b");
if (err < 0) { if (err < 0) {
dev_err(phy->dev, "request failed for gpio: %d\n", dev_err(phy->u_phy.dev, "request failed for gpio: %d\n",
phy->reset_gpio); phy->reset_gpio);
return err; return err;
} }
err = gpio_direction_output(phy->reset_gpio, 0); err = gpio_direction_output(phy->reset_gpio, 0);
if (err < 0) { if (err < 0) {
dev_err(phy->dev, "gpio %d direction not set to output\n", dev_err(phy->u_phy.dev, "gpio %d direction not set to output\n",
phy->reset_gpio); phy->reset_gpio);
return err; return err;
} }
phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0); phy->ulpi = otg_ulpi_create(&ulpi_viewport_access_ops, 0);
if (!phy->ulpi) { if (!phy->ulpi) {
dev_err(phy->dev, "otg_ulpi_create returned NULL\n"); dev_err(phy->u_phy.dev, "otg_ulpi_create returned NULL\n");
err = -ENOMEM; err = -ENOMEM;
return err; return err;
} }
...@@ -686,7 +689,7 @@ static int tegra_usb_phy_init(struct tegra_usb_phy *phy) ...@@ -686,7 +689,7 @@ static int tegra_usb_phy_init(struct tegra_usb_phy *phy)
int i; int i;
int err; int err;
phy->pll_u = devm_clk_get(phy->dev, "pll_u"); phy->pll_u = devm_clk_get(phy->u_phy.dev, "pll_u");
if (IS_ERR(phy->pll_u)) { if (IS_ERR(phy->pll_u)) {
pr_err("Can't get pll_u clock\n"); pr_err("Can't get pll_u clock\n");
return PTR_ERR(phy->pll_u); return PTR_ERR(phy->pll_u);
...@@ -712,7 +715,7 @@ static int tegra_usb_phy_init(struct tegra_usb_phy *phy) ...@@ -712,7 +715,7 @@ static int tegra_usb_phy_init(struct tegra_usb_phy *phy)
if (!IS_ERR(phy->vbus)) { if (!IS_ERR(phy->vbus)) {
err = regulator_enable(phy->vbus); err = regulator_enable(phy->vbus);
if (err) { if (err) {
dev_err(phy->dev, dev_err(phy->u_phy.dev,
"failed to enable usb vbus regulator: %d\n", "failed to enable usb vbus regulator: %d\n",
err); err);
goto fail; goto fail;
...@@ -920,7 +923,7 @@ static int tegra_usb_phy_probe(struct platform_device *pdev) ...@@ -920,7 +923,7 @@ static int tegra_usb_phy_probe(struct platform_device *pdev)
tegra_phy->vbus = ERR_PTR(-ENODEV); tegra_phy->vbus = ERR_PTR(-ENODEV);
} }
tegra_phy->dev = &pdev->dev; tegra_phy->u_phy.dev = &pdev->dev;
err = tegra_usb_phy_init(tegra_phy); err = tegra_usb_phy_init(tegra_phy);
if (err < 0) if (err < 0)
return err; return err;
...@@ -953,7 +956,7 @@ static int tegra_usb_phy_match(struct device *dev, void *data) ...@@ -953,7 +956,7 @@ static int tegra_usb_phy_match(struct device *dev, void *data)
struct tegra_usb_phy *tegra_phy = dev_get_drvdata(dev); struct tegra_usb_phy *tegra_phy = dev_get_drvdata(dev);
struct device_node *dn = data; struct device_node *dn = data;
return (tegra_phy->dev->of_node == dn) ? 1 : 0; return (tegra_phy->u_phy.dev->of_node == dn) ? 1 : 0;
} }
struct usb_phy *tegra_usb_get_phy(struct device_node *dn) struct usb_phy *tegra_usb_get_phy(struct device_node *dn)
......
...@@ -60,7 +60,6 @@ struct tegra_usb_phy { ...@@ -60,7 +60,6 @@ struct tegra_usb_phy {
void *config; void *config;
struct usb_phy *ulpi; struct usb_phy *ulpi;
struct usb_phy u_phy; struct usb_phy u_phy;
struct device *dev;
bool is_legacy_phy; bool is_legacy_phy;
bool is_ulpi_phy; bool is_ulpi_phy;
int reset_gpio; int reset_gpio;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册