mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
net: enetc: Use devm_platform_get_and_ioremap_resource()
Use devm_platform_get_and_ioremap_resource() to simplify code. Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
809660cbc8
commit
b5d64b43f8
@@ -99,15 +99,13 @@ EXPORT_SYMBOL(enetc_ierb_register_pf);
|
||||
static int enetc_ierb_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct enetc_ierb *ierb;
|
||||
struct resource *res;
|
||||
void __iomem *regs;
|
||||
|
||||
ierb = devm_kzalloc(&pdev->dev, sizeof(*ierb), GFP_KERNEL);
|
||||
if (!ierb)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
regs = devm_ioremap_resource(&pdev->dev, res);
|
||||
regs = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
|
||||
if (IS_ERR(regs))
|
||||
return PTR_ERR(regs);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user