return -ENODEV;
}
pdata->base_addr = devm_ioremap(dev, res->start, resource_size(res));
- if (IS_ERR(pdata->base_addr)) {
+ if (!pdata->base_addr) {
dev_err(dev, "Unable to retrieve ENET Port CSR region\n");
- return PTR_ERR(pdata->base_addr);
+ return -ENOMEM;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, RES_RING_CSR);
}
pdata->ring_csr_addr = devm_ioremap(dev, res->start,
resource_size(res));
- if (IS_ERR(pdata->ring_csr_addr)) {
+ if (!pdata->ring_csr_addr) {
dev_err(dev, "Unable to retrieve ENET Ring CSR region\n");
- return PTR_ERR(pdata->ring_csr_addr);
+ return -ENOMEM;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, RES_RING_CMD);
}
pdata->ring_cmd_addr = devm_ioremap(dev, res->start,
resource_size(res));
- if (IS_ERR(pdata->ring_cmd_addr)) {
+ if (!pdata->ring_cmd_addr) {
dev_err(dev, "Unable to retrieve ENET Ring command region\n");
- return PTR_ERR(pdata->ring_cmd_addr);
+ return -ENOMEM;
}
ret = platform_get_irq(pdev, 0);