can: peak_usb: export PCAN CAN channel ID as sysfs device attribute
authorLukas Magel <lukas.magel@posteo.net>
Mon, 16 Jan 2023 20:09:30 +0000 (20:09 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 2 Feb 2023 16:39:25 +0000 (17:39 +0100)
commit6d02f6daeb44c0099ace2e3597d56420eecfaeb2
treea659ee4b12e549500e2f594b452fc68502dc8a2f
parent36d007c6fc7962cb70ff4b1496d1e24f8b1c1300
can: peak_usb: export PCAN CAN channel ID as sysfs device attribute

This patch exports the CAN channel ID as a sysfs attribute. The CAN
channel ID is a user-configurable u8/u32 identifier that can be set
individually for each CAN interface of a PEAK USB device.

Exporting the channel ID as a sysfs attribute allows users to easily read
the ID and to write udev rules that can match against the ID. This is
especially useful for PEAK USB devices that do not export a serial
number at SUB level.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Lukas Magel <lukas.magel@posteo.net>
Link: https://lore.kernel.org/all/20230116200932.157769-7-lukas.magel@posteo.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Documentation/ABI/testing/sysfs-class-net-peak_usb [new file with mode: 0644]
drivers/net/can/usb/peak_usb/pcan_usb_core.c