Commit ba7aa630 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: mxc: use of_device_get_match_data

Use of_device_get_match_data to simplify mxc_rtc_probe.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: default avatarFabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201117203035.1280099-1-alexandre.belloni@bootlin.com
parent 42882a8a
...@@ -307,14 +307,12 @@ static int mxc_rtc_probe(struct platform_device *pdev) ...@@ -307,14 +307,12 @@ static int mxc_rtc_probe(struct platform_device *pdev)
u32 reg; u32 reg;
unsigned long rate; unsigned long rate;
int ret; int ret;
const struct of_device_id *of_id;
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) if (!pdata)
return -ENOMEM; return -ENOMEM;
of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev); pdata->devtype = (enum imx_rtc_type)of_device_get_match_data(&pdev->dev);
pdata->devtype = (enum imx_rtc_type)of_id->data;
pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0); pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pdata->ioaddr)) if (IS_ERR(pdata->ioaddr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment