Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbbHDQKj (ORCPT ); Tue, 4 Aug 2015 12:10:39 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:46418 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbbHDQKh (ORCPT ); Tue, 4 Aug 2015 12:10:37 -0400 Date: Tue, 4 Aug 2015 11:09:48 -0500 From: Felipe Balbi To: Robert Baldyga CC: , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v5 07/46] usb: dwc3: gadget: add ep capabilities support Message-ID: <20150804160948.GJ23659@saruman.tx.rr.com> Reply-To: References: <1438351258-31578-1-git-send-email-r.baldyga@samsung.com> <1438351258-31578-8-git-send-email-r.baldyga@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YZVh52eu0Ophig4D" Content-Disposition: inline In-Reply-To: <1438351258-31578-8-git-send-email-r.baldyga@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2425 Lines: 71 --YZVh52eu0Ophig4D Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 31, 2015 at 04:00:19PM +0200, Robert Baldyga wrote: > Convert endpoint configuration to new capabilities model. >=20 > Signed-off-by: Robert Baldyga > --- > drivers/usb/dwc3/gadget.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 2feed9e..bd4c3db 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1715,6 +1715,19 @@ static int dwc3_gadget_init_hw_endpoints(struct dw= c3 *dwc, > return ret; > } > =20 > + if (epnum =3D=3D 0 || epnum =3D=3D 1) { > + dep->endpoint.caps.type_control =3D true; > + } else { > + dep->endpoint.caps.type_iso =3D true; > + dep->endpoint.caps.type_bulk =3D true; > + dep->endpoint.caps.type_int =3D true; > + } > + > + if (direction) > + dep->endpoint.caps.dir_in =3D true; > + else > + dep->endpoint.caps.dir_out =3D true; you can avoid the branch for the direction: dep->endpoint.caps.dir_in =3D !!direction; dep->endpoint.caps.dir_out =3D !direction; --=20 balbi --YZVh52eu0Ophig4D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVwOPLAAoJEIaOsuA1yqREeMsQAIPG7g/oNsMI+/wgc4MgLGj4 PRHvg9RnBfZaeh0OoXPyA+YPZPVzl9NMNhv2+Y1fs57Kxs/vGRtDZHzBWLd+8ttd sOm5xEFxy/Y386OSe1R9B0lSv2bdQhQylXML4kLH5T9qkxMobNVKZa1Ao1OYHCBe DHCeAa8qZqTyP3cW8sFScXKiIonDJQ0NMnYHC2Pu8YHTCWjltPEpj12Y2kA3uiKZ dUNMyvYMqhqzmTui3s3Wvyv/2YnA3/KVz8obu2b+tfGUTXMsZ3qtGAcboq9gknd8 GwcRQ+RpVYfu5nuLhsbkD8Osw6qiWguETcsavxLxrrCh+DRfJUkVIQ/rhOdO/+hq WMLVgRjBxp0NHbq/ftXMAdrQuNTF8b3oEyH6MXIXwVhNc3R453HqbuswaWNl1bzg cElNL7IytQVF0ksLF2R6nBQrnHnMmdK+j1QpJZiL98ea6Z942a5ykawHhsJ2XL0M Q5VpSfL98+4Awg9YX0fdao6R7HbyDklMEmkEb2q99wXlf8vOGQQIWN5WTPLFtmfp +h2+Pw2Q7R+pPn0sg284eqctA0LTiOYPakzKcXMVMRhx3NuRhzzDDVydhROsg40F kcuKLSFR/ZHGh798vqpU/22cENVimjYHIlHPvJuM53uOP8rslntxg1octhrYRToF Eyx4MQPzIbkUZ6OlAWgL =Zeuq -----END PGP SIGNATURE----- --YZVh52eu0Ophig4D-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/