Skip to content

Commit 42882a8

Browse files
fabioestevamalexandrebelloni
authored andcommitted
rtc: mxc: Convert the driver to DT-only
Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code by removing the unused non-DT support. Signed-off-by: Fabio Estevam <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent afa819c commit 42882a8

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

drivers/rtc/rtc-mxc.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,12 @@ struct rtc_plat_data {
7070
enum imx_rtc_type devtype;
7171
};
7272

73-
static const struct platform_device_id imx_rtc_devtype[] = {
74-
{
75-
.name = "imx1-rtc",
76-
.driver_data = IMX1_RTC,
77-
}, {
78-
.name = "imx21-rtc",
79-
.driver_data = IMX21_RTC,
80-
}, {
81-
/* sentinel */
82-
}
83-
};
84-
MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);
85-
86-
#ifdef CONFIG_OF
8773
static const struct of_device_id imx_rtc_dt_ids[] = {
8874
{ .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
8975
{ .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
9076
{}
9177
};
9278
MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids);
93-
#endif
9479

9580
static inline int is_imx1_rtc(struct rtc_plat_data *data)
9681
{
@@ -329,10 +314,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
329314
return -ENOMEM;
330315

331316
of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
332-
if (of_id)
333-
pdata->devtype = (enum imx_rtc_type)of_id->data;
334-
else
335-
pdata->devtype = pdev->id_entry->driver_data;
317+
pdata->devtype = (enum imx_rtc_type)of_id->data;
336318

337319
pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
338320
if (IS_ERR(pdata->ioaddr))
@@ -438,7 +420,6 @@ static struct platform_driver mxc_rtc_driver = {
438420
.name = "mxc_rtc",
439421
.of_match_table = of_match_ptr(imx_rtc_dt_ids),
440422
},
441-
.id_table = imx_rtc_devtype,
442423
.probe = mxc_rtc_probe,
443424
};
444425

0 commit comments

Comments
 (0)