From 3e66d0138c05d9792f458b96581afdb314bc66d6 Mon Sep 17 00:00:00 2001 From: "Christopher R. Baker" Date: Sat, 8 Mar 2014 11:00:20 -0500 Subject: can: populate netdev::dev_id for udev discrimination My objective is to be able to totally discriminate CAN ports on multi-port cards via udev so as to rename them to semantically interesting/unique names for my system (e.g., "ecuCAN" and "auxCAN" instead of "can0" and "can1"). The following patch assigns the dev_id field to match the channel number on all multi-channel devices. I can only test my two-port Peak PCI card, but it works as expected: ATTRS{dev_id} now expresses the port number and my udev rules now unambiguously pick out and rename my individual CAN ports. Signed-off-by: Christopher R. Baker Tested-by: Oliver Hartkopp [PEAK PCAN-USB pro and EMS PCMCIA] Signed-off-by: Marc Kleine-Budde --- drivers/net/can/softing/softing_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/can/softing') diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 3766bd90f3ed..7d8c8f3672dd 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -833,6 +833,7 @@ static int softing_pdev_probe(struct platform_device *pdev) ret = -ENOMEM; goto netdev_failed; } + netdev->dev_id = j; priv = netdev_priv(card->net[j]); priv->index = j; ret = softing_netdev_register(netdev); -- cgit v1.2.3