summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/sccnxp.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2017-10-26 22:24:15 +0200
committerWolfram Sang <wsa@the-dreams.de>2017-10-26 22:24:15 +0200
commit3990bedea6e96cb1f182dbeadd62215dbb9e1c85 (patch)
tree90ac0ab8ae1d4339dc17eb42a853042ea06d6b13 /drivers/tty/serial/sccnxp.c
parent631de7a4603439eaa1d7a2a1a7b5b49edcd87f67 (diff)
parent3997fb74846f35d0364c5e88e54bc9b166d5a1bc (diff)
Merge branch 'i2c-mux/for-next' of https://github.com/peda-r/i2c-mux into i2c/for-4.15
This cycle has been real quiet for me. There's only the one trivial patch that somewhat simplifies DT parsing in the i2c-mux-reg driver.
Diffstat (limited to 'drivers/tty/serial/sccnxp.c')
-rw-r--r--drivers/tty/serial/sccnxp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/tty/serial/sccnxp.c b/drivers/tty/serial/sccnxp.c
index cdd2f942317c..b9c7a904c1ea 100644
--- a/drivers/tty/serial/sccnxp.c
+++ b/drivers/tty/serial/sccnxp.c
@@ -889,7 +889,16 @@ static int sccnxp_probe(struct platform_device *pdev)
goto err_out;
uartclk = 0;
} else {
- clk_prepare_enable(clk);
+ ret = clk_prepare_enable(clk);
+ if (ret)
+ goto err_out;
+
+ ret = devm_add_action_or_reset(&pdev->dev,
+ (void(*)(void *))clk_disable_unprepare,
+ clk);
+ if (ret)
+ goto err_out;
+
uartclk = clk_get_rate(clk);
}
@@ -988,7 +997,7 @@ static int sccnxp_probe(struct platform_device *pdev)
uart_unregister_driver(&s->uart);
err_out:
if (!IS_ERR(s->regulator))
- return regulator_disable(s->regulator);
+ regulator_disable(s->regulator);
return ret;
}