diff options
author | Krzysztof Opasiak <k.opasiak@samsung.com> | 2015-05-22 11:25:17 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-05-26 11:15:08 -0400 |
commit | c41b33c58d11f32e95d06f634ddba0cbf39fc7c6 (patch) | |
tree | a98ee8a2d4b2363665cd16648adcb016271a9998 /drivers/usb | |
parent | 10f095801cda5cdf24839e2fe90c08cb85a28da6 (diff) |
usb: gadget: g_ffs: Fix counting of missing_functions
Returning non-zero value from ready callback makes ffs instance
return error from writing strings and enter FFS_CLOSING state.
This means that this this function is not truly ready and
close callback will not be called. This commit fix
ffs_ready_callback() to undo all side effects of this function
in case of error.
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/legacy/g_ffs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/gadget/legacy/g_ffs.c b/drivers/usb/gadget/legacy/g_ffs.c index 7b9ef7e257d2..e821931c965c 100644 --- a/drivers/usb/gadget/legacy/g_ffs.c +++ b/drivers/usb/gadget/legacy/g_ffs.c | |||
@@ -304,8 +304,10 @@ static int functionfs_ready_callback(struct ffs_data *ffs) | |||
304 | gfs_registered = true; | 304 | gfs_registered = true; |
305 | 305 | ||
306 | ret = usb_composite_probe(&gfs_driver); | 306 | ret = usb_composite_probe(&gfs_driver); |
307 | if (unlikely(ret < 0)) | 307 | if (unlikely(ret < 0)) { |
308 | ++missing_funcs; | ||
308 | gfs_registered = false; | 309 | gfs_registered = false; |
310 | } | ||
309 | 311 | ||
310 | return ret; | 312 | return ret; |
311 | } | 313 | } |