提交 d956fed7 编写于 作者: T Tadeusz Struk 提交者: Herbert Xu

crypto: qat - fix get instance function

Fix the logic in case we have found a device on a given node.
Signed-off-by: NTadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 16f56e8b
...@@ -118,19 +118,19 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node) ...@@ -118,19 +118,19 @@ struct qat_crypto_instance *qat_crypto_get_instance_node(int node)
} }
} }
} }
if (!accel_dev)
pr_info("QAT: Could not find a device on node %d\n", node);
/* Get any started device */
list_for_each(itr, adf_devmgr_get_head()) {
struct adf_accel_dev *tmp_dev;
tmp_dev = list_entry(itr, struct adf_accel_dev, list); if (!accel_dev) {
pr_info("QAT: Could not find a device on node %d\n", node);
/* Get any started device */
list_for_each(itr, adf_devmgr_get_head()) {
struct adf_accel_dev *tmp_dev;
if (adf_dev_started(tmp_dev) && tmp_dev = list_entry(itr, struct adf_accel_dev, list);
!list_empty(&tmp_dev->crypto_list)) { if (adf_dev_started(tmp_dev) &&
accel_dev = tmp_dev; !list_empty(&tmp_dev->crypto_list)) {
break; accel_dev = tmp_dev;
break;
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册