| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Freescale General-purpose Timers Module |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Jerry Huang <Chang-Ming.Huang@freescale.com> |
|---|
| 7 | 8 | * Copyright (c) MontaVista Software, Inc. 2008. |
|---|
| 8 | 9 | * 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. |
|---|
| 14 | 10 | */ |
|---|
| 15 | 11 | |
|---|
| 16 | 12 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 90 | 86 | */ |
|---|
| 91 | 87 | struct gtm_timer *gtm_get_timer16(void) |
|---|
| 92 | 88 | { |
|---|
| 93 | | - struct gtm *gtm = NULL; |
|---|
| 89 | + struct gtm *gtm; |
|---|
| 94 | 90 | int i; |
|---|
| 95 | 91 | |
|---|
| 96 | 92 | list_for_each_entry(gtm, >ms, list_node) { |
|---|
| .. | .. |
|---|
| 107 | 103 | spin_unlock_irq(>m->lock); |
|---|
| 108 | 104 | } |
|---|
| 109 | 105 | |
|---|
| 110 | | - if (gtm) |
|---|
| 106 | + if (!list_empty(>ms)) |
|---|
| 111 | 107 | return ERR_PTR(-EBUSY); |
|---|
| 112 | 108 | return ERR_PTR(-ENODEV); |
|---|
| 113 | 109 | } |
|---|