Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b0464c9 authored by Johan Hovold's avatar Johan Hovold
Browse files

USB: serial: mxuport: add endpoint sanity check



Add an explicit sanity check to make sure we have the expected
endpoints. This will provide a descriptive error message in case an
expected endpoint is missing when probing.

Note that the driver already gracefully fails to probe (albeit with a
less descriptive error message) if a bulk-in endpoint is missing, and an
attempt to write to a port whose device lack a bulk-out endpoint would
fail with -ENODEV.

Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent bc4c2c15
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1373,6 +1373,8 @@ static struct usb_serial_driver mxuport_device = {
	},
	},
	.description		= "MOXA UPort",
	.description		= "MOXA UPort",
	.id_table		= mxuport_idtable,
	.id_table		= mxuport_idtable,
	.num_bulk_in		= 2,
	.num_bulk_out		= 1,
	.probe			= mxuport_probe,
	.probe			= mxuport_probe,
	.port_probe		= mxuport_port_probe,
	.port_probe		= mxuport_port_probe,
	.attach			= mxuport_attach,
	.attach			= mxuport_attach,