Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: imx: Use device_get_match_data()

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>

authored by

Rob Herring and committed by
Shawn Guo
d99cfab4 b85ea95d

+4 -5
+4 -5
arch/arm/mach-imx/mmdc.c
··· 13 13 #include <linux/module.h> 14 14 #include <linux/of.h> 15 15 #include <linux/of_address.h> 16 - #include <linux/of_device.h> 16 + #include <linux/platform_device.h> 17 + #include <linux/property.h> 17 18 #include <linux/perf_event.h> 18 19 #include <linux/slab.h> 19 20 ··· 104 103 struct device *dev; 105 104 struct perf_event *mmdc_events[MMDC_NUM_COUNTERS]; 106 105 struct hlist_node node; 107 - struct fsl_mmdc_devtype_data *devtype_data; 106 + const struct fsl_mmdc_devtype_data *devtype_data; 108 107 struct clk *mmdc_ipg_clk; 109 108 }; 110 109 ··· 475 474 struct mmdc_pmu *pmu_mmdc; 476 475 char *name; 477 476 int ret; 478 - const struct of_device_id *of_id = 479 - of_match_device(imx_mmdc_dt_ids, &pdev->dev); 480 477 481 478 pmu_mmdc = kzalloc(sizeof(*pmu_mmdc), GFP_KERNEL); 482 479 if (!pmu_mmdc) { ··· 502 503 GFP_KERNEL, "mmdc%d", ret); 503 504 504 505 pmu_mmdc->mmdc_ipg_clk = mmdc_ipg_clk; 505 - pmu_mmdc->devtype_data = (struct fsl_mmdc_devtype_data *)of_id->data; 506 + pmu_mmdc->devtype_data = device_get_match_data(&pdev->dev); 506 507 507 508 hrtimer_init(&pmu_mmdc->hrtimer, CLOCK_MONOTONIC, 508 509 HRTIMER_MODE_REL);