Commit 6315d935 authored by Weizhao Ouyang's avatar Weizhao Ouyang Committed by Marc Kleine-Budde
Browse files

can: rockchip_canfd: fix broken quirks checks



First get the devtype_data then check quirks.

Fixes: bbdffb34 ("can: rockchip_canfd: add quirk for broken CAN-FD support")
Signed-off-by: default avatarWeizhao Ouyang <o451686892@gmail.com>
Reviewed-by: default avatarVincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20250324114416.10160-1-o451686892@gmail.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 8b187949
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -902,15 +902,16 @@ static int rkcanfd_probe(struct platform_device *pdev)
	priv->can.data_bittiming_const = &rkcanfd_data_bittiming_const;
	priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
		CAN_CTRLMODE_BERR_REPORTING;
	if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
		priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
	priv->can.do_set_mode = rkcanfd_set_mode;
	priv->can.do_get_berr_counter = rkcanfd_get_berr_counter;
	priv->ndev = ndev;

	match = device_get_match_data(&pdev->dev);
	if (match)
	if (match) {
		priv->devtype_data = *(struct rkcanfd_devtype_data *)match;
		if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
			priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
	}

	err = can_rx_offload_add_manual(ndev, &priv->offload,
					RKCANFD_NAPI_WEIGHT);