Skip to content

Commit

Permalink
rtc: mxc: Convert the driver to DT-only
Browse files Browse the repository at this point in the history
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 <festevam@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201116180326.5199-1-festevam@gmail.com
  • Loading branch information
Fabio Estevam authored and Alexandre Belloni committed Nov 17, 2020
1 parent afa819c commit 42882a8
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions drivers/rtc/rtc-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,12 @@ struct rtc_plat_data {
enum imx_rtc_type devtype;
};

static const struct platform_device_id imx_rtc_devtype[] = {
{
.name = "imx1-rtc",
.driver_data = IMX1_RTC,
}, {
.name = "imx21-rtc",
.driver_data = IMX21_RTC,
}, {
/* sentinel */
}
};
MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);

#ifdef CONFIG_OF
static const struct of_device_id imx_rtc_dt_ids[] = {
{ .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
{ .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
{}
};
MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids);
#endif

static inline int is_imx1_rtc(struct rtc_plat_data *data)
{
Expand Down Expand Up @@ -329,10 +314,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return -ENOMEM;

of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
if (of_id)
pdata->devtype = (enum imx_rtc_type)of_id->data;
else
pdata->devtype = pdev->id_entry->driver_data;
pdata->devtype = (enum imx_rtc_type)of_id->data;

pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pdata->ioaddr))
Expand Down Expand Up @@ -438,7 +420,6 @@ static struct platform_driver mxc_rtc_driver = {
.name = "mxc_rtc",
.of_match_table = of_match_ptr(imx_rtc_dt_ids),
},
.id_table = imx_rtc_devtype,
.probe = mxc_rtc_probe,
};

Expand Down

0 comments on commit 42882a8

Please sign in to comment.