OSDN Git Service

can: slcan: remove legacy infrastructure
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Thu, 28 Jul 2022 07:02:50 +0000 (09:02 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 28 Jul 2022 07:13:11 +0000 (09:13 +0200)
commitcfcb4465e9923bb9ac168abcea84e880633f9cef
tree87cde172af62ccc05228fee035cf3fd20124ce9e
parent7a1fc3eea76f0d85ddfaede0885fca765d17cf6a
can: slcan: remove legacy infrastructure

Taking inspiration from the drivers/net/can/can327.c driver and at the
suggestion of its author Max Staudt, I removed legacy stuff like
`SLCAN_MAGIC' and `slcan_devs' resulting in simplification of the code
and its maintainability.

The use of slcan_devs is derived from a very old kernel, since slip.c
is about 30 years old, so today's kernel allows us to remove it.

The .hangup() ldisc function, which only called the ldisc .close(), has
been removed since the ldisc layer calls .close() in a good place
anyway.

The old slcanX name has been dropped in order to use the standard canX
interface naming. The ioctl SIOCGIFNAME can be used to query the name of
the created interface. Furthermore, there are several ways to get stable
interfaces names in user space, e.g. udev or systemd-networkd.

The `maxdev' module parameter has also been removed.

CC: Max Staudt <max@enpas.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Max Staudt <max@enpas.org>
Link: https://lore.kernel.org/all/20220728070254.267974-4-dario.binacchi@amarulasolutions.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/slcan/slcan-core.c