]> Git Repo - linux.git/commitdiff
clk: samsung: Revert "clk: samsung: exynos-clkout: Use of_device_get_match_data()"
authorMarek Szyprowski <[email protected]>
Tue, 8 Nov 2022 21:37:18 +0000 (22:37 +0100)
committerKrzysztof Kozlowski <[email protected]>
Tue, 15 Nov 2022 09:36:54 +0000 (10:36 +0100)
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 777aaf3d1daf793461269b49c063aca1cee06a44.

Signed-off-by: Marek Szyprowski <[email protected]>
Fixes: 777aaf3d1daf ("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]>
drivers/clk/samsung/clk-exynos-clkout.c

index 273f77d54dab9eb57296f3f22954785fe180ec55..e6d6cbf8c4e61e5d7d1c7edc653d27a0a995ed78 100644 (file)
@@ -81,17 +81,19 @@ MODULE_DEVICE_TABLE(of, exynos_clkout_ids);
 static int exynos_clkout_match_parent_dev(struct device *dev, u32 *mux_mask)
 {
        const struct exynos_clkout_variant *variant;
+       const struct of_device_id *match;
 
        if (!dev->parent) {
                dev_err(dev, "not instantiated from MFD\n");
                return -EINVAL;
        }
 
-       variant = of_device_get_match_data(dev->parent);
-       if (!variant) {
+       match = of_match_device(exynos_clkout_ids, dev->parent);
+       if (!match) {
                dev_err(dev, "cannot match parent device\n");
                return -EINVAL;
        }
+       variant = match->data;
 
        *mux_mask = variant->mux_mask;
 
This page took 0.062789 seconds and 4 git commands to generate.