mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
ARM: at91/tclib: move initialization from alloc to probe
Move resource retrieval from atmel_tc_alloc to tc_probe to avoid lately reporting resource related issues when a TC block user request a TC block. Moreover, resources retrieval are usually done in the probe function, thus moving them add some consistency with other drivers. Initialization is done once, ie not every time a tc block is requested. If it fails, the device is not appended to the list of tc blocks. Furhermore, the device id is retrieved at probe as well, avoiding parsing DT every time the user requests of tc block. Signed-off-by: Gaël PORTAY <[email protected]> Acked-by: Thierry Reding <[email protected]> Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]>
This commit is contained in:
parent
8495497f92
commit
4930d247af
4 changed files with 29 additions and 54 deletions
|
|
@ -379,7 +379,7 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)
|
|||
return err;
|
||||
}
|
||||
|
||||
tc = atmel_tc_alloc(tcblock, "tcb-pwm");
|
||||
tc = atmel_tc_alloc(tcblock);
|
||||
if (tc == NULL) {
|
||||
dev_err(&pdev->dev, "failed to allocate Timer Counter Block\n");
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue