Skip to content

Commit 5623772

Browse files
Alain Volmatkartben
authored andcommitted
video: remove valid pointer check in api entry points
Now that video api functions have __ASSERT_NO_MSG calls, drivers do not need to check the entry point functions pointers. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
1 parent 08df2fd commit 5623772

File tree

6 files changed

+0
-31
lines changed

6 files changed

+0
-31
lines changed

drivers/video/ov7670.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,6 @@ static int ov7670_get_fmt(const struct device *dev, struct video_format *fmt)
448448
{
449449
struct ov7670_data *data = dev->data;
450450

451-
if (fmt == NULL) {
452-
return -EINVAL;
453-
}
454451
memcpy(fmt, &data->fmt, sizeof(data->fmt));
455452
return 0;
456453
}

drivers/video/video_esp32_dvp.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,6 @@ static int video_esp32_get_fmt(const struct device *dev, struct video_format *fm
259259

260260
LOG_DBG("Get format");
261261

262-
if (fmt == NULL) {
263-
return -EINVAL;
264-
}
265-
266262
ret = video_get_format(cfg->source_dev, fmt);
267263
if (ret) {
268264
LOG_ERR("Failed to get format from source");
@@ -280,10 +276,6 @@ static int video_esp32_set_fmt(const struct device *dev, struct video_format *fm
280276
struct video_esp32_data *data = dev->data;
281277
int ret;
282278

283-
if (fmt == NULL) {
284-
return -EINVAL;
285-
}
286-
287279
ret = video_set_format(cfg->source_dev, fmt);
288280
if (ret < 0) {
289281
return ret;

drivers/video/video_mcux_csi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ static int video_mcux_csi_get_fmt(const struct device *dev, struct video_format
176176
{
177177
const struct video_mcux_csi_config *config = dev->config;
178178

179-
if (fmt == NULL) {
180-
return -EINVAL;
181-
}
182-
183179
if (config->source_dev && !video_get_format(config->source_dev, fmt)) {
184180
#if defined(CONFIG_VIDEO_MCUX_MIPI_CSI2RX)
185181
video_pix_fmt_convert(fmt, true);

drivers/video/video_mcux_mipi_csi2rx.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ static int mipi_csi2rx_get_fmt(const struct device *dev, struct video_format *fm
130130
{
131131
const struct mipi_csi2rx_config *config = dev->config;
132132

133-
if (fmt == NULL) {
134-
return -EINVAL;
135-
}
136-
137133
if (video_get_format(config->sensor_dev, fmt)) {
138134
return -EIO;
139135
}

drivers/video/video_mcux_smartdma.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ static int nxp_video_sdma_set_format(const struct device *dev, struct video_form
220220
const struct nxp_video_sdma_config *config = dev->config;
221221
int ret;
222222

223-
if (fmt == NULL) {
224-
return -EINVAL;
225-
}
226-
227223
if (!device_is_ready(config->sensor_dev)) {
228224
LOG_ERR("Sensor device not ready");
229225
return -ENODEV;
@@ -252,10 +248,6 @@ static int nxp_video_sdma_get_format(const struct device *dev, struct video_form
252248
const struct nxp_video_sdma_config *config = dev->config;
253249
int ret;
254250

255-
if (fmt == NULL) {
256-
return -EINVAL;
257-
}
258-
259251
if (!device_is_ready(config->sensor_dev)) {
260252
LOG_ERR("Sensor device not ready");
261253
return -ENODEV;

drivers/video/video_stm32_dcmi.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ static int video_stm32_dcmi_get_fmt(const struct device *dev, struct video_forma
210210
const struct video_stm32_dcmi_config *config = dev->config;
211211
int ret;
212212

213-
if (fmt == NULL) {
214-
return -EINVAL;
215-
}
216-
217213
/* Align DCMI format with the one provided by the sensor */
218214
ret = video_get_format(config->sensor_dev, fmt);
219215
if (ret < 0) {

0 commit comments

Comments
 (0)