Commit 9174cb75 authored by Josuah Demangeon's avatar Josuah Demangeon Committed by Mahesh Mahadevan
Browse files

drivers: video: gc2145: return 0 at the end of functions



After the error code is checked to be zero, it is possible to return 0
explicitly to help with readability. Also, when available, forward the
return code from the failing function instead of a locally chosen error
code like -EIO.

Signed-off-by: default avatarJosuah Demangeon <me@josuah.net>
parent 81f57258
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -876,7 +876,7 @@ static int gc2145_set_window(const struct device *dev, uint16_t reg, uint16_t x,
		return ret;
	}

	return ret;
	return 0;
}

static int gc2145_set_output_format(const struct device *dev, int output_format)
@@ -1155,11 +1155,12 @@ static int gc2145_init(const struct device *dev)
	ret = gc2145_set_fmt(dev, VIDEO_EP_OUT, &fmt);
	if (ret) {
		LOG_ERR("Unable to configure default format");
		return -EIO;
	}
		return ret;
	}

	return 0;
}

/* Unique Instance */
static const struct gc2145_config gc2145_cfg_0 = {
	.i2c = I2C_DT_SPEC_INST_GET(0),