提交 1fe52122 编写于 作者: K Kishon Vijay Abraham I

phy: ti-pipe3: move mem resource initialization to a separate function

No functional change. Moved mem resource initialization done in
probe to a separate function as part of cleaning up
ti_pipe3_probe.
Signed-off-by: NKishon Vijay Abraham I <kishon@ti.com>
上级 73bbc78e
...@@ -418,24 +418,17 @@ static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy) ...@@ -418,24 +418,17 @@ static int ti_pipe3_get_sysctrl(struct ti_pipe3 *phy)
return 0; return 0;
} }
static int ti_pipe3_probe(struct platform_device *pdev) static int ti_pipe3_get_pll_base(struct ti_pipe3 *phy)
{ {
struct ti_pipe3 *phy;
struct phy *generic_phy;
struct phy_provider *phy_provider;
struct resource *res; struct resource *res;
struct device_node *node = pdev->dev.of_node;
const struct of_device_id *match; const struct of_device_id *match;
struct device *dev = &pdev->dev; struct device *dev = phy->dev;
int ret; struct device_node *node = dev->of_node;
struct platform_device *pdev = to_platform_device(dev);
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
return -ENOMEM;
phy->dev = dev; if (of_device_is_compatible(node, "ti,phy-pipe3-pcie"))
return 0;
if (!of_device_is_compatible(node, "ti,phy-pipe3-pcie")) {
match = of_match_device(ti_pipe3_id_table, dev); match = of_match_device(ti_pipe3_id_table, dev);
if (!match) if (!match)
return -EINVAL; return -EINVAL;
...@@ -451,7 +444,28 @@ static int ti_pipe3_probe(struct platform_device *pdev) ...@@ -451,7 +444,28 @@ static int ti_pipe3_probe(struct platform_device *pdev)
phy->pll_ctrl_base = devm_ioremap_resource(dev, res); phy->pll_ctrl_base = devm_ioremap_resource(dev, res);
if (IS_ERR(phy->pll_ctrl_base)) if (IS_ERR(phy->pll_ctrl_base))
return PTR_ERR(phy->pll_ctrl_base); return PTR_ERR(phy->pll_ctrl_base);
}
return 0;
}
static int ti_pipe3_probe(struct platform_device *pdev)
{
struct ti_pipe3 *phy;
struct phy *generic_phy;
struct phy_provider *phy_provider;
struct device_node *node = pdev->dev.of_node;
struct device *dev = &pdev->dev;
int ret;
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
if (!phy)
return -ENOMEM;
phy->dev = dev;
ret = ti_pipe3_get_pll_base(phy);
if (ret)
return ret;
ret = ti_pipe3_get_sysctrl(phy); ret = ti_pipe3_get_sysctrl(phy);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册