]> git.baikalelectronics.ru Git - kernel.git/commit
can: sja1000_isa: add locking for indirect register access mode
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 15 Apr 2014 17:30:00 +0000 (19:30 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Apr 2014 20:22:53 +0000 (22:22 +0200)
commitbec2b2eff1aa5b804e0640764bc4c81a7d630eb5
tree5eff58f9133f3e21f8b2134867cefc1c2ec4b817
parent0f991fdd3a7812762ab6eb8c8f5922ca4ebf0efc
can: sja1000_isa: add locking for indirect register access mode

When accessing the SJA1000 controller registers in the indirect access mode,
writing the register number and reading/writing the data has to be an atomic
attempt.

As the sja1000_isa driver is an old style driver with a fixed number of
instances the locking variable depends on the same index like all the other
configuration elements given on the module command line.

As a positive side effect dev->dev_id is populated by the instance index,
which was missing in e2a8d1a829e6ea ("can: populate netdev::dev_id for udev
discrimination").

Reported-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/sja1000/sja1000_isa.c