mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-14 09:09:56 +00:00
can: flexcan: use correct clock as base for bit rate calculation
The flexcan IP core uses the peripheral clock ("per") as basic clock for the bit timing calculation. However the driver uses the the wrong clock ("ipg"). This leads to wrong bit rates if the rates on both clock are different. This patch fixes the problem by using the correct clock for the bit rate calculation. Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
7ee330c7b3
commit
1a3e5173f5
@ -1020,13 +1020,13 @@ static int flexcan_probe(struct platform_device *pdev)
|
||||
dev_err(&pdev->dev, "no ipg clock defined\n");
|
||||
return PTR_ERR(clk_ipg);
|
||||
}
|
||||
clock_freq = clk_get_rate(clk_ipg);
|
||||
|
||||
clk_per = devm_clk_get(&pdev->dev, "per");
|
||||
if (IS_ERR(clk_per)) {
|
||||
dev_err(&pdev->dev, "no per clock defined\n");
|
||||
return PTR_ERR(clk_per);
|
||||
}
|
||||
clock_freq = clk_get_rate(clk_per);
|
||||
}
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user