media: wl128x: Fix some error handling in fmc_prepare()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 28 Mar 2019 14:41:38 +0000 (10:41 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 29 Mar 2019 11:44:12 +0000 (07:44 -0400)
The st_register() returns have changed over time, but these days it
never returns -1.  We should just be checking for any negative error
codes.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/radio/wl128x/fmdrv_common.c

index a1fcb80a2191e13d0bad178055474430c61e625e..053d51a5890a92742687eacc0a29a433f9434cd3 100644 (file)
@@ -1524,7 +1524,7 @@ int fmc_prepare(struct fmdev *fmdev)
                }
 
                ret = 0;
-       } else if (ret == -1) {
+       } else if (ret < 0) {
                fmerr("st_register failed %d\n", ret);
                return -EAGAIN;
        }