forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/can/mscan/mscan.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * CAN bus driver for the alone generic (as possible as) MSCAN controller.
34 *
....@@ -5,18 +6,6 @@
56 * Varma Electronics Oy
67 * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com>
78 * Copyright (C) 2008-2009 Pengutronix <kernel@pengutronix.de>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the version 2 of the GNU General Public License
11
- * as published by the Free Software Foundation
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
209 */
2110
2211 #include <linux/kernel.h>
....@@ -220,6 +209,7 @@
220209 * since buffer with lower id have higher priority (hell..)
221210 */
222211 netif_stop_queue(dev);
212
+ fallthrough;
223213 case 2:
224214 if (buf_id < priv->prev_buf_id) {
225215 priv->cur_pri++;
....@@ -551,16 +541,12 @@
551541 struct mscan_priv *priv = netdev_priv(dev);
552542 struct mscan_regs __iomem *regs = priv->reg_base;
553543
554
- if (priv->clk_ipg) {
555
- ret = clk_prepare_enable(priv->clk_ipg);
556
- if (ret)
557
- goto exit_retcode;
558
- }
559
- if (priv->clk_can) {
560
- ret = clk_prepare_enable(priv->clk_can);
561
- if (ret)
562
- goto exit_dis_ipg_clock;
563
- }
544
+ ret = clk_prepare_enable(priv->clk_ipg);
545
+ if (ret)
546
+ goto exit_retcode;
547
+ ret = clk_prepare_enable(priv->clk_can);
548
+ if (ret)
549
+ goto exit_dis_ipg_clock;
564550
565551 /* common open */
566552 ret = open_candev(dev);
....@@ -594,11 +580,9 @@
594580 napi_disable(&priv->napi);
595581 close_candev(dev);
596582 exit_dis_can_clock:
597
- if (priv->clk_can)
598
- clk_disable_unprepare(priv->clk_can);
583
+ clk_disable_unprepare(priv->clk_can);
599584 exit_dis_ipg_clock:
600
- if (priv->clk_ipg)
601
- clk_disable_unprepare(priv->clk_ipg);
585
+ clk_disable_unprepare(priv->clk_ipg);
602586 exit_retcode:
603587 return ret;
604588 }
....@@ -617,10 +601,8 @@
617601 close_candev(dev);
618602 free_irq(dev->irq, dev);
619603
620
- if (priv->clk_can)
621
- clk_disable_unprepare(priv->clk_can);
622
- if (priv->clk_ipg)
623
- clk_disable_unprepare(priv->clk_ipg);
604
+ clk_disable_unprepare(priv->clk_can);
605
+ clk_disable_unprepare(priv->clk_ipg);
624606
625607 return 0;
626608 }