Commit 44484fa8 authored by David S. Miller's avatar David S. Miller

Merge tag 'linux-can-fixes-for-5.19-20220720' of...

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: default avatarDavid S. Miller <davem@davemloft.net>
parents e5ec6a25 7b66dfcc
...@@ -1843,6 +1843,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) ...@@ -1843,6 +1843,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
of_child = of_get_child_by_name(pdev->dev.of_node, name); of_child = of_get_child_by_name(pdev->dev.of_node, name);
if (of_child && of_device_is_available(of_child)) if (of_child && of_device_is_available(of_child))
channels_mask |= BIT(i); channels_mask |= BIT(i);
of_node_put(of_child);
} }
if (chip_id != RENESAS_RZG2L) { if (chip_id != RENESAS_RZG2L) {
......
...@@ -1690,8 +1690,8 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv) ...@@ -1690,8 +1690,8 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
u32 osc; u32 osc;
int err; int err;
/* The OSC_LPMEN is only supported on MCP2518FD, so use it to /* The OSC_LPMEN is only supported on MCP2518FD and MCP251863,
* autodetect the model. * so use it to autodetect the model.
*/ */
err = regmap_update_bits(priv->map_reg, MCP251XFD_REG_OSC, err = regmap_update_bits(priv->map_reg, MCP251XFD_REG_OSC,
MCP251XFD_REG_OSC_LPMEN, MCP251XFD_REG_OSC_LPMEN,
...@@ -1703,10 +1703,18 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv) ...@@ -1703,10 +1703,18 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
if (err) if (err)
return err; return err;
if (osc & MCP251XFD_REG_OSC_LPMEN) if (osc & MCP251XFD_REG_OSC_LPMEN) {
devtype_data = &mcp251xfd_devtype_data_mcp2518fd; /* We cannot distinguish between MCP2518FD and
* MCP251863. If firmware specifies MCP251863, keep
* it, otherwise set to MCP2518FD.
*/
if (mcp251xfd_is_251863(priv))
devtype_data = &mcp251xfd_devtype_data_mcp251863;
else else
devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
} else {
devtype_data = &mcp251xfd_devtype_data_mcp2517fd; devtype_data = &mcp251xfd_devtype_data_mcp2517fd;
}
if (!mcp251xfd_is_251XFD(priv) && if (!mcp251xfd_is_251XFD(priv) &&
priv->devtype_data.model != devtype_data->model) { priv->devtype_data.model != devtype_data->model) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment