On Fri, May 22 2015, Krzysztof Opasiak wrote: > 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 <[email protected]>
Acked-by: Michal Nazarewicz <[email protected]> > --- > drivers/usb/gadget/legacy/g_ffs.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/legacy/g_ffs.c > b/drivers/usb/gadget/legacy/g_ffs.c > index b01b88e..9dde887 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) > gfs_registered = true; > > ret = usb_composite_probe(&gfs_driver); > - if (unlikely(ret < 0)) > + if (unlikely(ret < 0)) { > + ++missing_funcs; > gfs_registered = false; > + } > > return ret; > } > -- > 1.7.9.5 > -- Best regards, _ _ .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o ..o | Computer Science, Michał “mina86” Nazarewicz (o o) ooo +--<[email protected]>--<xmpp:[email protected]>--ooO--(_)--Ooo-- -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
