]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
media: rcar-csi2: set default format if a unsupported one is requested
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Wed, 16 May 2018 23:04:33 +0000 (19:04 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 28 May 2018 17:46:48 +0000 (13:46 -0400)
Instead of failing the set_fmt() if a unsupported format is requested
set a default one and return the changed format to the user.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reported-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/rcar-vin/rcar-csi2.c

index e64f07fe184e76751cb28e1caca4370edd390cab..daef72d410a3425df745eb0da4d92a972159e857 100644 (file)
@@ -613,7 +613,7 @@ static int rcsi2_set_pad_format(struct v4l2_subdev *sd,
        struct v4l2_mbus_framefmt *framefmt;
 
        if (!rcsi2_code_to_fmt(format->format.code))
-               return -EINVAL;
+               format->format.code = rcar_csi2_formats[0].code;
 
        if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) {
                priv->mf = format->format;