]> Pileus Git - ~andy/linux/commitdiff
[media] Correct error code from -ENOMEM to -EINVAL.
authorHans Petter Selasky <hselasky@c2i.net>
Thu, 26 May 2011 07:49:52 +0000 (04:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Jul 2011 20:52:59 +0000 (17:52 -0300)
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>
drivers/media/video/sr030pc30.c

index c901721a1db3e7380d25a71da9b3597a5837cf66..8afb0e8a2e0033dea97f466d929fea3a8d53a09c 100644 (file)
@@ -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;
        }