@@ -159,8 +159,8 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
return 0;
out:
- if (info->clk)
- clk_disable_unprepare(info->clk);
+ clk_disable_unprepare(info->clk);
+
return ret;
}
@@ -229,8 +229,8 @@ static int of_platform_serial_remove(struct platform_device *ofdev)
serial8250_unregister_port(info->line);
- if (info->clk)
- clk_disable_unprepare(info->clk);
+ clk_disable_unprepare(info->clk);
+
kfree(info);
return 0;
}
@@ -244,7 +244,7 @@ static int of_serial_suspend(struct device *dev)
serial8250_suspend_port(info->line);
- if (info->clk && (!uart_console(port) || console_suspend_enabled))
+ if (!uart_console(port) || console_suspend_enabled)
clk_disable_unprepare(info->clk);
return 0;
After long term efforts of fixing non-common clock implementations, clk_disable() is a no-op for a NULL pointer input, and this is now tree-wide consistent. All clock consumers can safely call clk_disable(_unprepare) without NULL pointer check. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> --- drivers/tty/serial/8250/8250_of.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.7.4