Skip to content

Commit

Permalink
crypto: mediatek - remove redundant clock setting
Browse files Browse the repository at this point in the history
This patch removes redundant clock setting for 'clk_ethif', which is
the parent of 'clk_cryp'. Hence, we just need to handle its child.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ryderlee1110 authored and herbertx committed Jun 10, 2017
1 parent 47d3fd3 commit 8fa23a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 1 addition & 9 deletions drivers/crypto/mediatek/mtk-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,19 +504,14 @@ static int mtk_crypto_probe(struct platform_device *pdev)
}
}

cryp->clk_ethif = devm_clk_get(&pdev->dev, "ethif");
cryp->clk_cryp = devm_clk_get(&pdev->dev, "cryp");
if (IS_ERR(cryp->clk_ethif) || IS_ERR(cryp->clk_cryp))
if (IS_ERR(cryp->clk_cryp))
return -EPROBE_DEFER;

cryp->dev = &pdev->dev;
pm_runtime_enable(cryp->dev);
pm_runtime_get_sync(cryp->dev);

err = clk_prepare_enable(cryp->clk_ethif);
if (err)
goto err_clk_ethif;

err = clk_prepare_enable(cryp->clk_cryp);
if (err)
goto err_clk_cryp;
Expand Down Expand Up @@ -559,8 +554,6 @@ static int mtk_crypto_probe(struct platform_device *pdev)
err_resource:
clk_disable_unprepare(cryp->clk_cryp);
err_clk_cryp:
clk_disable_unprepare(cryp->clk_ethif);
err_clk_ethif:
pm_runtime_put_sync(cryp->dev);
pm_runtime_disable(cryp->dev);

Expand All @@ -576,7 +569,6 @@ static int mtk_crypto_remove(struct platform_device *pdev)
mtk_desc_dma_free(cryp);

clk_disable_unprepare(cryp->clk_cryp);
clk_disable_unprepare(cryp->clk_ethif);

pm_runtime_put_sync(cryp->dev);
pm_runtime_disable(cryp->dev);
Expand Down
2 changes: 0 additions & 2 deletions drivers/crypto/mediatek/mtk-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ struct mtk_sha_rec {
* struct mtk_cryp - Cryptographic device
* @base: pointer to mapped register I/O base
* @dev: pointer to device
* @clk_ethif: pointer to ethif clock
* @clk_cryp: pointer to crypto clock
* @irq: global system and rings IRQ
* @ring: pointer to descriptor rings
Expand All @@ -215,7 +214,6 @@ struct mtk_sha_rec {
struct mtk_cryp {
void __iomem *base;
struct device *dev;
struct clk *clk_ethif;
struct clk *clk_cryp;
int irq[MTK_IRQ_NUM];

Expand Down

0 comments on commit 8fa23a2

Please sign in to comment.