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: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[sboyd@kernel.org: Use device_get_match_data() instead, drop
printk noise]
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
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;