V4L/DVB (5087): Pvrusb2: Fix sizeof() calculation foul-up
[powerpc.git] / drivers / media / video / tda7432.c
index 99261f1..d1ccc06 100644 (file)
@@ -38,7 +38,6 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
-#include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/timer.h>
 #include <linux/delay.h>
@@ -48,9 +47,8 @@
 #include <linux/i2c.h>
 #include <linux/i2c-algo-bit.h>
 
-#include "bttv.h"
-#include <media/audiochip.h>
 #include <media/v4l2-common.h>
+#include <media/i2c-addr.h>
 
 #ifndef VIDEO_AUDIO_BALANCE
 # define VIDEO_AUDIO_BALANCE 32
@@ -71,7 +69,7 @@ module_param(maxvol, int, S_IRUGO | S_IWUSR);
 
 /* Address to scan (I2C address of this chip) */
 static unsigned short normal_i2c[] = {
-       I2C_TDA7432 >> 1,
+       I2C_ADDR_TDA7432 >> 1,
        I2C_CLIENT_END,
 };
 I2C_CLIENT_INSMOD;
@@ -227,8 +225,8 @@ static struct i2c_client client_template;
 static int tda7432_write(struct i2c_client *client, int subaddr, int val)
 {
        unsigned char buffer[2];
-       v4l_dbg(2,client,"In tda7432_write\n");
-       v4l_dbg(1,client,"Writing %d 0x%x\n", subaddr, val);
+       v4l_dbg(2, debug,client,"In tda7432_write\n");
+       v4l_dbg(1, debug,client,"Writing %d 0x%x\n", subaddr, val);
        buffer[0] = subaddr;
        buffer[1] = val;
        if (2 != i2c_master_send(client,buffer,2)) {
@@ -245,9 +243,9 @@ static int tda7432_set(struct i2c_client *client)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
        unsigned char buf[16];
-       v4l_dbg(2,client,"In tda7432_set\n");
+       v4l_dbg(2, debug,client,"In tda7432_set\n");
 
-       v4l_dbg(1,client,
+       v4l_dbg(1, debug,client,
                "tda7432: 7432_set(0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
                t->input,t->volume,t->bass,t->treble,t->lf,t->lr,t->rf,t->rr,t->loud);
        buf[0]  = TDA7432_IN;
@@ -271,7 +269,7 @@ static int tda7432_set(struct i2c_client *client)
 static void do_tda7432_init(struct i2c_client *client)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
-       v4l_dbg(2,client,"In tda7432_init\n");
+       v4l_dbg(2, debug,client,"In tda7432_init\n");
 
        t->input  = TDA7432_STEREO_IN |  /* Main (stereo) input   */
                    TDA7432_BASS_SYM  |  /* Symmetric bass cut    */
@@ -300,10 +298,9 @@ static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind)
        struct tda7432 *t;
        struct i2c_client *client;
 
-       t = kmalloc(sizeof *t,GFP_KERNEL);
+       t = kzalloc(sizeof *t,GFP_KERNEL);
        if (!t)
                return -ENOMEM;
-       memset(t,0,sizeof *t);
 
        client = &t->c;
        memcpy(client,&client_template,sizeof(struct i2c_client));
@@ -340,7 +337,7 @@ static int tda7432_command(struct i2c_client *client,
                           unsigned int cmd, void *arg)
 {
        struct tda7432 *t = i2c_get_clientdata(client);
-       v4l_dbg(2,client,"In tda7432_command\n");
+       v4l_dbg(2, debug,client,"In tda7432_command\n");
        if (debug>1)
                v4l_i2c_print_ioctl(client,cmd);