serial: of_serial: use devm_clk_get() instead of clk_get()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 25 May 2015 05:57:43 +0000 (14:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 21:55:12 +0000 (06:55 +0900)
The probe method of this driver calls clk_get(), but clk_put() is
missing from the remove callback.

Using the managed clk function is easier than fixing other parts.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/of_serial.c

index 28b9b4789bbfd27d5efa4ca20dba2286a755d228..d353fdf55ac19e156f3e0d56fd48b3b31f6c2b07 100644 (file)
@@ -67,7 +67,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
        if (of_property_read_u32(np, "clock-frequency", &clk)) {
 
                /* Get clk rate through clk driver if present */
-               info->clk = clk_get(&ofdev->dev, NULL);
+               info->clk = devm_clk_get(&ofdev->dev, NULL);
                if (IS_ERR(info->clk)) {
                        dev_warn(&ofdev->dev,
                                "clk or clock-frequency not defined\n");