Commit 06abcac6 authored by Frank Davis's avatar Frank Davis Committed by Linus Torvalds

[PATCH] 2.5.59 : drivers/media/video/saa7185.c

This patch to saa7185 to resolves buzilla bug #168 (compile error).  It
has been sent to l-k and has received no objections.
parent d41710a0
...@@ -186,7 +186,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -186,7 +186,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla
{ {
int i; int i;
struct saa7185 *encoder; struct saa7185 *encoder;
struct i2c_client client; struct i2c_client *client;
client = kmalloc(sizeof(*client), GFP_KERNEL); client = kmalloc(sizeof(*client), GFP_KERNEL);
if (client == NULL) if (client == NULL)
...@@ -194,14 +194,14 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -194,14 +194,14 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla
client_template.adapter = adap; client_template.adapter = adap;
client_template.addr = addr; client_template.addr = addr;
memcpy(client, &client_template, sizeof(*client)); memcpy(client, &client_template, sizeof(*client));
encoder = kmalloc(sizeof(*decoder), GFP_KERNEL); encoder = kmalloc(sizeof(*encoder), GFP_KERNEL);
if (encoder == NULL) { if (encoder == NULL) {
kfree(client); kfree(client);
return -ENOMEM; return -ENOMEM;
} }
memset(encoder, 0, sizeof(*decoder)); memset(encoder, 0, sizeof(*encoder));
strcpy(client->name, "saa7185"); strcpy(client->name, "saa7185");
encoder->client = client; encoder->client = client;
client->data = encoder; client->data = encoder;
...@@ -221,7 +221,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla ...@@ -221,7 +221,7 @@ static int saa7185_attach(struct i2c_adapter *adap, int addr, unsigned short fla
printk(KERN_INFO "%s_attach: chip version %d\n", printk(KERN_INFO "%s_attach: chip version %d\n",
client->name, i2c_smbus_read_byte(client) >> 5); client->name, i2c_smbus_read_byte(client) >> 5);
} }
init_MUTEX(&decoder->lock); init_MUTEX(&encoder->lock);
i2c_attach_client(client); i2c_attach_client(client);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return 0; return 0;
...@@ -355,6 +355,7 @@ static int saa7185_command(struct i2c_client *client, unsigned int cmd, ...@@ -355,6 +355,7 @@ static int saa7185_command(struct i2c_client *client, unsigned int cmd,
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static struct i2c_driver i2c_driver_saa7185 = { static struct i2c_driver i2c_driver_saa7185 = {
.owner = THIS_MODULE,
.name = "saa7185", /* name */ .name = "saa7185", /* name */
.id = I2C_DRIVERID_SAA7185B, /* ID */ .id = I2C_DRIVERID_SAA7185B, /* ID */
.flags = I2C_DF_NOTIFY, .flags = I2C_DF_NOTIFY,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment