hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/can/softing/softing_main.c
....@@ -1,19 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2008-2010
34 *
45 * - Kurt Van Dijck, EIA Electronics
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the version 2 of the GNU General Public License
8
- * as published by the Free Software Foundation
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
176 */
187
198 #include <linux/module.h>
....@@ -181,8 +170,8 @@
181170 msg.can_dlc = CAN_ERR_DLC;
182171 msg.data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
183172 /*
184
- * service to all busses, we don't know which it was applicable
185
- * but only service busses that are online
173
+ * service to all buses, we don't know which it was applicable
174
+ * but only service buses that are online
186175 */
187176 for (j = 0; j < ARRAY_SIZE(card->net); ++j) {
188177 netdev = card->net[j];
....@@ -350,7 +339,7 @@
350339 continue;
351340 priv = netdev_priv(netdev);
352341 if (!canif_is_active(netdev))
353
- /* it makes no sense to wake dead busses */
342
+ /* it makes no sense to wake dead buses */
354343 continue;
355344 if (priv->tx.pending >= TX_ECHO_SKB_MAX)
356345 continue;
....@@ -385,7 +374,7 @@
385374 }
386375
387376 /*
388
- * netdev/candev inter-operability
377
+ * netdev/candev interoperability
389378 */
390379 static int softing_netdev_open(struct net_device *ndev)
391380 {
....@@ -463,8 +452,9 @@
463452 {
464453 int fw_up = 0;
465454
466
- if (mutex_lock_interruptible(&card->fw.lock))
455
+ if (mutex_lock_interruptible(&card->fw.lock)) {
467456 /* return -ERESTARTSYS */;
457
+ }
468458 fw_up = card->fw.up;
469459 card->fw.up = 0;
470460
....@@ -699,7 +689,7 @@
699689 static ssize_t show_##name(struct device *dev, \
700690 struct device_attribute *attr, char *buf) \
701691 { \
702
- struct softing *card = platform_get_drvdata(to_platform_device(dev)); \
692
+ struct softing *card = dev_get_drvdata(dev); \
703693 return sprintf(buf, "%u\n", card->member); \
704694 } \
705695 static DEVICE_ATTR(name, 0444, show_##name, NULL)
....@@ -708,7 +698,7 @@
708698 static ssize_t show_##name(struct device *dev, \
709699 struct device_attribute *attr, char *buf) \
710700 { \
711
- struct softing *card = platform_get_drvdata(to_platform_device(dev)); \
701
+ struct softing *card = dev_get_drvdata(dev); \
712702 return sprintf(buf, "%s\n", card->member); \
713703 } \
714704 static DEVICE_ATTR(name, 0444, show_##name, NULL)
....@@ -793,7 +783,7 @@
793783 goto platform_resource_failed;
794784 card->dpram_phys = pres->start;
795785 card->dpram_size = resource_size(pres);
796
- card->dpram = ioremap_nocache(card->dpram_phys, card->dpram_size);
786
+ card->dpram = ioremap(card->dpram_phys, card->dpram_size);
797787 if (!card->dpram) {
798788 dev_alert(&card->pdev->dev, "dpram ioremap failed\n");
799789 goto ioremap_failed;