/* Returns 0 on success or a negative error code.  */
int genl_unregister_ops(struct genl_family *family, struct genl_ops *ops)
/* Returns 0 on success or a negative error code.  */
int genl_unregister_ops(struct genl_family *family, struct genl_ops *ops)
{
	struct genl_ops *rc;
	genl_lock();
	list_for_each_entry(rc, &family->ops_list, ops_list) {
		if (rc == ops) {
			list_del(&ops->ops_list);
			genl_unlock();
			genl_ctrl_event(CTRL_CMD_DELOPS, ops);
			return 0;
		}
	}
	genl_unlock();
	return -ENOENT;
}