Commit 777aaf3d authored by Minghao Chi (CGEL ZTE)'s avatar Minghao Chi (CGEL ZTE) Committed by Krzysztof Kozlowski

clk: samsung: exynos-clkout: Use of_device_get_match_data()

Use of_device_get_match_data() to simplify the code.
Signed-off-by: default avatarMinghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220307033546.2075097-1-chi.minghao@zte.com.cn
parent 568035b0
......@@ -81,19 +81,17 @@ 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;
}
match = of_match_device(exynos_clkout_ids, dev->parent);
if (!match) {
variant = of_device_get_match_data(dev->parent);
if (!variant) {
dev_err(dev, "cannot match parent device\n");
return -EINVAL;
}
variant = match->data;
*mux_mask = variant->mux_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment