Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1734138
| From | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 7/7] clocksource: sh_cmt: Use of_device_get_match_data() helper |
| Date | 2017-09-18 15:50 +0200 |
| Message-ID | <ur4AX-6Xw-39@gated-at.bofh.it> (permalink) |
| References | <ur4AV-6Xw-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Use the existing of_device_get_match_data() helper instead of
open-coding its functionality.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v3:
- New.
---
drivers/clocksource/sh_cmt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 89c514cf59a44e48..70b3cf8e23d01bd8 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -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;
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 4/7] clocksource: sh_cmt: Remove support for "renesas,cmt-32*" Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 6/7] clocksource: sh_cmt: Remove unused "renesas,channels-mask" handling Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 1/7] dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
Re: [PATCH v3 1/7] dt-bindings: timer: renesas,cmt: Fix SoC-specific compatible values Rob Herring <robh@kernel.org> - 2017-09-22 01:20 +0200
[PATCH v3 5/7] clocksource: sh_cmt: Mark "renesas,cmt-48-gen2" deprecated Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 3/7] clocksource: sh_cmt: Support separate R-Car Gen2 CMT0/1 Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 2/7] clocksource: sh_cmt: Use 0x3f mask for SH_CMT_48BIT case Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
[PATCH v3 7/7] clocksource: sh_cmt: Use of_device_get_match_data() helper Geert Uytterhoeven <geert+renesas@glider.be> - 2017-09-18 15:50 +0200
Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework Daniel Lezcano <daniel.lezcano@linaro.org> - 2017-09-26 01:30 +0200
Re: [PATCH v3 0/7] clocksource: sh_cmt: Update driver for DT binding rework Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2017-09-26 10:30 +0200
csiph-web