Unverified Commit 79d022dc authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Stephen Boyd
Browse files

clk: sprd: sc9860: Simplify with of_device_get_match_data()



Driver's probe function matches against driver's of_device_id table,
where each entry has non-NULL match data, so of_match_node() can be
simplified with of_device_get_match_data().

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[sboyd@kernel.org: Use device_get_match_data() instead, drop
printk noise]
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 3a866087
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -2021,17 +2021,13 @@ MODULE_DEVICE_TABLE(of, sprd_sc9860_clk_ids);

static int sc9860_clk_probe(struct platform_device *pdev)
{
	const struct of_device_id *match;
	const struct sprd_clk_desc *desc;
	int ret;

	match = of_match_node(sprd_sc9860_clk_ids, pdev->dev.of_node);
	if (!match) {
		pr_err("%s: of_match_node() failed", __func__);
	desc = device_get_match_data(&pdev->dev);
	if (!desc)
		return -ENODEV;
	}

	desc = match->data;
	ret = sprd_clk_regmap_init(pdev, desc);
	if (ret)
		return ret;