Commit 00b5aac5 authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

ptp: ptp_ines: convert to devm_platform_ioremap_resource

Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb10228d
...@@ -783,16 +783,10 @@ static struct mii_timestamping_ctrl ines_ctrl = { ...@@ -783,16 +783,10 @@ static struct mii_timestamping_ctrl ines_ctrl = {
static int ines_ptp_ctrl_probe(struct platform_device *pld) static int ines_ptp_ctrl_probe(struct platform_device *pld)
{ {
struct ines_clock *clock; struct ines_clock *clock;
struct resource *res;
void __iomem *addr; void __iomem *addr;
int err = 0; int err = 0;
res = platform_get_resource(pld, IORESOURCE_MEM, 0); addr = devm_platform_ioremap_resource(pld, 0);
if (!res) {
dev_err(&pld->dev, "missing memory resource\n");
return -EINVAL;
}
addr = devm_ioremap_resource(&pld->dev, res);
if (IS_ERR(addr)) { if (IS_ERR(addr)) {
err = PTR_ERR(addr); err = PTR_ERR(addr);
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