Skip to content

Commit 44484fa

Browse files
committed
Merge tag 'linux-can-fixes-for-5.19-20220720' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== this is a pull request of 2 patches for net/master. The first patch is by me and fixes the detection of the mcp251863 in the mcp251xfd driver. The last patch is by Liang He and adds a missing of_node_put() in the rcar_canfd driver. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents e5ec6a2 + 7b66dfc commit 44484fa

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

drivers/net/can/rcar/rcar_canfd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
18431843
of_child = of_get_child_by_name(pdev->dev.of_node, name);
18441844
if (of_child && of_device_is_available(of_child))
18451845
channels_mask |= BIT(i);
1846+
of_node_put(of_child);
18461847
}
18471848

18481849
if (chip_id != RENESAS_RZG2L) {

drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,8 +1690,8 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
16901690
u32 osc;
16911691
int err;
16921692

1693-
/* The OSC_LPMEN is only supported on MCP2518FD, so use it to
1694-
* autodetect the model.
1693+
/* The OSC_LPMEN is only supported on MCP2518FD and MCP251863,
1694+
* so use it to autodetect the model.
16951695
*/
16961696
err = regmap_update_bits(priv->map_reg, MCP251XFD_REG_OSC,
16971697
MCP251XFD_REG_OSC_LPMEN,
@@ -1703,10 +1703,18 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
17031703
if (err)
17041704
return err;
17051705

1706-
if (osc & MCP251XFD_REG_OSC_LPMEN)
1707-
devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
1708-
else
1706+
if (osc & MCP251XFD_REG_OSC_LPMEN) {
1707+
/* We cannot distinguish between MCP2518FD and
1708+
* MCP251863. If firmware specifies MCP251863, keep
1709+
* it, otherwise set to MCP2518FD.
1710+
*/
1711+
if (mcp251xfd_is_251863(priv))
1712+
devtype_data = &mcp251xfd_devtype_data_mcp251863;
1713+
else
1714+
devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
1715+
} else {
17091716
devtype_data = &mcp251xfd_devtype_data_mcp2517fd;
1717+
}
17101718

17111719
if (!mcp251xfd_is_251XFD(priv) &&
17121720
priv->devtype_data.model != devtype_data->model) {

0 commit comments

Comments
 (0)