diff options
author | Hans Petter Selasky <hselasky@c2i.net> | 2011-05-26 04:49:52 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 17:52:59 -0300 |
commit | 2c7988ab0effa9e41bd9c9db5cb33ddda870ca10 (patch) | |
tree | 1b6ab521b4123156b72b4fd6ae975735c996e19f /drivers | |
parent | 5588dc2b025fd8b2188142b8d59efe562bd57d80 (diff) |
[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: Hans Petter Selasky <hselasky@c2i.net>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/sr030pc30.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/media/video/sr030pc30.c b/drivers/media/video/sr030pc30.c index c901721a1db..8afb0e8a2e0 100644 --- a/drivers/media/video/sr030pc30.c +++ b/drivers/media/video/sr030pc30.c @@ -726,8 +726,10 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) const struct sr030pc30_platform_data *pdata = info->pdata; int ret; - if (WARN(pdata == NULL, "No platform data!\n")) - return -ENOMEM; + if (pdata == NULL) { + WARN(1, "No platform data!\n"); + return -EINVAL; + } /* * Put sensor into power sleep mode before switching off @@ -746,6 +748,7 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) if (on) { ret = sr030pc30_base_config(sd); } else { + ret = 0; info->curr_win = NULL; info->curr_fmt = NULL; } |