Commit 2c7988ab authored by Hans Petter Selasky's avatar Hans Petter Selasky Committed by Mauro Carvalho Chehab

[media] Correct error code from -ENOMEM to -EINVAL.

Make sure the return value is set in all cases

>From 9b38a5c9878b5e4be2899ae291c4524f5f5fc218 Mon Sep 17 00:00:00 2001
Signed-off-by: default avatarHans Petter Selasky <hselasky@c2i.net>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 5588dc2b
...@@ -726,8 +726,10 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) ...@@ -726,8 +726,10 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on)
const struct sr030pc30_platform_data *pdata = info->pdata; const struct sr030pc30_platform_data *pdata = info->pdata;
int ret; int ret;
if (WARN(pdata == NULL, "No platform data!\n")) if (pdata == NULL) {
return -ENOMEM; WARN(1, "No platform data!\n");
return -EINVAL;
}
/* /*
* Put sensor into power sleep mode before switching off * Put sensor into power sleep mode before switching off
...@@ -746,6 +748,7 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) ...@@ -746,6 +748,7 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on)
if (on) { if (on) {
ret = sr030pc30_base_config(sd); ret = sr030pc30_base_config(sd);
} else { } else {
ret = 0;
info->curr_win = NULL; info->curr_win = NULL;
info->curr_fmt = NULL; info->curr_fmt = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment