Commit 8f08553
rtc: k3: Use devm_clk_get_enabled() helper
The devm_clk_get_enabled() helper:
- calls devm_clk_get()
- calls clk_prepare_enable() and registers what is needed in order to
call clk_disable_unprepare() when needed, as a managed resource.
This simplifies the code, the error handling paths and avoid the need of
a dedicated function used with devm_add_action_or_reset().
Based on my test with allyesconfig, this reduces the .o size from:
text data bss dec hex filename
12843 4804 64 17711 452f drivers/rtc/rtc-ti-k3.o
down to:
12523 4804 64 17391 43ef drivers/rtc/rtc-ti-k3.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/601288834ab71c0fddde7eedd8cdb8001254ed7e.1661329498.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>1 parent 94e4603 commit 8f08553
1 file changed
Lines changed: 4 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | 518 | | |
520 | 519 | | |
521 | | - | |
| 520 | + | |
522 | 521 | | |
523 | 522 | | |
524 | 523 | | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | 524 | | |
534 | 525 | | |
535 | 526 | | |
| |||
544 | 535 | | |
545 | 536 | | |
546 | 537 | | |
547 | | - | |
| 538 | + | |
548 | 539 | | |
549 | 540 | | |
550 | 541 | | |
551 | 542 | | |
552 | | - | |
553 | 543 | | |
554 | 544 | | |
555 | 545 | | |
556 | | - | |
| 546 | + | |
557 | 547 | | |
558 | 548 | | |
559 | 549 | | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
| 550 | + | |
565 | 551 | | |
566 | 552 | | |
567 | 553 | | |
| |||
0 commit comments