phy: tegra: convert to devm_platform_ioremap_resource(_byname)
Use devm_platform_ioremap_resource(_byname) to simplify code Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Cc: JC Kuo <jckuo@nvidia.com> Link: https://lore.kernel.org/r/1604642930-29019-16-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
5a77b16c6b
commit
9ab4212b0a
@ -72,14 +72,12 @@ static int tegra_p2u_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct phy *generic_phy;
|
struct phy *generic_phy;
|
||||||
struct tegra_p2u *phy;
|
struct tegra_p2u *phy;
|
||||||
struct resource *res;
|
|
||||||
|
|
||||||
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
|
phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL);
|
||||||
if (!phy)
|
if (!phy)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ctl");
|
phy->base = devm_platform_ioremap_resource_byname(pdev, "ctl");
|
||||||
phy->base = devm_ioremap_resource(dev, res);
|
|
||||||
if (IS_ERR(phy->base))
|
if (IS_ERR(phy->base))
|
||||||
return PTR_ERR(phy->base);
|
return PTR_ERR(phy->base);
|
||||||
|
|
||||||
|
@ -1148,7 +1148,6 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
|
|||||||
const struct tegra_xusb_padctl_soc *soc;
|
const struct tegra_xusb_padctl_soc *soc;
|
||||||
struct tegra_xusb_padctl *padctl;
|
struct tegra_xusb_padctl *padctl;
|
||||||
const struct of_device_id *match;
|
const struct of_device_id *match;
|
||||||
struct resource *res;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
/* for backwards compatibility with old device trees */
|
/* for backwards compatibility with old device trees */
|
||||||
@ -1173,8 +1172,7 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
|
|||||||
INIT_LIST_HEAD(&padctl->pads);
|
INIT_LIST_HEAD(&padctl->pads);
|
||||||
mutex_init(&padctl->lock);
|
mutex_init(&padctl->lock);
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
padctl->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
padctl->regs = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(padctl->regs)) {
|
if (IS_ERR(padctl->regs)) {
|
||||||
err = PTR_ERR(padctl->regs);
|
err = PTR_ERR(padctl->regs);
|
||||||
goto remove;
|
goto remove;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user