]> git.dujemihanovic.xyz Git - u-boot.git/commit
cmd: clk: replace clk_lookup by uclass_get_device_by_name
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Mon, 31 Jan 2022 16:21:38 +0000 (17:21 +0100)
committerSean Anderson <seanga2@gmail.com>
Fri, 25 Feb 2022 06:41:04 +0000 (01:41 -0500)
commitafcc26140bc6bff7c23ce02dbba7882c97d2c14a
treed0397f532a3b2d7c90fbe83a60b8d3f6e36f69c1
parent3386fb1e485da7f206488ed206a61ae811885d90
cmd: clk: replace clk_lookup by uclass_get_device_by_name

The function clk_lookup can be replaced by a direct call
to uclass_get_device_by_name for UCLASS_CLK.

This patch removes duplicated codes by the generic DM API and avoids
issue in clk_lookup because result of uclass_get_device wasn't tested;
when ret < 0, dev = NULL and dev->name is invalid, the next function
call strcmp(name, dev->name) causes a crash.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20220131172131.2.I7bc7762eff1e31ab7ff5b34c416ee03b8fe52200@changeid
cmd/clk.c