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

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
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
		if (of_child && of_device_is_available(of_child))
			channels_mask |= BIT(i);
		of_node_put(of_child);
	}

	if (chip_id != RENESAS_RZG2L) {
+13 −5
Original line number Diff line number Diff line
@@ -1690,8 +1690,8 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
	u32 osc;
	int err;

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

	if (osc & MCP251XFD_REG_OSC_LPMEN)
		devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
	if (osc & MCP251XFD_REG_OSC_LPMEN) {
		/* 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
			devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
	} else {
		devtype_data = &mcp251xfd_devtype_data_mcp2517fd;
	}

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