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

rtc: omap: 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>
Link: https://lore.kernel.org/r/20231009211356.3242037-12-robh@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Rob Herring and committed by
Alexandre Belloni
3c8bdc20 2be36c09

+3 -5
+3 -5
drivers/rtc/rtc-omap.c
··· 18 18 #include <linux/kernel.h> 19 19 #include <linux/module.h> 20 20 #include <linux/of.h> 21 - #include <linux/of_device.h> 22 21 #include <linux/pinctrl/pinctrl.h> 23 22 #include <linux/pinctrl/pinconf.h> 24 23 #include <linux/pinctrl/pinconf-generic.h> 25 24 #include <linux/platform_device.h> 26 25 #include <linux/pm_runtime.h> 26 + #include <linux/property.h> 27 27 #include <linux/rtc.h> 28 28 #include <linux/rtc/rtc-omap.h> 29 29 ··· 729 729 struct omap_rtc *rtc; 730 730 u8 reg, mask, new_ctrl; 731 731 const struct platform_device_id *id_entry; 732 - const struct of_device_id *of_id; 733 732 int ret; 734 733 735 734 rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); 736 735 if (!rtc) 737 736 return -ENOMEM; 738 737 739 - of_id = of_match_device(omap_rtc_of_match, &pdev->dev); 740 - if (of_id) { 741 - rtc->type = of_id->data; 738 + rtc->type = device_get_match_data(&pdev->dev); 739 + if (rtc->type) { 742 740 rtc->is_pmic_controller = rtc->type->has_pmic_mode && 743 741 of_device_is_system_power_controller(pdev->dev.of_node); 744 742 } else {