| .. | .. |
|---|
| 942 | 942 | struct device *dev = &pdev->dev; |
|---|
| 943 | 943 | struct net_device *ndev; |
|---|
| 944 | 944 | struct ifi_canfd_priv *priv; |
|---|
| 945 | | - struct resource *res; |
|---|
| 946 | 945 | void __iomem *addr; |
|---|
| 947 | 946 | int irq, ret; |
|---|
| 948 | 947 | u32 id, rev; |
|---|
| 949 | 948 | |
|---|
| 950 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 951 | | - addr = devm_ioremap_resource(dev, res); |
|---|
| 949 | + addr = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 950 | + if (IS_ERR(addr)) |
|---|
| 951 | + return PTR_ERR(addr); |
|---|
| 952 | + |
|---|
| 952 | 953 | irq = platform_get_irq(pdev, 0); |
|---|
| 953 | | - if (IS_ERR(addr) || irq < 0) |
|---|
| 954 | + if (irq < 0) |
|---|
| 954 | 955 | return -EINVAL; |
|---|
| 955 | 956 | |
|---|
| 956 | 957 | id = readl(addr + IFI_CANFD_IP_ID); |
|---|