]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:23:13 +0000 (14:23 +0200)
commitd9a30a110aab8047602e2110c66b79d98e9bb6a3
treeaeccf1b32ddcd692bbf9b1083c8c2a0cf9e7febc
parentb2cdeb9250117414d1f0044d4031988971918a63
can: grcan: use ofdev->dev when allocating DMA memory

BugLink: https://bugs.launchpad.net/bugs/1978240
commit 101da4268626b00d16356a6bf284d66e44c46ff9 upstream.

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 53b7670e5735
("sparc: factor the dma coherent mapping into helper") after which the
driver oopses.

Fixes: 6cec9b07fe6a ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/can/grcan.c