summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-07-31 16:35:32 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-31 16:35:32 -0300
commitb0e920555b166ad438226526c4393703808f76fc (patch)
tree29fcc46ff92c0116a7821cdec5418b73455d6044 /linux
parent8afe09419eed997a4b30a77df5a22c19912b8bc9 (diff)
downloadmediapointer-dvb-s2-b0e920555b166ad438226526c4393703808f76fc.tar.gz
mediapointer-dvb-s2-b0e920555b166ad438226526c4393703808f76fc.tar.bz2
msp3400-driver.c: kmalloc + memset conversion to kzalloc
From: Mariusz Kozlowski <m.kozlowski@tuxland.pl> drivers/media/video/msp3400-driver.c | 28945 -> 28898 (-47 bytes) drivers/media/video/msp3400-driver.o | 125620 -> 125320 (-300 bytes) Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> CC: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/msp3400-driver.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c
index 32e8f630a..fc9d284f7 100644
--- a/linux/drivers/media/video/msp3400-driver.c
+++ b/linux/drivers/media/video/msp3400-driver.c
@@ -890,8 +890,9 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
int msp_rom;
client = kzalloc(sizeof(*client), GFP_KERNEL);
- if (client == NULL)
+ if (!client)
return -ENOMEM;
+
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver;
@@ -906,14 +907,14 @@ static int msp_attach(struct i2c_adapter *adapter, int address, int kind)
return 0;
}
- state = kmalloc(sizeof(*state), GFP_KERNEL);
- if (state == NULL) {
+ state = kzalloc(sizeof(*state), GFP_KERNEL);
+ if (!state) {
kfree(client);
return -ENOMEM;
}
+
i2c_set_clientdata(client, state);
- memset(state, 0, sizeof(*state));
state->v4l2_std = V4L2_STD_NTSC;
state->audmode = V4L2_TUNER_MODE_STEREO;
state->volume = 58880; /* 0db gain */