treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / usb / gadget / function / u_tcm.h
blob3f7ccecb0f9bff0fbcd40361858aee36e1b8c137
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * u_tcm.h
5 * Utility definitions for the tcm function
7 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
8 * http://www.samsung.com
10 * Author: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
13 #ifndef U_TCM_H
14 #define U_TCM_H
16 #include <linux/usb/composite.h>
18 /**
19 * @dependent: optional dependent module. Meant for legacy gadget.
20 * If non-null its refcount will be increased when a tpg is created and
21 * decreased when tpg is dropped.
22 * @dep_lock: lock for dependent module operations.
23 * @ready: true if the dependent module information is set.
24 * @can_attach: true a function can be bound to gadget
25 * @has_dep: true if there is a dependent module
28 struct f_tcm_opts {
29 struct usb_function_instance func_inst;
30 struct module *dependent;
31 struct mutex dep_lock;
32 bool ready;
33 bool can_attach;
34 bool has_dep;
37 * Callbacks to be removed when legacy tcm gadget disappears.
39 * If you use the new function registration interface
40 * programmatically, you MUST set these callbacks to
41 * something sensible (e.g. probe/remove the composite).
43 int (*tcm_register_callback)(struct usb_function_instance *);
44 void (*tcm_unregister_callback)(struct usb_function_instance *);
47 #endif /* U_TCM_H */