Skip to content

Commit

Permalink
crypto: sa2ul - Use the defined variable to clean code
Browse files Browse the repository at this point in the history
Use the defined variable "dev" to make the code cleaner.

Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Tang Bin authored and Herbert Xu committed Oct 29, 2021
1 parent a472cc0 commit 284340a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/crypto/sa2ul.c
Original file line number Diff line number Diff line change
Expand Up @@ -2412,8 +2412,7 @@ static int sa_ul_probe(struct platform_device *pdev)
pm_runtime_enable(dev);
ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__,
ret);
dev_err(dev, "%s: failed to get sync: %d\n", __func__, ret);
pm_runtime_disable(dev);
return ret;
}
Expand All @@ -2435,16 +2434,16 @@ static int sa_ul_probe(struct platform_device *pdev)

sa_register_algos(dev_data);

ret = of_platform_populate(node, NULL, NULL, &pdev->dev);
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret)
goto release_dma;

device_for_each_child(&pdev->dev, &pdev->dev, sa_link_child);
device_for_each_child(dev, dev, sa_link_child);

return 0;

release_dma:
sa_unregister_algos(&pdev->dev);
sa_unregister_algos(dev);

dma_release_channel(dev_data->dma_rx2);
dma_release_channel(dev_data->dma_rx1);
Expand All @@ -2453,8 +2452,8 @@ static int sa_ul_probe(struct platform_device *pdev)
destroy_dma_pool:
dma_pool_destroy(dev_data->sc_pool);

pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);

return ret;
}
Expand Down

0 comments on commit 284340a

Please sign in to comment.