forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/can/mscan/mpc5xxx_can.c
....@@ -1,22 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * CAN bus driver for the Freescale MPC5xxx embedded CPU.
34 *
45 * Copyright (C) 2004-2005 Andrey Volkov <avolkov@varma-el.com>,
56 * Varma Electronics Oy
67 * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com>
7
- * Copyright (C) 2009 Wolfram Sang, Pengutronix <w.sang@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, but
14
- * 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/>.
8
+ * Copyright (C) 2009 Wolfram Sang, Pengutronix <kernel@pengutronix.de>
209 */
2110
2211 #include <linux/kernel.h>
....@@ -336,14 +325,14 @@
336325 &mscan_clksrc);
337326 if (!priv->can.clock.freq) {
338327 dev_err(&ofdev->dev, "couldn't get MSCAN clock properties\n");
339
- goto exit_free_mscan;
328
+ goto exit_put_clock;
340329 }
341330
342331 err = register_mscandev(dev, mscan_clksrc);
343332 if (err) {
344333 dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
345334 DRV_NAME, err);
346
- goto exit_free_mscan;
335
+ goto exit_put_clock;
347336 }
348337
349338 dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
....@@ -351,7 +340,9 @@
351340
352341 return 0;
353342
354
-exit_free_mscan:
343
+exit_put_clock:
344
+ if (data->put_clock)
345
+ data->put_clock(ofdev);
355346 free_candev(dev);
356347 exit_dispose_irq:
357348 irq_dispose_mapping(irq);