Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: at91rm9200: use of_device_get_match_data()

Use of_device_get_match_data() since all platforms should now use DT
bindings. AVR32 architecture has been removed in
commit 26202873bb51 ("avr32: remove support for AVR32 architecture").

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1569500132-21164-1-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Claudiu Beznea and committed by
Alexandre Belloni
288d9cf1 54ecb8f7

+2 -18
+1
drivers/rtc/Kconfig
··· 1459 1459 config RTC_DRV_AT91RM9200 1460 1460 tristate "AT91RM9200 or some AT91SAM9 RTC" 1461 1461 depends on ARCH_AT91 || COMPILE_TEST 1462 + depends on OF 1462 1463 help 1463 1464 Driver for the internal RTC (Realtime Clock) module found on 1464 1465 Atmel AT91RM9200's and some AT91SAM9 chips. On AT91SAM9 chips
+1 -18
drivers/rtc/rtc-at91rm9200.c
··· 319 319 .use_shadow_imr = true, 320 320 }; 321 321 322 - #ifdef CONFIG_OF 323 322 static const struct of_device_id at91_rtc_dt_ids[] = { 324 323 { 325 324 .compatible = "atmel,at91rm9200-rtc", ··· 331 332 } 332 333 }; 333 334 MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids); 334 - #endif 335 - 336 - static const struct at91_rtc_config * 337 - at91_rtc_get_config(struct platform_device *pdev) 338 - { 339 - const struct of_device_id *match; 340 - 341 - if (pdev->dev.of_node) { 342 - match = of_match_node(at91_rtc_dt_ids, pdev->dev.of_node); 343 - if (!match) 344 - return NULL; 345 - return (const struct at91_rtc_config *)match->data; 346 - } 347 - 348 - return &at91rm9200_config; 349 - } 350 335 351 336 static const struct rtc_class_ops at91_rtc_ops = { 352 337 .read_time = at91_rtc_readtime, ··· 350 367 struct resource *regs; 351 368 int ret = 0; 352 369 353 - at91_rtc_config = at91_rtc_get_config(pdev); 370 + at91_rtc_config = of_device_get_match_data(&pdev->dev); 354 371 if (!at91_rtc_config) 355 372 return -ENODEV; 356 373