Skip to content

Commit

Permalink
rtc: mxc: use of_device_get_match_data
Browse files Browse the repository at this point in the history
Use of_device_get_match_data to simplify mxc_rtc_probe.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20201117203035.1280099-1-alexandre.belloni@bootlin.com
  • Loading branch information
Alexandre Belloni committed Nov 17, 2020
1 parent 42882a8 commit ba7aa63
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-mxc.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,12 @@ static int mxc_rtc_probe(struct platform_device *pdev)
u32 reg;
unsigned long rate;
int ret;
const struct of_device_id *of_id;

pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;

of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
pdata->devtype = (enum imx_rtc_type)of_id->data;
pdata->devtype = (enum imx_rtc_type)of_device_get_match_data(&pdev->dev);

pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(pdata->ioaddr))
Expand Down

0 comments on commit ba7aa63

Please sign in to comment.