.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 2 | /* |
---|
3 | 3 | * u_ether_configfs.h |
---|
4 | 4 | * |
---|
.. | .. |
---|
7 | 7 | * Copyright (c) 2013 Samsung Electronics Co., Ltd. |
---|
8 | 8 | * http://www.samsung.com |
---|
9 | 9 | * |
---|
10 | | - * Author: Andrzej Pietrasiewicz <andrzej.p@samsung.com> |
---|
| 10 | + * Author: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> |
---|
11 | 11 | */ |
---|
12 | 12 | |
---|
13 | 13 | #ifndef __U_ETHER_CONFIGFS_H |
---|
.. | .. |
---|
148 | 148 | return ret; \ |
---|
149 | 149 | } \ |
---|
150 | 150 | \ |
---|
151 | | - CONFIGFS_ATTR_RO(_f_##_opts_, ifname) |
---|
| 151 | + static ssize_t _f_##_opts_ifname_store(struct config_item *item, \ |
---|
| 152 | + const char *page, size_t len)\ |
---|
| 153 | + { \ |
---|
| 154 | + struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \ |
---|
| 155 | + int ret = -EBUSY; \ |
---|
| 156 | + \ |
---|
| 157 | + mutex_lock(&opts->lock); \ |
---|
| 158 | + if (!opts->refcnt) \ |
---|
| 159 | + ret = gether_set_ifname(opts->net, page, len); \ |
---|
| 160 | + mutex_unlock(&opts->lock); \ |
---|
| 161 | + return ret ?: len; \ |
---|
| 162 | + } \ |
---|
| 163 | + \ |
---|
| 164 | + CONFIGFS_ATTR(_f_##_opts_, ifname) |
---|
152 | 165 | |
---|
153 | 166 | #define USB_ETHER_CONFIGFS_ITEM_ATTR_U8_RW(_f_, _n_) \ |
---|
154 | 167 | static ssize_t _f_##_opts_##_n_##_show(struct config_item *item,\ |
---|