Return a usable format (and resolution) from adv7180_set_pad_format()
in the TRY_FORMAT case

Signed-off-by: Rob Taylor <rob.tay...@codethink.co.uk>
Tested-by: William Towle <william.to...@codethink.co.uk>
---
 drivers/media/i2c/adv7180.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 09a96df..ba0b92d5 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -686,12 +686,14 @@ static int adv7180_set_pad_format(struct v4l2_subdev *sd,
                        adv7180_set_field_mode(state);
                        adv7180_set_power(state, true);
                }
+               adv7180_mbus_fmt(sd, framefmt);
        } else {
                framefmt = v4l2_subdev_get_try_format(sd, cfg, 0);
                *framefmt = format->format;
+               adv7180_mbus_fmt(sd, framefmt);
+               format->format = *framefmt;
        }
-
-       return adv7180_mbus_fmt(sd, framefmt);
+       return 0;
 }
 
 static int adv7180_g_mbus_config(struct v4l2_subdev *sd,
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to