diff options
author | Alastair D'Silva <alastair@d-silva.org> | 2019-03-27 16:31:33 +1100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2019-05-03 02:55:02 +1000 |
commit | b9721d275cc2c5e6c07371239c827e0faf05a6b9 (patch) | |
tree | 06ac877469c44d3c14a93a013440150818c6567a /drivers/misc/ocxl/file.c | |
parent | ocxl: Create a clear delineation between ocxl backend & frontend (diff) | |
download | linux-dev-b9721d275cc2c5e6c07371239c827e0faf05a6b9.tar.xz linux-dev-b9721d275cc2c5e6c07371239c827e0faf05a6b9.zip |
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 <alastair@d-silva.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'drivers/misc/ocxl/file.c')
-rw-r--r-- | drivers/misc/ocxl/file.c | 8 |
1 files changed, 2 insertions, 6 deletions
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; } |