git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
media
/
video
/
zoran_card.c
diff --git
a/drivers/media/video/zoran_card.c
b/drivers/media/video/zoran_card.c
index
227ba2f
..
246e67c
100644
(file)
--- a/
drivers/media/video/zoran_card.c
+++ b/
drivers/media/video/zoran_card.c
@@
-41,6
+41,7
@@
#include <linux/spinlock.h>
#include <linux/sem.h>
#include <linux/kmod.h>
#include <linux/spinlock.h>
#include <linux/sem.h>
#include <linux/kmod.h>
+#include <linux/wait.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/interrupt.h>
@@
-736,7
+737,7
@@
static struct i2c_algo_bit_data zoran_i2c_bit_data_template = {
};
static struct i2c_adapter zoran_i2c_adapter_template = {
};
static struct i2c_adapter zoran_i2c_adapter_template = {
-
I2C_DEVNAME("zr36057")
,
+
.name = "zr36057"
,
.id = I2C_HW_B_ZR36067,
.algo = NULL,
.client_register = zoran_i2c_client_register,
.id = I2C_HW_B_ZR36067,
.algo = NULL,
.client_register = zoran_i2c_client_register,
@@
-968,6
+969,7
@@
zoran_open_init_params (struct zoran *zr)
static void __devinit
test_interrupts (struct zoran *zr)
{
static void __devinit
test_interrupts (struct zoran *zr)
{
+ DEFINE_WAIT(wait);
int timeout, icr;
clear_interrupt_counters(zr);
int timeout, icr;
clear_interrupt_counters(zr);
@@
-975,7
+977,9
@@
test_interrupts (struct zoran *zr)
zr->testing = 1;
icr = btread(ZR36057_ICR);
btwrite(0x78000000 | ZR36057_ICR_IntPinEn, ZR36057_ICR);
zr->testing = 1;
icr = btread(ZR36057_ICR);
btwrite(0x78000000 | ZR36057_ICR_IntPinEn, ZR36057_ICR);
- timeout = interruptible_sleep_on_timeout(&zr->test_q, 1 * HZ);
+ prepare_to_wait(&zr->test_q, &wait, TASK_INTERRUPTIBLE);
+ timeout = schedule_timeout(HZ);
+ finish_wait(&zr->test_q, &wait);
btwrite(0, ZR36057_ICR);
btwrite(0x78000000, ZR36057_ISR);
zr->testing = 0;
btwrite(0, ZR36057_ICR);
btwrite(0x78000000, ZR36057_ISR);
zr->testing = 0;
@@
-991,7
+995,7
@@
test_interrupts (struct zoran *zr)
static int __devinit
zr36057_init (struct zoran *zr)
{
static int __devinit
zr36057_init (struct zoran *zr)
{
- u
nsigned long
mem;
+ u
32 *
mem;
void *vdev;
unsigned mem_needed;
int j;
void *vdev;
unsigned mem_needed;
int j;
@@
-1046,21
+1050,18
@@
zr36057_init (struct zoran *zr)
/* allocate memory *before* doing anything to the hardware
* in case allocation fails */
mem_needed = BUZ_NUM_STAT_COM * 4;
/* allocate memory *before* doing anything to the hardware
* in case allocation fails */
mem_needed = BUZ_NUM_STAT_COM * 4;
- mem =
(unsigned long) km
alloc(mem_needed, GFP_KERNEL);
+ mem =
kz
alloc(mem_needed, GFP_KERNEL);
vdev = (void *) kmalloc(sizeof(struct video_device), GFP_KERNEL);
if (!mem || !vdev) {
dprintk(1,
KERN_ERR
"%s: zr36057_init() - kmalloc (STAT_COM) failed\n",
ZR_DEVNAME(zr));
vdev = (void *) kmalloc(sizeof(struct video_device), GFP_KERNEL);
if (!mem || !vdev) {
dprintk(1,
KERN_ERR
"%s: zr36057_init() - kmalloc (STAT_COM) failed\n",
ZR_DEVNAME(zr));
- if (vdev)
- kfree(vdev);
- if (mem)
- kfree((void *)mem);
+ kfree(vdev);
+ kfree(mem);
return -ENOMEM;
}
return -ENOMEM;
}
- memset((void *) mem, 0, mem_needed);
- zr->stat_com = (u32 *) mem;
+ zr->stat_com = mem;
for (j = 0; j < BUZ_NUM_STAT_COM; j++) {
zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */
}
for (j = 0; j < BUZ_NUM_STAT_COM; j++) {
zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */
}
@@
-1101,15
+1102,15
@@
zoran_release (struct zoran *zr)
/* unregister videocodec bus */
if (zr->codec) {
struct videocodec_master *master = zr->codec->master_data;
/* unregister videocodec bus */
if (zr->codec) {
struct videocodec_master *master = zr->codec->master_data;
+
videocodec_detach(zr->codec);
videocodec_detach(zr->codec);
- if (master)
- kfree(master);
+ kfree(master);
}
if (zr->vfe) {
struct videocodec_master *master = zr->vfe->master_data;
}
if (zr->vfe) {
struct videocodec_master *master = zr->vfe->master_data;
+
videocodec_detach(zr->vfe);
videocodec_detach(zr->vfe);
- if (master)
- kfree(master);
+ kfree(master);
}
/* unregister i2c bus */
}
/* unregister i2c bus */