video: udlfb: Fix read EDID timeout
authorLadislav Michl <ladis@linux-mips.org>
Thu, 9 Nov 2017 17:09:30 +0000 (18:09 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:14 +0000 (18:32 +0000)
commit6b3fa3dd62ccad96f1a2523c50d678a20049a41a
treeb150bf79e3628af8da86d5e52a379f4b513ebd44
parente0ec55a69450becef296d2abae2476e2db81f336
video: udlfb: Fix read EDID timeout

commit c98769475575c8a585f5b3952f4b5f90266f699b upstream.

While usb_control_msg function expects timeout in miliseconds, a value
of HZ is used. Replace it with USB_CTRL_GET_TIMEOUT and also fix error
message which looks like:
udlfb: Read EDID byte 78 failed err ffffff92
as error is either negative errno or number of bytes transferred use %d
format specifier.

Returned EDID is in second byte, so return error when less than two bytes
are received.

Fixes: 18dffdf8913a ("staging: udlfb: enhance EDID and mode handling support")
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Cc: Bernie Thompson <bernie@plugable.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/video/udlfb.c