From b9721d275cc2c5e6c07371239c827e0faf05a6b9 Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Wed, 27 Mar 2019 16:31:33 +1100 Subject: ocxl: Allow external drivers to use OpenCAPI contexts Most OpenCAPI operations require a valid context, so exposing these functions to external drivers is necessary. Signed-off-by: Alastair D'Silva Reviewed-by: Greg Kurz Acked-by: Frederic Barrat Signed-off-by: Michael Ellerman --- drivers/misc/ocxl/file.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'drivers/misc/ocxl/file.c') diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index 7a38ea5af9db..8225892a5d77 100644 --- a/drivers/misc/ocxl/file.c +++ b/drivers/misc/ocxl/file.c @@ -61,11 +61,7 @@ static int afu_open(struct inode *inode, struct file *file) if (!info) return -ENODEV; - ctx = ocxl_context_alloc(); - if (!ctx) - return -ENOMEM; - - rc = ocxl_context_init(ctx, info->afu, inode->i_mapping); + rc = ocxl_context_alloc(&ctx, info->afu, inode->i_mapping); if (rc) return rc; @@ -90,7 +86,7 @@ static long afu_ioctl_attach(struct ocxl_context *ctx, return -EINVAL; amr = arg.amr & mfspr(SPRN_UAMOR); - rc = ocxl_context_attach(ctx, amr); + rc = ocxl_context_attach(ctx, amr, current->mm); return rc; } -- cgit v1.2.3-59-g8ed1b