forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/can/at91_can.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * at91_can.c - CAN network driver for AT91 SoC CAN controller
34 *
45 * (C) 2007 by Hans J. Koch <hjk@hansjkoch.de>
56 * (C) 2008, 2009, 2010, 2011 by Marc Kleine-Budde <kernel@pengutronix.de>
6
- *
7
- * This software may be distributed under the terms of the GNU General
8
- * Public License ("GPL") version 2 as distributed in the 'COPYING'
9
- * file from the main directory of the linux kernel source.
10
- *
117 */
128
139 #include <linux/clk.h>
....@@ -647,7 +643,7 @@
647643 *
648644 * The first message goes into mb nr. 1 and issues an interrupt. All
649645 * rx ints are disabled in the interrupt handler and a napi poll is
650
- * scheduled. We read the mailbox, but do _not_ reenable the mb (to
646
+ * scheduled. We read the mailbox, but do _not_ re-enable the mb (to
651647 * receive another message).
652648 *
653649 * lower mbxs upper
....@@ -665,13 +661,13 @@
665661 *
666662 * The variable priv->rx_next points to the next mailbox to read a
667663 * message from. As long we're in the lower mailboxes we just read the
668
- * mailbox but not reenable it.
664
+ * mailbox but not re-enable it.
669665 *
670
- * With completion of the last of the lower mailboxes, we reenable the
666
+ * With completion of the last of the lower mailboxes, we re-enable the
671667 * whole first group, but continue to look for filled mailboxes in the
672668 * upper mailboxes. Imagine the second group like overflow mailboxes,
673669 * which takes CAN messages if the lower goup is full. While in the
674
- * upper group we reenable the mailbox right after reading it. Giving
670
+ * upper group we re-enable the mailbox right after reading it. Giving
675671 * the chip more room to store messages.
676672 *
677673 * After finishing we look again in the lower group if we've still
....@@ -902,7 +898,8 @@
902898 CAN_ERR_CRTL_TX_WARNING :
903899 CAN_ERR_CRTL_RX_WARNING;
904900 }
905
- case CAN_STATE_ERROR_WARNING: /* fallthrough */
901
+ fallthrough;
902
+ case CAN_STATE_ERROR_WARNING:
906903 /*
907904 * from: ERROR_ACTIVE, ERROR_WARNING
908905 * to : ERROR_PASSIVE, BUS_OFF
....@@ -951,7 +948,8 @@
951948 netdev_dbg(dev, "Error Active\n");
952949 cf->can_id |= CAN_ERR_PROT;
953950 cf->data[2] = CAN_ERR_PROT_ACTIVE;
954
- case CAN_STATE_ERROR_WARNING: /* fallthrough */
951
+ fallthrough;
952
+ case CAN_STATE_ERROR_WARNING:
955953 reg_idr = AT91_IRQ_ERRA | AT91_IRQ_WARN | AT91_IRQ_BOFF;
956954 reg_ier = AT91_IRQ_ERRP;
957955 break;
....@@ -1304,7 +1302,7 @@
13041302 goto exit_put;
13051303 }
13061304
1307
- addr = ioremap_nocache(res->start, resource_size(res));
1305
+ addr = ioremap(res->start, resource_size(res));
13081306 if (!addr) {
13091307 err = -ENOMEM;
13101308 goto exit_release;