Skip to content

Commit 3c8bdc2

Browse files
robherringalexandrebelloni
authored andcommitted
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>
1 parent 2be36c0 commit 3c8bdc2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/rtc/rtc-omap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#include <linux/kernel.h>
1919
#include <linux/module.h>
2020
#include <linux/of.h>
21-
#include <linux/of_device.h>
2221
#include <linux/pinctrl/pinctrl.h>
2322
#include <linux/pinctrl/pinconf.h>
2423
#include <linux/pinctrl/pinconf-generic.h>
2524
#include <linux/platform_device.h>
2625
#include <linux/pm_runtime.h>
26+
#include <linux/property.h>
2727
#include <linux/rtc.h>
2828
#include <linux/rtc/rtc-omap.h>
2929

@@ -729,16 +729,14 @@ static int omap_rtc_probe(struct platform_device *pdev)
729729
struct omap_rtc *rtc;
730730
u8 reg, mask, new_ctrl;
731731
const struct platform_device_id *id_entry;
732-
const struct of_device_id *of_id;
733732
int ret;
734733

735734
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
736735
if (!rtc)
737736
return -ENOMEM;
738737

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) {
742740
rtc->is_pmic_controller = rtc->type->has_pmic_mode &&
743741
of_device_is_system_power_controller(pdev->dev.of_node);
744742
} else {

0 commit comments

Comments
 (0)