crypto: msm: make qcrypto and qcedev independent of DEBUG_FS

qcrypto_init() and qcedev_init() should not be dependent on
DEBUG_FS API's returning success. Continue device init,when
DEBUG_FS is disabled.

Change-Id: I32cca791db545f5f2f9ea7871c091b121082dfbc
Signed-off-by: Prerna Kalla <prernak@codeaurora.org>
tirimbino
Prerna Kalla 5 years ago
parent a9e3b4c715
commit 72c4254ea9
  1. 10
      drivers/crypto/msm/qcedev.c
  2. 11
      drivers/crypto/msm/qcrypto.c

@ -2299,7 +2299,7 @@ static int _qcedev_debug_init(void)
_debug_dent = debugfs_create_dir("qcedev", NULL); _debug_dent = debugfs_create_dir("qcedev", NULL);
if (IS_ERR(_debug_dent)) { if (IS_ERR(_debug_dent)) {
pr_err("qcedev debugfs_create_dir fail, error %ld\n", pr_debug("qcedev debugfs_create_dir fail, error %ld\n",
PTR_ERR(_debug_dent)); PTR_ERR(_debug_dent));
return PTR_ERR(_debug_dent); return PTR_ERR(_debug_dent);
} }
@ -2309,7 +2309,7 @@ static int _qcedev_debug_init(void)
dent = debugfs_create_file(name, 0644, _debug_dent, dent = debugfs_create_file(name, 0644, _debug_dent,
&_debug_qcedev, &_debug_stats_ops); &_debug_qcedev, &_debug_stats_ops);
if (dent == NULL) { if (dent == NULL) {
pr_err("qcedev debugfs_create_file fail, error %ld\n", pr_debug("qcedev debugfs_create_file fail, error %ld\n",
PTR_ERR(dent)); PTR_ERR(dent));
rc = PTR_ERR(dent); rc = PTR_ERR(dent);
goto err; goto err;
@ -2322,11 +2322,7 @@ err:
static int qcedev_init(void) static int qcedev_init(void)
{ {
int rc; _qcedev_debug_init();
rc = _qcedev_debug_init();
if (rc)
return rc;
return platform_driver_register(&qcedev_plat_driver); return platform_driver_register(&qcedev_plat_driver);
} }

@ -1,7 +1,7 @@
/* /*
* QTI Crypto driver * QTI Crypto driver
* *
* Copyright (c) 2010-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2010-2020, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -5529,7 +5529,7 @@ static int _qcrypto_debug_init(void)
_debug_dent = debugfs_create_dir("qcrypto", NULL); _debug_dent = debugfs_create_dir("qcrypto", NULL);
if (IS_ERR(_debug_dent)) { if (IS_ERR(_debug_dent)) {
pr_err("qcrypto debugfs_create_dir fail, error %ld\n", pr_debug("qcrypto debugfs_create_dir fail, error %ld\n",
PTR_ERR(_debug_dent)); PTR_ERR(_debug_dent));
return PTR_ERR(_debug_dent); return PTR_ERR(_debug_dent);
} }
@ -5539,7 +5539,7 @@ static int _qcrypto_debug_init(void)
dent = debugfs_create_file(name, 0644, _debug_dent, dent = debugfs_create_file(name, 0644, _debug_dent,
&_debug_qcrypto, &_debug_stats_ops); &_debug_qcrypto, &_debug_stats_ops);
if (dent == NULL) { if (dent == NULL) {
pr_err("qcrypto debugfs_create_file fail, error %ld\n", pr_debug("qcrypto debugfs_create_file fail, error %ld\n",
PTR_ERR(dent)); PTR_ERR(dent));
rc = PTR_ERR(dent); rc = PTR_ERR(dent);
goto err; goto err;
@ -5552,12 +5552,9 @@ err:
static int __init _qcrypto_init(void) static int __init _qcrypto_init(void)
{ {
int rc;
struct crypto_priv *pcp = &qcrypto_dev; struct crypto_priv *pcp = &qcrypto_dev;
rc = _qcrypto_debug_init(); _qcrypto_debug_init();
if (rc)
return rc;
INIT_LIST_HEAD(&pcp->alg_list); INIT_LIST_HEAD(&pcp->alg_list);
INIT_LIST_HEAD(&pcp->engine_list); INIT_LIST_HEAD(&pcp->engine_list);
init_llist_head(&pcp->ordered_resp_list); init_llist_head(&pcp->ordered_resp_list);

Loading…
Cancel
Save