mfd: dln2: Fix sanity checking for endpoints
PATCH 1/1 mfd: dln2: Fix sanity checking for endpoints
While the commit 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints") tries to harden the sanity checks it made at the same time a regression, i.e. mixed in and out endpoints. Obviously it should have been not tested on real hardware at that time, but unluckily it didn't happen.
So, fix above mentioned typo and make device being enumerated again.
--- drivers/mfd/dln2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/dln2.c +2 -2
@@ -754,8 +754,8 @@ static int dln2_probe(struct usb_interface *interface, hostif->desc.bNumEndpoints < 2)return -ENODEV ; - epin = &hostif->endpoint[0 ].desc; - epout = &hostif->endpoint[1 ].desc; + epin = &hostif->endpoint[1 ].desc; + epout = &hostif->endpoint[0 ].desc;if (!usb_endpoint_is_bulk_out (epout))return -ENODEV ;if (!usb_endpoint_is_bulk_in (epin))
Signature · 1 line
2.25.0
Quoted 4 lines · Andy Shevchenko
While the commit
2b8bd606b1e6("mfd: dln2: More sanity checking for endpoints") tries to harden the sanity checks it made at the same time a regression, i.e. mixed in and out endpoints. Obviously it should have been not tested on real hardware at that time, but unluckily it didn't happen.
This is why I usually insist on defining magic numbers.
That would be a better solution I feel.
Quoted 25 lines
So, fix above mentioned typo and make device being enumerated again.
Fixes 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints")Cc Oliver Neukum <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>--- drivers/mfd/dln2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mfd/dln2.c +2
-2@@ -754,8 +754,8 @@ static int dln2_probe(struct usb_interface *interface, hostif->desc.bNumEndpoints < 2)return -ENODEV ; - epin = &hostif->endpoint[0 ].desc; - epout = &hostif->endpoint[1 ].desc; + epin = &hostif->endpoint[1 ].desc; + epout = &hostif->endpoint[0 ].desc;if (!usb_endpoint_is_bulk_out (epout))return -ENODEV ;if (!usb_endpoint_is_bulk_in (epin))
Signature · 4 lines
Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog