Message ID | 20200429135651.32635-1-zhengdejin5@gmail.com |
---|---|
State | New |
Headers | show |
Series | [net,v2] net: macb: fix an issue about leak related system resources | expand |
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index a0e8c5bbabc0..99354e327d1f 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4172,13 +4172,7 @@ static int fu540_c000_clk_init(struct platform_device *pdev, struct clk **pclk, static int fu540_c000_init(struct platform_device *pdev) { - struct resource *res; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); - if (!res) - return -ENODEV; - - mgmt->reg = ioremap(res->start, resource_size(res)); + mgmt->reg = devm_platform_ioremap_resource(pdev, 1); if (!mgmt->reg) return -ENOMEM;