mt76: mt7603: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
0c168e1084
commit
4c49c09947
|
@ -9,7 +9,6 @@
|
|||
static int
|
||||
mt76_wmac_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
struct mt7603_dev *dev;
|
||||
void __iomem *mem_base;
|
||||
struct mt76_dev *mdev;
|
||||
|
@ -20,7 +19,7 @@ mt76_wmac_probe(struct platform_device *pdev)
|
|||
if (irq < 0)
|
||||
return irq;
|
||||
|
||||
mem_base = devm_ioremap_resource(&pdev->dev, res);
|
||||
mem_base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(mem_base)) {
|
||||
dev_err(&pdev->dev, "Failed to get memory resource\n");
|
||||
return PTR_ERR(mem_base);
|
||||
|
|
Loading…
Reference in New Issue