| .. | .. |
|---|
| 525 | 525 | rxerr = (errc >> 16) & 0xFF; |
|---|
| 526 | 526 | txerr = errc & 0xFF; |
|---|
| 527 | 527 | |
|---|
| 528 | | - if (skb) { |
|---|
| 529 | | - cf->data[6] = txerr; |
|---|
| 530 | | - cf->data[7] = rxerr; |
|---|
| 531 | | - } |
|---|
| 532 | | - |
|---|
| 533 | 528 | if (isrc & SUN4I_INT_DATA_OR) { |
|---|
| 534 | 529 | /* data overrun interrupt */ |
|---|
| 535 | 530 | netdev_dbg(dev, "data overrun interrupt\n"); |
|---|
| .. | .. |
|---|
| 559 | 554 | state = CAN_STATE_ERROR_WARNING; |
|---|
| 560 | 555 | else |
|---|
| 561 | 556 | state = CAN_STATE_ERROR_ACTIVE; |
|---|
| 557 | + } |
|---|
| 558 | + if (skb && state != CAN_STATE_BUS_OFF) { |
|---|
| 559 | + cf->data[6] = txerr; |
|---|
| 560 | + cf->data[7] = rxerr; |
|---|
| 562 | 561 | } |
|---|
| 563 | 562 | if (isrc & SUN4I_INT_BUS_ERR) { |
|---|
| 564 | 563 | /* bus error interrupt */ |
|---|
| .. | .. |
|---|
| 604 | 603 | netdev_dbg(dev, "arbitration lost interrupt\n"); |
|---|
| 605 | 604 | alc = readl(priv->base + SUN4I_REG_STA_ADDR); |
|---|
| 606 | 605 | priv->can.can_stats.arbitration_lost++; |
|---|
| 607 | | - stats->tx_errors++; |
|---|
| 608 | 606 | if (likely(skb)) { |
|---|
| 609 | 607 | cf->can_id |= CAN_ERR_LOSTARB; |
|---|
| 610 | 608 | cf->data[0] = (alc >> 8) & 0x1f; |
|---|
| .. | .. |
|---|
| 771 | 769 | static int sun4ican_probe(struct platform_device *pdev) |
|---|
| 772 | 770 | { |
|---|
| 773 | 771 | struct device_node *np = pdev->dev.of_node; |
|---|
| 774 | | - struct resource *mem; |
|---|
| 775 | 772 | struct clk *clk; |
|---|
| 776 | 773 | void __iomem *addr; |
|---|
| 777 | 774 | int err, irq; |
|---|
| .. | .. |
|---|
| 787 | 784 | |
|---|
| 788 | 785 | irq = platform_get_irq(pdev, 0); |
|---|
| 789 | 786 | if (irq < 0) { |
|---|
| 790 | | - dev_err(&pdev->dev, "could not get a valid irq\n"); |
|---|
| 791 | 787 | err = -ENODEV; |
|---|
| 792 | 788 | goto exit; |
|---|
| 793 | 789 | } |
|---|
| 794 | 790 | |
|---|
| 795 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 796 | | - addr = devm_ioremap_resource(&pdev->dev, mem); |
|---|
| 791 | + addr = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 797 | 792 | if (IS_ERR(addr)) { |
|---|
| 798 | | - err = -EBUSY; |
|---|
| 793 | + err = PTR_ERR(addr); |
|---|
| 799 | 794 | goto exit; |
|---|
| 800 | 795 | } |
|---|
| 801 | 796 | |
|---|