diff options
Diffstat (limited to 'drivers/crypto/stm32/stm32-crc32.c')
-rw-r--r-- | drivers/crypto/stm32/stm32-crc32.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/crypto/stm32/stm32-crc32.c b/drivers/crypto/stm32/stm32-crc32.c index 90a920e7f6..b0cf6d2fd3 100644 --- a/drivers/crypto/stm32/stm32-crc32.c +++ b/drivers/crypto/stm32/stm32-crc32.c @@ -104,7 +104,7 @@ static struct stm32_crc *stm32_crc_get_next_crc(void) struct stm32_crc *crc; spin_lock_bh(&crc_list.lock); - crc = list_first_entry(&crc_list.dev_list, struct stm32_crc, list); + crc = list_first_entry_or_null(&crc_list.dev_list, struct stm32_crc, list); if (crc) list_move_tail(&crc->list, &crc_list.dev_list); spin_unlock_bh(&crc_list.lock); @@ -283,7 +283,6 @@ static struct shash_alg algs[] = { .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_alignmask = 3, .cra_ctxsize = sizeof(struct stm32_crc_ctx), .cra_module = THIS_MODULE, .cra_init = stm32_crc32_cra_init, @@ -305,7 +304,6 @@ static struct shash_alg algs[] = { .cra_priority = 200, .cra_flags = CRYPTO_ALG_OPTIONAL_KEY, .cra_blocksize = CHKSUM_BLOCK_SIZE, - .cra_alignmask = 3, .cra_ctxsize = sizeof(struct stm32_crc_ctx), .cra_module = THIS_MODULE, .cra_init = stm32_crc32c_cra_init, @@ -379,16 +377,11 @@ static int stm32_crc_probe(struct platform_device *pdev) return 0; } -static int stm32_crc_remove(struct platform_device *pdev) +static void stm32_crc_remove(struct platform_device *pdev) { struct stm32_crc *crc = platform_get_drvdata(pdev); int ret = pm_runtime_get_sync(crc->dev); - if (ret < 0) { - pm_runtime_put_noidle(crc->dev); - return ret; - } - spin_lock(&crc_list.lock); list_del(&crc->list); spin_unlock(&crc_list.lock); @@ -401,9 +394,9 @@ static int stm32_crc_remove(struct platform_device *pdev) pm_runtime_disable(crc->dev); pm_runtime_put_noidle(crc->dev); - clk_disable_unprepare(crc->clk); - - return 0; + if (ret >= 0) + clk_disable(crc->clk); + clk_unprepare(crc->clk); } static int __maybe_unused stm32_crc_suspend(struct device *dev) @@ -472,7 +465,7 @@ MODULE_DEVICE_TABLE(of, stm32_dt_ids); static struct platform_driver stm32_crc_driver = { .probe = stm32_crc_probe, - .remove = stm32_crc_remove, + .remove_new = stm32_crc_remove, .driver = { .name = DRIVER_NAME, .pm = &stm32_crc_pm_ops, |