diff options
author | Gjorgji Rosikopulos <grosikopulos@mm-sol.com> | 2016-03-31 14:12:45 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-03-31 10:07:59 -0700 |
commit | 1472ec67f734d9707d4758fddd4787113fe0b0b2 (patch) | |
tree | f37833fd54c4ecbedfd29e74b2506a61b124d1b5 /drivers/staging/greybus/camera.c | |
parent | a7be84613acc4f732f3aa9ab28da7e2e3a6bab0b (diff) | |
download | linux-1472ec67f734d9707d4758fddd4787113fe0b0b2.tar.bz2 |
greybus: camera: Use pointer for gb camera module ops
No need to duplicate module ops on every registration.
NOTE: Change should be along merged with:
"msm: camera: Change gb_camera_module ops to pointer"
Signed-off-by: Gjorgji Rosikopulos <grosikopulos@mm-sol.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/camera.c')
-rw-r--r-- | drivers/staging/greybus/camera.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index a871b0f33733..2de91d59a54e 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -498,23 +498,30 @@ static int gb_camera_op_capture(void *priv, u32 request_id, unsigned int streams, unsigned int num_frames, size_t settings_size, const void *settings) { - return gb_camera_capture(priv, request_id, streams, num_frames, + struct gb_camera *gcam = priv; + + return gb_camera_capture(gcam, request_id, streams, num_frames, settings_size, settings); } static int gb_camera_op_flush(void *priv, u32 *request_id) { - return gb_camera_flush(priv, request_id); + struct gb_camera *gcam = priv; + + return gb_camera_flush(gcam, request_id); } +static const struct gb_camera_ops gb_cam_ops = { + .capabilities = gb_camera_op_capabilities, + .configure_streams = gb_camera_op_configure_streams, + .capture = gb_camera_op_capture, + .flush = gb_camera_op_flush, +}; + static int gb_camera_register_intf_ops(struct gb_camera *gcam) { gcam->module.priv = gcam; - gcam->module.ops.capabilities = gb_camera_op_capabilities; - gcam->module.ops.configure_streams = gb_camera_op_configure_streams; - gcam->module.ops.capture = gb_camera_op_capture; - gcam->module.ops.flush = gb_camera_op_flush; - + gcam->module.ops = &gb_cam_ops; return gb_camera_register(&gcam->module); } |