diff options
Diffstat (limited to 'drivers/usb/gadget/function/f_serial.c')
-rw-r--r-- | drivers/usb/gadget/function/f_serial.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/usb/gadget/function/f_serial.c b/drivers/usb/gadget/function/f_serial.c index ba705e047d7e..6bb44d613bab 100644 --- a/drivers/usb/gadget/function/f_serial.c +++ b/drivers/usb/gadget/function/f_serial.c | |||
@@ -258,22 +258,6 @@ static inline struct f_serial_opts *to_f_serial_opts(struct config_item *item) | |||
258 | func_inst.group); | 258 | func_inst.group); |
259 | } | 259 | } |
260 | 260 | ||
261 | CONFIGFS_ATTR_STRUCT(f_serial_opts); | ||
262 | static ssize_t f_serial_attr_show(struct config_item *item, | ||
263 | struct configfs_attribute *attr, | ||
264 | char *page) | ||
265 | { | ||
266 | struct f_serial_opts *opts = to_f_serial_opts(item); | ||
267 | struct f_serial_opts_attribute *f_serial_opts_attr = | ||
268 | container_of(attr, struct f_serial_opts_attribute, attr); | ||
269 | ssize_t ret = 0; | ||
270 | |||
271 | if (f_serial_opts_attr->show) | ||
272 | ret = f_serial_opts_attr->show(opts, page); | ||
273 | |||
274 | return ret; | ||
275 | } | ||
276 | |||
277 | static void serial_attr_release(struct config_item *item) | 261 | static void serial_attr_release(struct config_item *item) |
278 | { | 262 | { |
279 | struct f_serial_opts *opts = to_f_serial_opts(item); | 263 | struct f_serial_opts *opts = to_f_serial_opts(item); |
@@ -283,19 +267,17 @@ static void serial_attr_release(struct config_item *item) | |||
283 | 267 | ||
284 | static struct configfs_item_operations serial_item_ops = { | 268 | static struct configfs_item_operations serial_item_ops = { |
285 | .release = serial_attr_release, | 269 | .release = serial_attr_release, |
286 | .show_attribute = f_serial_attr_show, | ||
287 | }; | 270 | }; |
288 | 271 | ||
289 | static ssize_t f_serial_port_num_show(struct f_serial_opts *opts, char *page) | 272 | static ssize_t f_serial_port_num_show(struct config_item *item, char *page) |
290 | { | 273 | { |
291 | return sprintf(page, "%u\n", opts->port_num); | 274 | return sprintf(page, "%u\n", to_f_serial_opts(item)->port_num); |
292 | } | 275 | } |
293 | 276 | ||
294 | static struct f_serial_opts_attribute f_serial_port_num = | 277 | CONFIGFS_ATTR_RO(f_serial_, port_num); |
295 | __CONFIGFS_ATTR_RO(port_num, f_serial_port_num_show); | ||
296 | 278 | ||
297 | static struct configfs_attribute *acm_attrs[] = { | 279 | static struct configfs_attribute *acm_attrs[] = { |
298 | &f_serial_port_num.attr, | 280 | &f_serial_attr_port_num, |
299 | NULL, | 281 | NULL, |
300 | }; | 282 | }; |
301 | 283 | ||