Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3741bbb2 authored by Lokesh Vutla's avatar Lokesh Vutla Committed by Herbert Xu
Browse files

crypto: omap-aes - Fix registration of algorithms



Algorithms can be registered only once. So skip registration of
algorithms if already registered (i.e. in case we have two AES cores
in the system.)

Signed-off-by: default avatarLokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: default avatarTero Kristo <t-kristo@ti.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 0a7f330c
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -1185,6 +1185,7 @@ static int omap_aes_probe(struct platform_device *pdev)
	spin_unlock(&list_lock);

	for (i = 0; i < dd->pdata->algs_info_size; i++) {
		if (!dd->pdata->algs_info[i].registered) {
			for (j = 0; j < dd->pdata->algs_info[i].size; j++) {
				algp = &dd->pdata->algs_info[i].algs_list[j];

@@ -1198,6 +1199,7 @@ static int omap_aes_probe(struct platform_device *pdev)
				dd->pdata->algs_info[i].registered++;
			}
		}
	}

	/* Initialize crypto engine */
	dd->engine = crypto_engine_alloc_init(dev, 1);