summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_msm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_msm.c')
-rw-r--r--drivers/serial/serial_msm.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
index 80fb89e..a7cab13 100644
--- a/drivers/serial/serial_msm.c
+++ b/drivers/serial/serial_msm.c
@@ -150,7 +150,8 @@ static int msm_uart_clk_init(struct udevice *dev)
"clock-frequency", 115200);
uint clkd[2]; /* clk_id and clk_no */
int clk_offset;
- struct udevice *clk;
+ struct udevice *clk_dev;
+ struct clk clk;
int ret;
ret = fdtdec_get_int_array(gd->fdt_blob, dev->of_offset, "clock", clkd,
@@ -162,11 +163,17 @@ static int msm_uart_clk_init(struct udevice *dev)
if (clk_offset < 0)
return clk_offset;
- ret = uclass_get_device_by_of_offset(UCLASS_CLK, clk_offset, &clk);
+ ret = uclass_get_device_by_of_offset(UCLASS_CLK, clk_offset, &clk_dev);
if (ret)
return ret;
- ret = clk_set_periph_rate(clk, clkd[1], clk_rate);
+ clk.id = clkd[1];
+ ret = clk_request(clk_dev, &clk);
+ if (ret < 0)
+ return ret;
+
+ ret = clk_set_rate(&clk, clk_rate);
+ clk_free(&clk);
if (ret < 0)
return ret;