OSDN Git Service

[media] lgdt330x: fix signedness error in i2c_read_demod_bytes()
authorXi Wang <xi.wang@gmail.com>
Tue, 14 Feb 2012 17:32:41 +0000 (14:32 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 8 Mar 2012 12:01:12 +0000 (09:01 -0300)
commit34817174fca0c5512c2d5b6ea0fc37a0337ce1d8
treec5dccf4f4b2350089e13d1173d1854382aff7d52
parentbdb2c41fc12b627e0e870b141341ded5772bab70
[media] lgdt330x: fix signedness error in i2c_read_demod_bytes()

The error handling in lgdt3303_read_status() and lgdt330x_read_ucblocks()
doesn't work, because i2c_read_demod_bytes() returns a u8 and (err < 0)
is always false.

        err = i2c_read_demod_bytes(state, 0x58, buf, 1);
        if (err < 0)
                return err;

Change the return type of i2c_read_demod_bytes() to int.  Also change
the return value on error to -EIO to make (err < 0) work.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/lgdt330x.c