Skip to content

Commit 00b5aac

Browse files
Wei Yongjundavem330
authored andcommitted
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>
1 parent cb10228 commit 00b5aac

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

‎drivers/ptp/ptp_ines.c‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -783,16 +783,10 @@ static struct mii_timestamping_ctrl ines_ctrl = {
783783
static int ines_ptp_ctrl_probe(struct platform_device *pld)
784784
{
785785
struct ines_clock *clock;
786-
struct resource *res;
787786
void __iomem *addr;
788787
int err = 0;
789788

790-
res = platform_get_resource(pld, IORESOURCE_MEM, 0);
791-
if (!res) {
792-
dev_err(&pld->dev, "missing memory resource\n");
793-
return -EINVAL;
794-
}
795-
addr = devm_ioremap_resource(&pld->dev, res);
789+
addr = devm_platform_ioremap_resource(pld, 0);
796790
if (IS_ERR(addr)) {
797791
err = PTR_ERR(addr);
798792
goto out;

0 commit comments

Comments
 (0)