can: etas_es58x: export product information through devlink_ops::info_get()
authorVincent Mailhol <mailhol.vincent@wanadoo.fr>
Wed, 30 Nov 2022 17:46:56 +0000 (02:46 +0900)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 12 Dec 2022 10:39:13 +0000 (11:39 +0100)
commit9f06631c3f1f0f298536443df85a6837ba4c5f5c
tree867832cd38aea198dd746cc449db68cda6b5d877
parent01d80532295cd359dc43e6bd71860d5515f84372
can: etas_es58x: export product information through devlink_ops::info_get()

ES58x devices report below product information through a custom usb
string:

  * the firmware version
  * the bootloader version
  * the hardware revision

Parse this string, store the results in struct es58x_dev, export:

  * the firmware version through devlink's "fw" name
  * the bootloader version through devlink's "fw.bootloader" name
  * the hardware revisionthrough devlink's "board.rev" name

Those devlink entries are not critical to use the device, if parsing
fails, print an informative log message and continue to probe the
device.

In addition to that, use usb_device::serial to report the device
serial number.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/all/20221130174658.29282-6-mailhol.vincent@wanadoo.fr
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/usb/etas_es58x/es58x_core.c
drivers/net/can/usb/etas_es58x/es58x_core.h
drivers/net/can/usb/etas_es58x/es58x_devlink.c