From: Laurent Pinchart Date: Tue, 22 Dec 2015 01:00:35 +0000 (+0200) Subject: greybus: camera: Fix remaining endian conversion issues X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=98ce3b0a71c23f924dd031d41171a96eee7fe313;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: camera: Fix remaining endian conversion issues Convert all Greybus operation fields between CPU and protocol endianness. Signed-off-by: Laurent Pinchart Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 592c3efefb65..c742fea29492 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -99,7 +99,7 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, goto done; } - req->num_streams = nstreams; + req->num_streams = cpu_to_le16(nstreams); req->padding = 0; for (i = 0; i < nstreams; ++i) { @@ -117,9 +117,9 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, if (ret < 0) return ret; - if (resp->num_streams > nstreams) { + if (le16_to_cpu(resp->num_streams) > nstreams) { gcam_dbg(gcam, "got #streams %u > request %u\n", - resp->num_streams, nstreams); + le16_to_cpu(resp->num_streams), nstreams); ret = -EIO; goto done; } @@ -169,7 +169,7 @@ static int gb_camera_configure_streams(struct gb_camera *gcam, gcam_err(gcam, "failed to %s the CSI transmitter\n", nstreams ? "start" : "stop"); - ret = resp->num_streams; + ret = le16_to_cpu(resp->num_streams); done: kfree(req);