| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * The Industrial I/O core, software trigger functions |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2015 Intel Corporation |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License version 2 as published by |
|---|
| 8 | | - * the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | |
|---|
| 11 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 61 | 58 | |
|---|
| 62 | 59 | t->group = configfs_register_default_group(iio_triggers_group, t->name, |
|---|
| 63 | 60 | &iio_trigger_type_group_type); |
|---|
| 64 | | - if (IS_ERR(t->group)) |
|---|
| 61 | + if (IS_ERR(t->group)) { |
|---|
| 62 | + mutex_lock(&iio_trigger_types_lock); |
|---|
| 63 | + list_del(&t->list); |
|---|
| 64 | + mutex_unlock(&iio_trigger_types_lock); |
|---|
| 65 | 65 | ret = PTR_ERR(t->group); |
|---|
| 66 | + } |
|---|
| 66 | 67 | |
|---|
| 67 | 68 | return ret; |
|---|
| 68 | 69 | } |
|---|