提交 f4de472e 编写于 作者: G Geert Uytterhoeven

serial: sh-sci: Convert from clk_get() to devm_clk_get()

Transfer clock cleanup handling to the core device management code.
Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a67969b5
...@@ -2216,7 +2216,7 @@ static struct uart_ops sci_uart_ops = { ...@@ -2216,7 +2216,7 @@ static struct uart_ops sci_uart_ops = {
static int sci_init_clocks(struct sci_port *sci_port, struct device *dev) static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
{ {
/* Get the SCI functional clock. It's called "fck" on ARM. */ /* Get the SCI functional clock. It's called "fck" on ARM. */
sci_port->fclk = clk_get(dev, "fck"); sci_port->fclk = devm_clk_get(dev, "fck");
if (PTR_ERR(sci_port->fclk) == -EPROBE_DEFER) if (PTR_ERR(sci_port->fclk) == -EPROBE_DEFER)
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (!IS_ERR(sci_port->fclk)) if (!IS_ERR(sci_port->fclk))
...@@ -2226,14 +2226,14 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev) ...@@ -2226,14 +2226,14 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
* But it used to be called "sci_ick", and we need to maintain DT * But it used to be called "sci_ick", and we need to maintain DT
* backward compatibility. * backward compatibility.
*/ */
sci_port->fclk = clk_get(dev, "sci_ick"); sci_port->fclk = devm_clk_get(dev, "sci_ick");
if (PTR_ERR(sci_port->fclk) == -EPROBE_DEFER) if (PTR_ERR(sci_port->fclk) == -EPROBE_DEFER)
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (!IS_ERR(sci_port->fclk)) if (!IS_ERR(sci_port->fclk))
return 0; return 0;
/* SH has historically named the clock "sci_fck". */ /* SH has historically named the clock "sci_fck". */
sci_port->fclk = clk_get(dev, "sci_fck"); sci_port->fclk = devm_clk_get(dev, "sci_fck");
if (!IS_ERR(sci_port->fclk)) if (!IS_ERR(sci_port->fclk))
return 0; return 0;
...@@ -2241,7 +2241,7 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev) ...@@ -2241,7 +2241,7 @@ static int sci_init_clocks(struct sci_port *sci_port, struct device *dev)
* Not all SH platforms declare a clock lookup entry for SCI devices, * Not all SH platforms declare a clock lookup entry for SCI devices,
* in which case we need to get the global "peripheral_clk" clock. * in which case we need to get the global "peripheral_clk" clock.
*/ */
sci_port->fclk = clk_get(dev, "peripheral_clk"); sci_port->fclk = devm_clk_get(dev, "peripheral_clk");
if (!IS_ERR(sci_port->fclk)) if (!IS_ERR(sci_port->fclk))
return 0; return 0;
...@@ -2400,8 +2400,6 @@ static int sci_init_single(struct platform_device *dev, ...@@ -2400,8 +2400,6 @@ static int sci_init_single(struct platform_device *dev,
static void sci_cleanup_single(struct sci_port *port) static void sci_cleanup_single(struct sci_port *port)
{ {
clk_put(port->fclk);
pm_runtime_disable(port->port.dev); pm_runtime_disable(port->port.dev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册