forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/arch/powerpc/sysdev/fsl_gtm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Freescale General-purpose Timers Module
34 *
....@@ -6,11 +7,6 @@
67 * Jerry Huang <Chang-Ming.Huang@freescale.com>
78 * Copyright (c) MontaVista Software, Inc. 2008.
89 * Anton Vorontsov <avorontsov@ru.mvista.com>
9
- *
10
- * This program is free software; you can redistribute it and/or modify it
11
- * under the terms of the GNU General Public License as published by the
12
- * Free Software Foundation; either version 2 of the License, or (at your
13
- * option) any later version.
1410 */
1511
1612 #include <linux/kernel.h>
....@@ -90,7 +86,7 @@
9086 */
9187 struct gtm_timer *gtm_get_timer16(void)
9288 {
93
- struct gtm *gtm = NULL;
89
+ struct gtm *gtm;
9490 int i;
9591
9692 list_for_each_entry(gtm, &gtms, list_node) {
....@@ -107,7 +103,7 @@
107103 spin_unlock_irq(&gtm->lock);
108104 }
109105
110
- if (gtm)
106
+ if (!list_empty(&gtms))
111107 return ERR_PTR(-EBUSY);
112108 return ERR_PTR(-ENODEV);
113109 }