summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-12-12 11:30:02 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2007-12-12 11:30:02 +0100
commit0dd6c5726a7840f315f26e4e2f7b93a90de72c73 (patch)
tree5a4930d2379c5c552cffef583f8eaf46e42c69b6 /linux
parent642ec2fcf584082d50b5d0dbb33d4928b91ceecf (diff)
downloadmediapointer-dvb-s2-0dd6c5726a7840f315f26e4e2f7b93a90de72c73.tar.gz
mediapointer-dvb-s2-0dd6c5726a7840f315f26e4e2f7b93a90de72c73.tar.bz2
upd64083: CodingStyle cleanups.
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/upd64083.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/linux/drivers/media/video/upd64083.c b/linux/drivers/media/video/upd64083.c
index c55f905f0..5d441538f 100644
--- a/linux/drivers/media/video/upd64083.c
+++ b/linux/drivers/media/video/upd64083.c
@@ -17,7 +17,8 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
*/
#include <linux/version.h>
@@ -35,7 +36,7 @@ MODULE_DESCRIPTION("uPD64083 driver");
MODULE_AUTHOR("T. Adachi, Takeru KOMORIYA, Hans Verkuil");
MODULE_LICENSE("GPL");
-static int debug = 0;
+static int debug;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
module_param(debug, bool, 0644);
#else
@@ -47,7 +48,7 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)
static unsigned short normal_i2c[] = { 0xb8 >> 1, 0xba >> 1, I2C_CLIENT_END };
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 13)
static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
#endif
@@ -99,7 +100,7 @@ static void upd64083_write(struct i2c_client *client, u8 reg, u8 val)
buf[0] = reg;
buf[1] = val;
- v4l_dbg(1, debug, client, "writing reg addr: %02x val: %02x\n", reg, val);
+ v4l_dbg(1, debug, client, "write reg: %02x val: %02x\n", reg, val);
if (i2c_master_send(client, buf, 2) != 2)
v4l_err(client, "I/O error write 0x%02x/0x%02x\n", reg, val);
}
@@ -120,7 +121,7 @@ static u8 upd64083_read(struct i2c_client *client, u8 reg)
/* ------------------------------------------------------------------------ */
-static int upd64083_command(struct i2c_client *client, unsigned int cmd, void *arg)
+static int upd64083_command(struct i2c_client *client, unsigned cmd, void *arg)
{
struct upd64083_state *state = i2c_get_clientdata(client);
struct v4l2_routing *route = arg;
@@ -156,20 +157,23 @@ static int upd64083_command(struct i2c_client *client, unsigned int cmd, void *a
{
struct v4l2_register *reg = arg;
- if (!v4l2_chip_match_i2c_client(client, reg->match_type, reg->match_chip))
+ if (!v4l2_chip_match_i2c_client(client,
+ reg->match_type, reg->match_chip))
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
- if (cmd == VIDIOC_DBG_G_REGISTER)
+ if (cmd == VIDIOC_DBG_G_REGISTER) {
reg->val = upd64083_read(client, reg->reg & 0xff);
- else
- upd64083_write(client, reg->reg & 0xff, reg->val & 0xff);
+ break;
+ }
+ upd64083_write(client, reg->reg & 0xff, reg->val & 0xff);
break;
}
#endif
case VIDIOC_G_CHIP_IDENT:
- return v4l2_chip_ident_i2c_client(client, arg, V4L2_IDENT_UPD64083, 0);
+ return v4l2_chip_ident_i2c_client(client, arg,
+ V4L2_IDENT_UPD64083, 0);
default:
break;
@@ -190,20 +194,19 @@ static int upd64083_probe(struct i2c_client *client)
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
- v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name);
+ v4l_info(client, "chip found @ 0x%x (%s)\n",
+ client->addr << 1, client->adapter->name);
state = kmalloc(sizeof(struct upd64083_state), GFP_KERNEL);
- if (state == NULL) {
+ if (state == NULL)
return -ENOMEM;
- }
i2c_set_clientdata(client, state);
/* Initially assume that a ghost reduction chip is present */
state->mode = 0; /* YCS mode */
state->ext_y_adc = (1 << 5);
memcpy(state->regs, upd64083_init, TOT_REGS);
- for (i = 0; i < TOT_REGS; i++) {
+ for (i = 0; i < TOT_REGS; i++)
upd64083_write(client, i, state->regs[i]);
- }
return 0;
}
@@ -215,7 +218,7 @@ static int upd64083_remove(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
EXPORT_NO_SYMBOLS;
#endif