Skip to content

Commit ba7aa63

Browse files
rtc: mxc: use of_device_get_match_data
Use of_device_get_match_data to simplify mxc_rtc_probe. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Fabio Estevam <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 42882a8 commit ba7aa63

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/rtc/rtc-mxc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,12 @@ static int mxc_rtc_probe(struct platform_device *pdev)
307307
u32 reg;
308308
unsigned long rate;
309309
int ret;
310-
const struct of_device_id *of_id;
311310

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

316-
of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
317-
pdata->devtype = (enum imx_rtc_type)of_id->data;
315+
pdata->devtype = (enum imx_rtc_type)of_device_get_match_data(&pdev->dev);
318316

319317
pdata->ioaddr = devm_platform_ioremap_resource(pdev, 0);
320318
if (IS_ERR(pdata->ioaddr))

0 commit comments

Comments
 (0)