Skip to content

Commit

Permalink
ptp: ptp_ines: convert to devm_platform_ioremap_resource
Browse files Browse the repository at this point in the history
Use the helper function that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Apr 29, 2020
1 parent cb10228 commit 00b5aac
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/ptp/ptp_ines.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,16 +783,10 @@ static struct mii_timestamping_ctrl ines_ctrl = {
static int ines_ptp_ctrl_probe(struct platform_device *pld)
{
struct ines_clock *clock;
struct resource *res;
void __iomem *addr;
int err = 0;

res = platform_get_resource(pld, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pld->dev, "missing memory resource\n");
return -EINVAL;
}
addr = devm_ioremap_resource(&pld->dev, res);
addr = devm_platform_ioremap_resource(pld, 0);
if (IS_ERR(addr)) {
err = PTR_ERR(addr);
goto out;
Expand Down

0 comments on commit 00b5aac

Please sign in to comment.