summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-driver.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-20 23:18:00 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-07-20 23:18:00 +0200
commit96d077c01cc78b9eaebe476c4bd24cac36350f1f (patch)
tree5d185225be8bee026e7b3325470756e4afd9ef76 /linux/drivers/media/video/ivtv/ivtv-driver.c
parent09de97070903fecead7c3b0283a0234b28e28223 (diff)
parent7755d5e32117dc27025d42c26e26c78a334988de (diff)
downloadmediapointer-dvb-s2-96d077c01cc78b9eaebe476c4bd24cac36350f1f.tar.gz
mediapointer-dvb-s2-96d077c01cc78b9eaebe476c4bd24cac36350f1f.tar.bz2
Merge: from master
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-driver.c')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-driver.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-driver.c b/linux/drivers/media/video/ivtv/ivtv-driver.c
index 2c935e1af..430010b53 100644
--- a/linux/drivers/media/video/ivtv/ivtv-driver.c
+++ b/linux/drivers/media/video/ivtv/ivtv-driver.c
@@ -95,8 +95,14 @@ const u32 yuv_offset[4] = {
/* Parameter declarations */
static int cardtype[IVTV_MAX_CARDS];
-static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
-static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
+static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 };
+static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1 };
static int cardtype_c = 1;
static int tuner_c = 1;
@@ -1246,8 +1252,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
retval = -ENODEV;
IVTV_ERR("Error %d on initialization\n", retval);
+ spin_lock(&ivtv_cards_lock);
kfree(ivtv_cards[ivtv_cards_active]);
ivtv_cards[ivtv_cards_active] = NULL;
+ spin_unlock(&ivtv_cards_lock);
return retval;
}
@@ -1350,6 +1358,7 @@ static void module_cleanup(void)
pci_unregister_driver(&ivtv_pci_driver);
+ spin_lock(&ivtv_cards_lock);
for (i = 0; i < ivtv_cards_active; i++) {
if (ivtv_cards[i] == NULL)
continue;
@@ -1358,6 +1367,7 @@ static void module_cleanup(void)
}
kfree(ivtv_cards[i]);
}
+ spin_unlock(&ivtv_cards_lock);
}
/* Note: These symbols are exported because they are used by the ivtv-fb
@@ -1365,6 +1375,7 @@ static void module_cleanup(void)
EXPORT_SYMBOL(ivtv_set_irq_mask);
EXPORT_SYMBOL(ivtv_cards_active);
EXPORT_SYMBOL(ivtv_cards);
+EXPORT_SYMBOL(ivtv_cards_lock);
EXPORT_SYMBOL(ivtv_api);
EXPORT_SYMBOL(ivtv_vapi);
EXPORT_SYMBOL(ivtv_vapi_result);