OSDN Git Service

can: etas_es58x: use error pointer during device probing
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Mon, 28 Jun 2021 15:54:16 +0000 (00:54 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 25 Jul 2021 09:36:28 +0000 (11:36 +0200)
commit45cb13963df304fde13262654939dfb18788f95e
treea287f443392bbe0354a7a9bbb24ef88555b5ac72
parent58fb92a517b58ff61237653a5c05c3f3d8dfe392
can: etas_es58x: use error pointer during device probing

Make es58x_init_es58x_dev return a pointer to the allocated structure
instead of returning an integer. Errors are handled through the helper
function ERR_PTR and IS_ERR.

This slightly simplifies the code.

Link: https://lore.kernel.org/r/20210628155420.1176217-3-mailhol.vincent@wanadoo.fr
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/etas_es58x/es58x_core.c