diff options
author | Yuxing Liu <[email protected]> | 2023-05-03 07:06:07 +0000 |
---|---|---|
committer | Abel Vesa <[email protected]> | 2023-06-12 12:20:02 +0300 |
commit | 878b02d5f3b56cb090dbe2c70c89273be144087f (patch) | |
tree | ba5d4566b2777b6561aa5ffa6120e317cd5c1346 /lib/netdev-notifier-error-inject.c | |
parent | e02ba11b457647050cb16e7cad16cec3c252fade (diff) |
clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
Replace of_iomap() and kzalloc() with devm_of_iomap() and devm_kzalloc()
which can automatically release the related memory when the device
or driver is removed or unloaded to avoid potential memory leak.
In this case, iounmap(anatop_base) in line 427,433 are removed
as manual release is not required.
Besides, referring to clk-imx8mq.c, check the return code of
of_clk_add_hw_provider, if it returns negtive, print error info
and unregister hws, which makes the program more robust.
Fixes: 9c140d992676 ("clk: imx: Add support for i.MX8MP clock driver")
Signed-off-by: Yuxing Liu <[email protected]>
Reviewed-by: Dongliang Mu <[email protected]>
Reviewed-by: Abel Vesa <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Abel Vesa <[email protected]>
Diffstat (limited to 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions