]> git.baikalelectronics.ru Git - kernel.git/commit
can: grcan: use ofdev->dev when allocating DMA memory
authorDaniel Hellstrom <daniel@gaisler.com>
Fri, 29 Apr 2022 08:46:54 +0000 (10:46 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 29 Apr 2022 10:09:31 +0000 (12:09 +0200)
commit8f7bd77489bb37d4b10f9bcbc56d08d1392ad138
treef328e69c3c0d3ec2daa4e63e25e87c6172a51b79
parente7d3c10f01e90cf8b72f56a59a1a4c699a36fef8
can: grcan: use ofdev->dev when allocating DMA memory

Use the device of the device tree node should be rather than the
device of the struct net_device when allocating DMA buffers.

The driver got away with it on sparc32 until commit 5cb3637e984c
("sparc: factor the dma coherent mapping into helper") after which the
driver oopses.

Fixes: c7e7f7ef6626 ("can: grcan: Add device driver for GRCAN and GRHCAN cores")
Link: https://lore.kernel.org/all/20220429084656.29788-2-andreas@gaisler.com
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/grcan.c