summaryrefslogtreecommitdiff
path: root/drivers/ptp/ptp_ines.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-29 07:58:20 +0000
committerDavid S. Miller <davem@davemloft.net>2020-04-29 11:44:08 -0700
commit00b5aac59966ec3d608dc150aba552121e7de4f0 (patch)
treef5709c596a94651d30a324372b9b881afab9efaf /drivers/ptp/ptp_ines.c
parentcb10228d234c49e2035bfce7bdb42c29e1049c5c (diff)
downloadlwn-00b5aac59966ec3d608dc150aba552121e7de4f0.tar.gz
lwn-00b5aac59966ec3d608dc150aba552121e7de4f0.zip
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: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/ptp_ines.c')
-rw-r--r--drivers/ptp/ptp_ines.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c
index 52d77db39829..7711651ff19e 100644
--- a/drivers/ptp/ptp_ines.c
+++ b/drivers/ptp/ptp_ines.c
@@ -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;