Commit 25bcfaa
rtc: mxc: 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
6705 1968 0 8673 21e1 drivers/rtc/rtc-mxc.o
down to:
6212 1968 0 8180 1ff4 drivers/rtc/rtc-mxc.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/1b5ad1877304b01ddbba73ca615274a52f781aa2.1660582728.git.christophe.jaillet@wanadoo.fr1 parent 509451a commit 25bcfaa
1 file changed
Lines changed: 2 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | 294 | | |
303 | 295 | | |
304 | 296 | | |
| |||
341 | 333 | | |
342 | 334 | | |
343 | 335 | | |
344 | | - | |
| 336 | + | |
345 | 337 | | |
346 | 338 | | |
347 | 339 | | |
348 | 340 | | |
349 | 341 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
| 342 | + | |
355 | 343 | | |
356 | | - | |
357 | 344 | | |
358 | 345 | | |
359 | 346 | | |
360 | 347 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | 348 | | |
372 | 349 | | |
373 | 350 | | |
| |||
0 commit comments