Skip to content

Commit 2bc5feb

Browse files
mszyprowkrzk
authored andcommitted
clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()"
of_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 code matched the OF IDs on the PARENT device, so replacing it with of_device_get_match_data() broke the driver. This reverts commit 777aaf3. Signed-off-by: Marek Szyprowski <[email protected]> Fixes: 777aaf3 ("clk: samsung: exynos-clkout: Use of_device_get_match_data()") Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
1 parent 4854e8b commit 2bc5feb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/samsung/clk-exynos-clkout.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,19 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
8181
static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
8282
{
8383
const struct exynos_clkout_variant *variant;
84+
const struct of_device_id *match;
8485

8586
if (!dev->parent) {
8687
dev_err(dev, "not instantiated from MFD\n");
8788
return -EINVAL;
8889
}
8990

90-
variant = of_device_get_match_data(dev->parent);
91-
if (!variant) {
91+
match = of_match_device(exynos_clkout_ids, dev->parent);
92+
if (!match) {
9293
dev_err(dev, "cannot match parent device\n");
9394
return -EINVAL;
9495
}
96+
variant = match->data;
9597

9698
*mux_mask = variant->mux_mask;
9799

0 commit comments

Comments
 (0)