diff options
-rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index cf5508967539..4b024280def1 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c | |||
@@ -1726,11 +1726,17 @@ static int ux500_hash_probe(struct platform_device *pdev) | |||
1726 | goto out_regulator; | 1726 | goto out_regulator; |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | ret = clk_prepare(device_data->clk); | ||
1730 | if (ret) { | ||
1731 | dev_err(dev, "[%s] clk_prepare() failed!", __func__); | ||
1732 | goto out_clk; | ||
1733 | } | ||
1734 | |||
1729 | /* Enable device power (and clock) */ | 1735 | /* Enable device power (and clock) */ |
1730 | ret = hash_enable_power(device_data, false); | 1736 | ret = hash_enable_power(device_data, false); |
1731 | if (ret) { | 1737 | if (ret) { |
1732 | dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); | 1738 | dev_err(dev, "[%s]: hash_enable_power() failed!", __func__); |
1733 | goto out_clk; | 1739 | goto out_clk_unprepare; |
1734 | } | 1740 | } |
1735 | 1741 | ||
1736 | ret = hash_check_hw(device_data); | 1742 | ret = hash_check_hw(device_data); |
@@ -1762,6 +1768,9 @@ static int ux500_hash_probe(struct platform_device *pdev) | |||
1762 | out_power: | 1768 | out_power: |
1763 | hash_disable_power(device_data, false); | 1769 | hash_disable_power(device_data, false); |
1764 | 1770 | ||
1771 | out_clk_unprepare: | ||
1772 | clk_unprepare(device_data->clk); | ||
1773 | |||
1765 | out_clk: | 1774 | out_clk: |
1766 | clk_put(device_data->clk); | 1775 | clk_put(device_data->clk); |
1767 | 1776 | ||
@@ -1826,6 +1835,7 @@ static int ux500_hash_remove(struct platform_device *pdev) | |||
1826 | dev_err(dev, "[%s]: hash_disable_power() failed", | 1835 | dev_err(dev, "[%s]: hash_disable_power() failed", |
1827 | __func__); | 1836 | __func__); |
1828 | 1837 | ||
1838 | clk_unprepare(device_data->clk); | ||
1829 | clk_put(device_data->clk); | 1839 | clk_put(device_data->clk); |
1830 | regulator_put(device_data->regulator); | 1840 | regulator_put(device_data->regulator); |
1831 | 1841 | ||