media: tvaudio: improve error handling
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 23 Mar 2018 10:23:23 +0000 (06:23 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 23 Mar 2018 10:54:32 +0000 (06:54 -0400)
commitb0121ca03865ec5fa46f2ffc9d354cd5e5613023
tree4f2e8566ef6c67a6e99d421f5cfabacdb5099123
parent89d6e45c8af8b6e9351564a15467c90e862bbfcd
media: tvaudio: improve error handling

The error handling logic at tvaudio is broken on several ways,
as it doesn't really check right when an error occurs.

Change it to return the proper error code from read/write
routines and fix the errors on reads.

Shuts up the following warnings:
drivers/media/i2c/tvaudio.c:222 chip_read() error: uninitialized symbol 'buffer'.
drivers/media/i2c/tvaudio.c:223 chip_read() error: uninitialized symbol 'buffer'.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/tvaudio.c