Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d1d5172 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Daniel Lezcano
Browse files

clocksource/drivers/sh_cmt: Use of_device_get_match_data() helper



Use the existing of_device_get_match_data() helper instead of
open-coding its functionality.

Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent d1d28597
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
@@ -956,10 +957,7 @@ static int sh_cmt_setup(struct sh_cmt_device *cmt, struct platform_device *pdev)
	raw_spin_lock_init(&cmt->lock);

	if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) {
		const struct of_device_id *id;

		id = of_match_node(sh_cmt_of_table, pdev->dev.of_node);
		cmt->info = id->data;
		cmt->info = of_device_get_match_data(&pdev->dev);
		cmt->hw_channels = cmt->info->channels_mask;
	} else if (pdev->dev.platform_data) {
		struct sh_timer_config *cfg = pdev->dev.platform_data;