Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: picoxcell - Update to the current clk API

The picoXcell hardware crypto accelerator driver was using an
older version of the clk framework, and not (un)preparing the
clock before enabling/disabling it. This change uses the handy
clk_prepare_enable function to interact with the current clk
framework correctly.

Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Michael van der Westhuizen and committed by
Herbert Xu
1bd2cd6b 8000112c

+4 -4
+4 -4
drivers/crypto/picoxcell_crypto.c
··· 1755 1755 return PTR_ERR(engine->clk); 1756 1756 } 1757 1757 1758 - if (clk_enable(engine->clk)) { 1759 - dev_info(&pdev->dev, "unable to enable clk\n"); 1758 + if (clk_prepare_enable(engine->clk)) { 1759 + dev_info(&pdev->dev, "unable to prepare/enable clk\n"); 1760 1760 clk_put(engine->clk); 1761 1761 return -EIO; 1762 1762 } 1763 1763 1764 1764 err = device_create_file(&pdev->dev, &dev_attr_stat_irq_thresh); 1765 1765 if (err) { 1766 - clk_disable(engine->clk); 1766 + clk_disable_unprepare(engine->clk); 1767 1767 clk_put(engine->clk); 1768 1768 return err; 1769 1769 } ··· 1831 1831 crypto_unregister_alg(&alg->alg); 1832 1832 } 1833 1833 1834 - clk_disable(engine->clk); 1834 + clk_disable_unprepare(engine->clk); 1835 1835 clk_put(engine->clk); 1836 1836 1837 1837 return 0;