/* register_asymmetric_key_parser - Register a asymmetric key blob parser @parser: The parser to register  */
int register_asymmetric_key_parser(struct asymmetric_key_parser *parser)
/* register_asymmetric_key_parser - Register a asymmetric key blob parser @parser: The parser to register  */
int register_asymmetric_key_parser(struct asymmetric_key_parser *parser)
{
	struct asymmetric_key_parser *cursor;
	int ret;
	down_write(&asymmetric_key_parsers_sem);
	list_for_each_entry(cursor, &asymmetric_key_parsers, link) {
		if (strcmp(cursor->name, parser->name) == 0) {
			pr_err("Asymmetric key parser '%s' already registered\n",
			       parser->name);
			ret = -EEXIST;
			goto out;
		}
	}
	list_add_tail(&parser->link, &asymmetric_key_parsers);
	pr_notice("Asymmetric key parser '%s' registered\n", parser->name);
	ret = 0;
out:
	up_write(&asymmetric_key_parsers_sem);
	return ret;
}