[PATCH] clk: samsung: Revert "clk: Use device_get_match_data()"

Krzysztof Kozlowski krzk at kernel.org
Thu Apr 25 01:04:25 PDT 2024


On 25/04/2024 09:56, Marek Szyprowski wrote:
> device_get_match_data() function should not be used on the device other
> than the one matched to the given driver, because it always returns the
> match_data of the matched driver. In case of exynos-clkout driver, the
> original code matches the OF IDs on the PARENT device, so replacing it
> with of_device_get_match_data() broke the driver.
> 
> This has been already pointed once in commit 2bc5febd05ab ("clk: samsung:
> Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()"").
> To avoid further confusion, add a comment about this special case, which
> requires direct of_match_device() call to pass custom IDs array.
> 
> This partially reverts commit 409c39ec92a35e3708f5b5798c78eae78512cd71.

D'oh! Again!

But to be honest, I think there misleading code is that exynos-clkout
(so the child) has:
.of_match_table = exynos_clkout_ids,

So one really can believe that this driver matches to exynos_clkout_ids,
which are the same as exynos-pmu (parent).

I think we should drop the of_match_table and rely on driver name
matching (MFD cell) or platform_device_id.

This patch is correct, so above solution could be added as 2 patch.

Thanks for noticing it.

Best regards,
Krzysztof




More information about the linux-arm-kernel mailing list