OP-TEE: change 'struct kref' member read function

Since the refcount_t 'atomic' type is used to implement 'struct kref',
refcount_read() is used to replace atomic_read().

Change-Id: I9fc7876cfd7ed8107551bc1909fa0305ab41d9fd
Signed-off-by: Elon Zhang <zhangzj@rock-chips.com>
This commit is contained in:
Elon Zhang 2019-06-25 10:33:09 +08:00
parent 1b75213d7f
commit dc2876e75b

View File

@ -50,7 +50,7 @@ int tee_context_dump(struct tee *tee, char *buff, size_t len)
pos += sprintf(buff + pos,
"[%02d] ctx=%p (refcount=%d) (usr=%d)",
i, ctx,
(int)atomic_read(&ctx->refcount.
(int)refcount_read(&ctx->refcount.
refcount),
ctx->usr_client);
pos += sprintf(buff + pos, "name=\"%s\" (tgid=%d)\n",
@ -193,7 +193,7 @@ void tee_context_get(struct tee_context *ctx)
kref_get(&ctx->refcount);
dev_dbg(_DEV(ctx->tee), "%s: ctx=%p, kref=%d\n", __func__,
ctx, (int)atomic_read(&ctx->refcount.refcount));
ctx, (int)refcount_read(&ctx->refcount.refcount));
}
static int is_in_list(struct tee *tee, struct list_head *entry)
@ -224,7 +224,7 @@ void tee_context_put(struct tee_context *ctx)
kref_put(&ctx->refcount, _tee_context_do_release);
dev_dbg(_DEV(tee), "%s: ctx=%p, kref=%d\n", __func__,
_ctx, (int)atomic_read(&ctx->refcount.refcount));
_ctx, (int)refcount_read(&ctx->refcount.refcount));
}
/**