.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * CAN bus driver for the alone generic (as possible as) MSCAN controller. |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * Varma Electronics Oy |
---|
6 | 7 | * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com> |
---|
7 | 8 | * 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/>. |
---|
20 | 9 | */ |
---|
21 | 10 | |
---|
22 | 11 | #include <linux/kernel.h> |
---|
.. | .. |
---|
220 | 209 | * since buffer with lower id have higher priority (hell..) |
---|
221 | 210 | */ |
---|
222 | 211 | netif_stop_queue(dev); |
---|
| 212 | + fallthrough; |
---|
223 | 213 | case 2: |
---|
224 | 214 | if (buf_id < priv->prev_buf_id) { |
---|
225 | 215 | priv->cur_pri++; |
---|
.. | .. |
---|
551 | 541 | struct mscan_priv *priv = netdev_priv(dev); |
---|
552 | 542 | struct mscan_regs __iomem *regs = priv->reg_base; |
---|
553 | 543 | |
---|
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; |
---|
564 | 550 | |
---|
565 | 551 | /* common open */ |
---|
566 | 552 | ret = open_candev(dev); |
---|
.. | .. |
---|
594 | 580 | napi_disable(&priv->napi); |
---|
595 | 581 | close_candev(dev); |
---|
596 | 582 | exit_dis_can_clock: |
---|
597 | | - if (priv->clk_can) |
---|
598 | | - clk_disable_unprepare(priv->clk_can); |
---|
| 583 | + clk_disable_unprepare(priv->clk_can); |
---|
599 | 584 | exit_dis_ipg_clock: |
---|
600 | | - if (priv->clk_ipg) |
---|
601 | | - clk_disable_unprepare(priv->clk_ipg); |
---|
| 585 | + clk_disable_unprepare(priv->clk_ipg); |
---|
602 | 586 | exit_retcode: |
---|
603 | 587 | return ret; |
---|
604 | 588 | } |
---|
.. | .. |
---|
617 | 601 | close_candev(dev); |
---|
618 | 602 | free_irq(dev->irq, dev); |
---|
619 | 603 | |
---|
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); |
---|
624 | 606 | |
---|
625 | 607 | return 0; |
---|
626 | 608 | } |
---|