dm: clk: Define clk_get_by_id() for clk operations
authorLukasz Majewski <lukma@denx.de>
Mon, 24 Jun 2019 13:50:44 +0000 (15:50 +0200)
committerStefano Babic <sbabic@denx.de>
Fri, 19 Jul 2019 12:50:30 +0000 (14:50 +0200)
commit2796af7368acab27a6f9141cecba78106891f1bf
tree46dc367d013f9617a3a794ba45a7f86242018184
parent4aa78300a025b7e09aa8e902b2178b1870ef1ec5
dm: clk: Define clk_get_by_id() for clk operations

This commit adds the clk_get_by_id() function, which is responsible
for getting the udevice with matching clk->id. Such approach allows
re-usage of inherit DM list relationship for the same class (UCLASS_CLK).
As a result - we don't need any other external list - it is just enough
to look for UCLASS_CLK related udevices.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/clk-uclass.c
include/clk.h