diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig
index 3fff757..de3128a 100644
--- a/drivers/media/radio/Kconfig
+++ b/drivers/media/radio/Kconfig
@@ -136,7 +136,7 @@
 	  Choose Y here if you have this PCI FM radio card.
 
 	  In order to control your radio card, you will need to use programs
-	  that are compatible with the Video for Linux API.  Information on 
+	  that are compatible with the Video for Linux API.  Information on
 	  this API and pointers to "v4l" programs may be found at
 	  <file:Documentation/video4linux/API.html>.
 
diff --git a/drivers/media/radio/miropcm20-radio.c b/drivers/media/radio/miropcm20-radio.c
index dc292da..ba1f0c1 100644
--- a/drivers/media/radio/miropcm20-radio.c
+++ b/drivers/media/radio/miropcm20-radio.c
@@ -16,7 +16,7 @@
 
 /* What ever you think about the ACI, version 0x07 is not very well!
  * I can't get frequency, 'tuner status', 'tuner flags' or mute/mono
- * conditions...                Robert 
+ * conditions...                Robert
  */
 
 #include <linux/module.h>
@@ -123,7 +123,7 @@
 	struct video_device *dev = video_devdata(file);
 	struct pcm20_device *pcm20 = dev->priv;
 	int i;
-	
+
 	switch(cmd)
 	{
 		case VIDIOCGCAP:
@@ -139,7 +139,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=87*16000;
 			v->rangehigh=108*16000;
@@ -172,7 +172,7 @@
 			return i;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags=VIDEO_AUDIO_MUTABLE;
@@ -183,12 +183,12 @@
 				v->mode|=VIDEO_SOUND_MONO;
 			/* v->step=2048; */
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
 
 			pcm20_mute(pcm20, !!(v->flags&VIDEO_AUDIO_MUTE));
@@ -237,7 +237,7 @@
 {
 	if(video_register_device(&pcm20_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 		goto video_register_device;
-		
+
 	if(attach_aci_rds()<0)
 		goto attach_aci_rds;
 
diff --git a/drivers/media/radio/miropcm20-rds-core.c b/drivers/media/radio/miropcm20-rds-core.c
index b602c73..dfb8252 100644
--- a/drivers/media/radio/miropcm20-rds-core.c
+++ b/drivers/media/radio/miropcm20-rds-core.c
@@ -33,24 +33,24 @@
 #define RDS_BUSYMASK        0x10   /* Bit 4 */
 #define RDS_CLOCKMASK       0x08   /* Bit 3 */
 
-#define RDS_DATA(x)         (((x) >> RDS_DATASHIFT) & 1) 
+#define RDS_DATA(x)         (((x) >> RDS_DATASHIFT) & 1)
 
 
 #if DEBUG
 static void print_matrix(char array[], unsigned int length)
 {
-        int i, j;
+	int i, j;
 
-        for (i=0; i<length; i++) {
-                printk(KERN_DEBUG "aci-rds: ");
-                for (j=7; j>=0; j--) {
-                        printk("%d", (array[i] >> j) & 0x1);
-                }
-                if (i%8 == 0)
-                        printk(" byte-border\n");
-                else
-                        printk("\n");
-        }
+	for (i=0; i<length; i++) {
+		printk(KERN_DEBUG "aci-rds: ");
+		for (j=7; j>=0; j--) {
+			printk("%d", (array[i] >> j) & 0x1);
+		}
+		if (i%8 == 0)
+			printk(" byte-border\n");
+		else
+			printk("\n");
+	}
 }
 #endif /* DEBUG */
 
@@ -114,7 +114,7 @@
 {
 	unsigned char sendbuffer[8];
 	int i;
-	
+
 	if (byte2trans(cmd, sendbuffer, 8) != 0){
 		return -1;
 	} else {
@@ -151,7 +151,7 @@
 	   I have to waitread() here */
 	if (rds_waitread() < 0)
 		return -1;
-	
+
 	memset(databuffer, 0, datasize);
 
 	for (i=0; i< READSIZE; i++)
@@ -194,7 +194,7 @@
 		ret = 0;
 
 	mutex_unlock(&aci_rds_mutex);
-	
+
 	return ret;
 }
 EXPORT_SYMBOL(aci_rds_cmd);
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c
index e092140..87b37b7 100644
--- a/drivers/media/radio/miropcm20-rds.c
+++ b/drivers/media/radio/miropcm20-rds.c
@@ -48,7 +48,7 @@
 
 static void print_matrix(char *ch, char out[])
 {
-        int j;
+	int j;
 
 	for (j=7; j>=0; j--) {
 		 out[7-j] = ((*ch >> j) & 0x1) + '0';
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
index 557fb5c..36119d7 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -24,7 +24,7 @@
  *   out(port, start_increasing_volume);
  *   wait(a_wee_while);
  *   out(port, stop_changing_the_volume);
- *  
+ *
  */
 
 #include <linux/module.h>	/* Modules 			*/
@@ -41,7 +41,7 @@
 #define CONFIG_RADIO_RTRACK_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_RTRACK_PORT; 
+static int io = CONFIG_RADIO_RTRACK_PORT;
 static int radio_nr = -1;
 static struct mutex lock;
 
@@ -93,12 +93,12 @@
 	int i;
 
 	mutex_lock(&lock);
-	
+
 	if(vol == dev->curvol) {	/* requested volume = current */
 		if (dev->muted) {	/* user is unmuting the card  */
 			dev->muted = 0;
 			outb (0xd8, io);	/* enable card */
-		}	
+		}
 		mutex_unlock(&lock);
 		return 0;
 	}
@@ -114,10 +114,10 @@
 
 	dev->muted = 0;
 	if(vol > dev->curvol)
-		for(i = dev->curvol; i < vol; i++) 
+		for(i = dev->curvol; i < vol; i++)
 			rt_incvol();
 	else
-		for(i = dev->curvol; i > vol; i--) 
+		for(i = dev->curvol; i > vol; i--)
 			rt_decvol();
 
 	dev->curvol = vol;
@@ -125,7 +125,7 @@
 	return 0;
 }
 
-/* the 128+64 on these outb's is to keep the volume stable while tuning 
+/* the 128+64 on these outb's is to keep the volume stable while tuning
  * without them, the volume _will_ creep up with each frequency change
  * and bit 4 (+16) is to keep the signal strength meter enabled
  */
@@ -140,7 +140,7 @@
 		outb_p(128+64+16+8+  1, port);  /* on + wr-enable + data low */
 		outb_p(128+64+16+8+2+1, port);  /* clock */
 	}
-	sleep_delay(1000); 
+	sleep_delay(1000);
 }
 
 static void send_1_byte(int port, struct rt_device *dev)
@@ -148,13 +148,13 @@
 	if ((dev->curvol == 0) || (dev->muted)) {
 		outb_p(128+64+16+4  +1, port);   /* wr-enable+data high */
 		outb_p(128+64+16+4+2+1, port);   /* clock */
-	} 
+	}
 	else {
 		outb_p(128+64+16+8+4  +1, port); /* on+wr-enable+data high */
 		outb_p(128+64+16+8+4+2+1, port); /* clock */
 	}
 
-	sleep_delay(1000); 
+	sleep_delay(1000);
 }
 
 static int rt_setfreq(struct rt_device *dev, unsigned long freq)
@@ -167,9 +167,9 @@
 
 	freq += 171200;			/* Add 10.7 MHz IF 		*/
 	freq /= 800;			/* Convert to 50 kHz units	*/
-	
+
 	mutex_lock(&lock);			/* Stop other ops interfering */
-	 
+
 	send_0_byte (io, dev);		/*  0: LSB of frequency		*/
 
 	for (i = 0; i < 13; i++)	/*   : frequency bits (1-13)	*/
@@ -195,7 +195,7 @@
 		outb (0xd0, io);	/* volume steady + sigstr */
 	else
 		outb (0xd8, io);	/* volume steady + sigstr + on */
-		
+
 	mutex_unlock(&lock);
 
 	return 0;
@@ -213,7 +213,7 @@
 {
 	struct video_device *dev = video_devdata(file);
 	struct rt_device *rt=dev->priv;
-	
+
 	switch(cmd)
 	{
 		case VIDIOCGCAP:
@@ -229,7 +229,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=(87*16000);
 			v->rangehigh=(108*16000);
@@ -261,21 +261,21 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
 			v->volume=rt->curvol * 6554;
 			v->step=6554;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				rt_mute(rt);
 			else
 				rt_setvol(rt,v->volume/6554);
@@ -298,7 +298,7 @@
 	.owner		= THIS_MODULE,
 	.open           = video_exclusive_open,
 	.release        = video_exclusive_release,
-	.ioctl	        = rt_ioctl,
+	.ioctl		= rt_ioctl,
 	.compat_ioctl	= v4l_compat_ioctl32,
 	.llseek         = no_llseek,
 };
@@ -320,14 +320,14 @@
 		return -EINVAL;
 	}
 
-	if (!request_region(io, 2, "rtrack")) 
+	if (!request_region(io, 2, "rtrack"))
 	{
 		printk(KERN_ERR "rtrack: port 0x%x already in use\n", io);
 		return -EBUSY;
 	}
 
 	rtrack_radio.priv=&rtrack_unit;
-	
+
 	if(video_register_device(&rtrack_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 	{
 		release_region(io, 2);
@@ -336,10 +336,10 @@
 	printk(KERN_INFO "AIMSlab RadioTrack/RadioReveal card driver.\n");
 
 	/* Set up the I/O locking */
-	
+
 	mutex_init(&lock);
-	
- 	/* mute card - prevents noisy bootups */
+
+	/* mute card - prevents noisy bootups */
 
 	/* this ensures that the volume is all the way down  */
 	outb(0x48, io);		/* volume down but still "on"	*/
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c
index 83bdae2..ca67624 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -1,11 +1,11 @@
-/* radio-aztech.c - Aztech radio card driver for Linux 2.2 
+/* radio-aztech.c - Aztech radio card driver for Linux 2.2
  *
- * Adapted to support the Video for Linux API by 
+ * Adapted to support the Video for Linux API by
  * Russell Kroll <rkroll@exploits.org>.  Based on original tuner code by:
  *
  * Quay Ly
  * Donald Song
- * Jason Lewis      (jlewis@twilight.vtc.vsc.edu) 
+ * Jason Lewis      (jlewis@twilight.vtc.vsc.edu)
  * Scott McGrath    (smcgrath@twilight.vtc.vsc.edu)
  * William McGrath  (wmcgrath@twilight.vtc.vsc.edu)
  *
@@ -39,7 +39,7 @@
 #define CONFIG_RADIO_AZTECH_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_AZTECH_PORT; 
+static int io = CONFIG_RADIO_AZTECH_PORT;
 static int radio_nr = -1;
 static int radio_wait_time = 1000;
 static struct mutex lock;
@@ -53,15 +53,15 @@
 
 static int volconvert(int level)
 {
-	level>>=14;	 	/* Map 16bits down to 2 bit */
- 	level&=3;
-	
+	level>>=14;		/* Map 16bits down to 2 bit */
+	level&=3;
+
 	/* convert to card-friendly values */
-	switch (level) 
+	switch (level)
 	{
-		case 0: 
+		case 0:
 			return 0;
-		case 1: 
+		case 1:
 			return 1;
 		case 2:
 			return 4;
@@ -121,9 +121,9 @@
 
 	frequency += 171200;		/* Add 10.7 MHz IF		*/
 	frequency /= 800;		/* Convert to 50 kHz units	*/
-					
+
 	mutex_lock(&lock);
-	
+
 	send_0_byte (dev);		/*  0: LSB of frequency       */
 
 	for (i = 0; i < 13; i++)	/*   : frequency bits (1-13)  */
@@ -151,7 +151,7 @@
 
 	udelay (radio_wait_time);
 	outb_p(128+64+volconvert(dev->curvol), io);
-	
+
 	mutex_unlock(&lock);
 
 	return 0;
@@ -162,7 +162,7 @@
 {
 	struct video_device *dev = video_devdata(file);
 	struct az_device *az = dev->priv;
-	
+
 	switch(cmd)
 	{
 		case VIDIOCGCAP:
@@ -178,7 +178,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=(87*16000);
 			v->rangehigh=(108*16000);
@@ -211,7 +211,7 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
@@ -222,17 +222,17 @@
 			v->volume=az->curvol;
 			v->step=16384;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
 			az->curvol=v->volume;
 
 			az->stereo=(v->mode&VIDEO_SOUND_STEREO)?1:0;
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				az_setvol(az,0);
 			else
 				az_setvol(az,az->curvol);
@@ -277,7 +277,7 @@
 		return -EINVAL;
 	}
 
-	if (!request_region(io, 2, "aztech")) 
+	if (!request_region(io, 2, "aztech"))
 	{
 		printk(KERN_ERR "aztech: port 0x%x already in use\n", io);
 		return -EBUSY;
@@ -285,13 +285,13 @@
 
 	mutex_init(&lock);
 	aztech_radio.priv=&aztech_unit;
-	
+
 	if(video_register_device(&aztech_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 	{
 		release_region(io,2);
 		return -EINVAL;
 	}
-		
+
 	printk(KERN_INFO "Aztech radio card driver v1.00/19990224 rkroll@exploits.org\n");
 	/* mute card - prevents noisy bootups */
 	outb (0, io);
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index f1b5ac8..c048454 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -8,7 +8,7 @@
  * Russell Kroll    (rkroll@exploits.org)
  * Quay Ly
  * Donald Song
- * Jason Lewis      (jlewis@twilight.vtc.vsc.edu) 
+ * Jason Lewis      (jlewis@twilight.vtc.vsc.edu)
  * Scott McGrath    (smcgrath@twilight.vtc.vsc.edu)
  * William McGrath  (wmcgrath@twilight.vtc.vsc.edu)
  *
@@ -55,29 +55,29 @@
 
 /*
  * Signal Strength Threshold Values
- * The V4L API spec does not define any particular unit for the signal 
+ * The V4L API spec does not define any particular unit for the signal
  * strength value.  These values are in microvolts of RF at the tuner's input.
  */
 static __u16 sigtable[2][4]={{5,10,30,150},{28,40,63,1000}};
 
 static int cadet_getrds(void)
 {
-        int rdsstat=0;
+	int rdsstat=0;
 
 	spin_lock(&cadet_io_lock);
-        outb(3,io);                 /* Select Decoder Control/Status */
+	outb(3,io);                 /* Select Decoder Control/Status */
 	outb(inb(io+1)&0x7f,io+1);  /* Reset RDS detection */
 	spin_unlock(&cadet_io_lock);
-	
+
 	msleep(100);
 
-	spin_lock(&cadet_io_lock);	
-        outb(3,io);                 /* Select Decoder Control/Status */
+	spin_lock(&cadet_io_lock);
+	outb(3,io);                 /* Select Decoder Control/Status */
 	if((inb(io+1)&0x80)!=0) {
-	        rdsstat|=VIDEO_TUNER_RDS_ON;
+		rdsstat|=VIDEO_TUNER_RDS_ON;
 	}
 	if((inb(io+1)&0x10)!=0) {
-	        rdsstat|=VIDEO_TUNER_MBS_ON;
+		rdsstat|=VIDEO_TUNER_MBS_ON;
 	}
 	spin_unlock(&cadet_io_lock);
 	return rdsstat;
@@ -86,49 +86,49 @@
 static int cadet_getstereo(void)
 {
 	int ret = 0;
-        if(curtuner != 0)	/* Only FM has stereo capability! */
-	        return 0;
+	if(curtuner != 0)	/* Only FM has stereo capability! */
+		return 0;
 
 	spin_lock(&cadet_io_lock);
-        outb(7,io);          /* Select tuner control */
+	outb(7,io);          /* Select tuner control */
 	if( (inb(io+1) & 0x40) == 0)
-        	ret = 1;
-        spin_unlock(&cadet_io_lock);
-        return ret;
+		ret = 1;
+	spin_unlock(&cadet_io_lock);
+	return ret;
 }
 
 static unsigned cadet_gettune(void)
 {
-        int curvol,i;
+	int curvol,i;
 	unsigned fifo=0;
 
-        /*
-         * Prepare for read
-         */
+	/*
+	 * Prepare for read
+	 */
 
 	spin_lock(&cadet_io_lock);
-	
-        outb(7,io);       /* Select tuner control */
-        curvol=inb(io+1); /* Save current volume/mute setting */
-        outb(0x00,io+1);  /* Ensure WRITE-ENABLE is LOW */
+
+	outb(7,io);       /* Select tuner control */
+	curvol=inb(io+1); /* Save current volume/mute setting */
+	outb(0x00,io+1);  /* Ensure WRITE-ENABLE is LOW */
 	tunestat=0xffff;
 
-        /*
-         * Read the shift register
-         */
-        for(i=0;i<25;i++) {
-                fifo=(fifo<<1)|((inb(io+1)>>7)&0x01);
-                if(i<24) {
-                        outb(0x01,io+1);
+	/*
+	 * Read the shift register
+	 */
+	for(i=0;i<25;i++) {
+		fifo=(fifo<<1)|((inb(io+1)>>7)&0x01);
+		if(i<24) {
+			outb(0x01,io+1);
 			tunestat&=inb(io+1);
-                        outb(0x00,io+1);
-                }
-        }
+			outb(0x00,io+1);
+		}
+	}
 
-        /*
-         * Restore volume/mute setting
-         */
-        outb(curvol,io+1);
+	/*
+	 * Restore volume/mute setting
+	 */
+	outb(curvol,io+1);
 	spin_unlock(&cadet_io_lock);
 
 	return fifo;
@@ -136,43 +136,43 @@
 
 static unsigned cadet_getfreq(void)
 {
-        int i;
-        unsigned freq=0,test,fifo=0;
+	int i;
+	unsigned freq=0,test,fifo=0;
 
 	/*
 	 * Read current tuning
 	 */
 	fifo=cadet_gettune();
 
-        /*
-         * Convert to actual frequency
-         */
+	/*
+	 * Convert to actual frequency
+	 */
 	if(curtuner==0) {    /* FM */
-	        test=12500;
-                for(i=0;i<14;i++) {
-                        if((fifo&0x01)!=0) {
-                                freq+=test;
-                        }
-                        test=test<<1;
-                        fifo=fifo>>1;
-                }
-                freq-=10700000;           /* IF frequency is 10.7 MHz */
-                freq=(freq*16)/1000000;   /* Make it 1/16 MHz */
+		test=12500;
+		for(i=0;i<14;i++) {
+			if((fifo&0x01)!=0) {
+				freq+=test;
+			}
+			test=test<<1;
+			fifo=fifo>>1;
+		}
+		freq-=10700000;           /* IF frequency is 10.7 MHz */
+		freq=(freq*16)/1000000;   /* Make it 1/16 MHz */
 	}
 	if(curtuner==1) {    /* AM */
-	        freq=((fifo&0x7fff)-2010)*16;
+		freq=((fifo&0x7fff)-2010)*16;
 	}
 
-        return freq;
+	return freq;
 }
 
 static void cadet_settune(unsigned fifo)
 {
-        int i;
-	unsigned test;  
+	int i;
+	unsigned test;
 
 	spin_lock(&cadet_io_lock);
-	
+
 	outb(7,io);                /* Select tuner control */
 	/*
 	 * Write the shift register
@@ -183,7 +183,7 @@
 	outb(7,io);                /* Select tuner control */
 	outb(test,io+1);           /* Initialize for write */
 	for(i=0;i<25;i++) {
-   	        test|=0x01;              /* Toggle SCK High */
+		test|=0x01;              /* Toggle SCK High */
 		outb(test,io+1);
 		test&=0xfe;              /* Toggle SCK Low */
 		outb(test,io+1);
@@ -196,57 +196,57 @@
 
 static void cadet_setfreq(unsigned freq)
 {
-        unsigned fifo;
-        int i,j,test;
-        int curvol;
+	unsigned fifo;
+	int i,j,test;
+	int curvol;
 
-        /* 
-         * Formulate a fifo command
-         */
+	/*
+	 * Formulate a fifo command
+	 */
 	fifo=0;
 	if(curtuner==0) {    /* FM */
-        	test=102400;
-                freq=(freq*1000)/16;       /* Make it kHz */
-                freq+=10700;               /* IF is 10700 kHz */
-                for(i=0;i<14;i++) {
-                        fifo=fifo<<1;
-                        if(freq>=test) {
-                                fifo|=0x01;
-                                freq-=test;
-                        }
-                        test=test>>1;
-                }
+		test=102400;
+		freq=(freq*1000)/16;       /* Make it kHz */
+		freq+=10700;               /* IF is 10700 kHz */
+		for(i=0;i<14;i++) {
+			fifo=fifo<<1;
+			if(freq>=test) {
+				fifo|=0x01;
+				freq-=test;
+			}
+			test=test>>1;
+		}
 	}
 	if(curtuner==1) {    /* AM */
-                fifo=(freq/16)+2010;            /* Make it kHz */
+		fifo=(freq/16)+2010;            /* Make it kHz */
 		fifo|=0x100000;            /* Select AM Band */
 	}
 
-        /*
-         * Save current volume/mute setting
-         */
+	/*
+	 * Save current volume/mute setting
+	 */
 
 	spin_lock(&cadet_io_lock);
 	outb(7,io);                /* Select tuner control */
-        curvol=inb(io+1); 
-        spin_unlock(&cadet_io_lock);
+	curvol=inb(io+1);
+	spin_unlock(&cadet_io_lock);
 
 	/*
 	 * Tune the card
 	 */
 	for(j=3;j>-1;j--) {
-	        cadet_settune(fifo|(j<<16));
-	        
-	        spin_lock(&cadet_io_lock);
+		cadet_settune(fifo|(j<<16));
+
+		spin_lock(&cadet_io_lock);
 		outb(7,io);         /* Select tuner control */
 		outb(curvol,io+1);
 		spin_unlock(&cadet_io_lock);
-		
+
 		msleep(100);
 
 		cadet_gettune();
 		if((tunestat & 0x40) == 0) {   /* Tuned */
-		        sigstrength=sigtable[curtuner][j];
+			sigstrength=sigtable[curtuner][j];
 			return;
 		}
 	}
@@ -257,28 +257,28 @@
 static int cadet_getvol(void)
 {
 	int ret = 0;
-	
+
 	spin_lock(&cadet_io_lock);
-	
-        outb(7,io);                /* Select tuner control */
-        if((inb(io + 1) & 0x20) != 0)
-        	ret = 0xffff;
-        
-        spin_unlock(&cadet_io_lock);
-        return ret;
+
+	outb(7,io);                /* Select tuner control */
+	if((inb(io + 1) & 0x20) != 0)
+		ret = 0xffff;
+
+	spin_unlock(&cadet_io_lock);
+	return ret;
 }
 
 
 static void cadet_setvol(int vol)
 {
 	spin_lock(&cadet_io_lock);
-        outb(7,io);                /* Select tuner control */
-        if(vol>0)
-                outb(0x20,io+1);
-        else
-                outb(0x00,io+1);
+	outb(7,io);                /* Select tuner control */
+	if(vol>0)
+		outb(0x20,io+1);
+	else
+		outb(0x00,io+1);
 	spin_unlock(&cadet_io_lock);
-}  
+}
 
 static void cadet_handler(unsigned long data)
 {
@@ -288,15 +288,15 @@
 
 	if(spin_trylock(&cadet_io_lock))
 	{
-	        outb(0x3,io);       /* Select RDS Decoder Control */
+		outb(0x3,io);       /* Select RDS Decoder Control */
 		if((inb(io+1)&0x20)!=0) {
-		        printk(KERN_CRIT "cadet: RDS fifo overflow\n");
+			printk(KERN_CRIT "cadet: RDS fifo overflow\n");
 		}
 		outb(0x80,io);      /* Select RDS fifo */
 		while((inb(io)&0x80)!=0) {
-		        rdsbuf[rdsin]=inb(io+1);
+			rdsbuf[rdsin]=inb(io+1);
 			if(rdsin==rdsout)
-			        printk(KERN_WARNING "cadet: RDS buffer overflow\n");
+				printk(KERN_WARNING "cadet: RDS buffer overflow\n");
 			else
 				rdsin++;
 		}
@@ -307,9 +307,9 @@
 	 * Service pending read
 	 */
 	if( rdsin!=rdsout)
-	        wake_up_interruptible(&read_queue);
+		wake_up_interruptible(&read_queue);
 
-	/* 
+	/*
 	 * Clean up and exit
 	 */
 	init_timer(&readtimer);
@@ -324,12 +324,12 @@
 static ssize_t cadet_read(struct file *file, char __user *data,
 			  size_t count, loff_t *ppos)
 {
-        int i=0;
+	int i=0;
 	unsigned char readbuf[RDS_BUFFER];
 
-        if(rdsstat==0) {
+	if(rdsstat==0) {
 		spin_lock(&cadet_io_lock);
-	        rdsstat=1;
+		rdsstat=1;
 		outb(0x80,io);        /* Select RDS fifo */
 		spin_unlock(&cadet_io_lock);
 		init_timer(&readtimer);
@@ -339,15 +339,15 @@
 		add_timer(&readtimer);
 	}
 	if(rdsin==rdsout) {
-  	        if (file->f_flags & O_NONBLOCK)
-		        return -EWOULDBLOCK;
-	        interruptible_sleep_on(&read_queue);
-	}		
+		if (file->f_flags & O_NONBLOCK)
+			return -EWOULDBLOCK;
+		interruptible_sleep_on(&read_queue);
+	}
 	while( i<count && rdsin!=rdsout)
-	        readbuf[i++]=rdsbuf[rdsout++];
+		readbuf[i++]=rdsbuf[rdsout++];
 
 	if (copy_to_user(data,readbuf,i))
-	        return -EFAULT;
+		return -EFAULT;
 	return i;
 }
 
@@ -375,29 +375,29 @@
 				return -EINVAL;
 			}
 			switch(v->tuner) {
-			        case 0:
-			        strcpy(v->name,"FM");
-			        v->rangelow=1400;     /* 87.5 MHz */
-			        v->rangehigh=1728;    /* 108.0 MHz */
-			        v->flags=0;
-			        v->mode=0;
-			        v->mode|=VIDEO_MODE_AUTO;
-			        v->signal=sigstrength;
-			        if(cadet_getstereo()==1) {
-				        v->flags|=VIDEO_TUNER_STEREO_ON;
-			        }
+				case 0:
+				strcpy(v->name,"FM");
+				v->rangelow=1400;     /* 87.5 MHz */
+				v->rangehigh=1728;    /* 108.0 MHz */
+				v->flags=0;
+				v->mode=0;
+				v->mode|=VIDEO_MODE_AUTO;
+				v->signal=sigstrength;
+				if(cadet_getstereo()==1) {
+					v->flags|=VIDEO_TUNER_STEREO_ON;
+				}
 				v->flags|=cadet_getrds();
-			        break;
-			        case 1:
-			        strcpy(v->name,"AM");
-			        v->rangelow=8320;      /* 520 kHz */
-			        v->rangehigh=26400;    /* 1650 kHz */
-			        v->flags=0;
-			        v->flags|=VIDEO_TUNER_LOW;
-			        v->mode=0;
-			        v->mode|=VIDEO_MODE_AUTO;
-			        v->signal=sigstrength;
-			        break;
+				break;
+				case 1:
+				strcpy(v->name,"AM");
+				v->rangelow=8320;      /* 520 kHz */
+				v->rangehigh=26400;    /* 1650 kHz */
+				v->flags=0;
+				v->flags|=VIDEO_TUNER_LOW;
+				v->mode=0;
+				v->mode|=VIDEO_MODE_AUTO;
+				v->signal=sigstrength;
+				break;
 			}
 			return 0;
 		}
@@ -407,49 +407,49 @@
 			if((v->tuner<0)||(v->tuner>1)) {
 				return -EINVAL;
 			}
-			curtuner=v->tuner;	
+			curtuner=v->tuner;
 			return 0;
 		}
 		case VIDIOCGFREQ:
 		{
-		        unsigned long *freq = arg;
+			unsigned long *freq = arg;
 			*freq = cadet_getfreq();
 			return 0;
 		}
 		case VIDIOCSFREQ:
 		{
-		        unsigned long *freq = arg;
+			unsigned long *freq = arg;
 			if((curtuner==0)&&((*freq<1400)||(*freq>1728))) {
-			        return -EINVAL;
+				return -EINVAL;
 			}
 			if((curtuner==1)&&((*freq<8320)||(*freq>26400))) {
-			        return -EINVAL;
+				return -EINVAL;
 			}
 			cadet_setfreq(*freq);
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
 			if(cadet_getstereo()==0) {
-			        v->mode=VIDEO_SOUND_MONO;
+				v->mode=VIDEO_SOUND_MONO;
 			} else {
 				v->mode=VIDEO_SOUND_STEREO;
 			}
 			v->volume=cadet_getvol();
 			v->step=0xffff;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
 			cadet_setvol(v->volume);
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				cadet_setvol(0);
 			else
 				cadet_setvol(0xffff);
@@ -539,16 +539,16 @@
 
 static int cadet_probe(void)
 {
-        static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
+	static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};
 	int i;
 
 	for(i=0;i<8;i++) {
-	        io=iovals[i];
+		io=iovals[i];
 		if (request_region(io, 2, "cadet-probe")) {
-		        cadet_setfreq(1410);
+			cadet_setfreq(1410);
 			if(cadet_getfreq()==1410) {
 				release_region(io, 2);
-			        return io;
+				return io;
 			}
 			release_region(io, 2);
 		}
@@ -556,7 +556,7 @@
 	return -1;
 }
 
-/* 
+/*
  * io should only be set if the user has used something like
  * isapnp (the userspace program) to initialize this card for us
  */
@@ -564,7 +564,7 @@
 static int __init cadet_init(void)
 {
 	spin_lock_init(&cadet_io_lock);
-	
+
 	/*
 	 *	If a probe was requested then probe ISAPnP first (safest)
 	 */
@@ -579,12 +579,12 @@
 	/*
 	 *	Else we bail out
 	 */
-	 
-        if(io < 0) {
-#ifdef MODULE        
+
+	if(io < 0) {
+#ifdef MODULE
 		printk(KERN_ERR "You must set an I/O address with io=0x???\n");
 #endif
-	        goto fail;
+		goto fail;
 	}
 	if (!request_region(io,2,"cadet"))
 		goto fail;
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index 8e499b8..d5c3c4b 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -1,6 +1,6 @@
 /*
  ***************************************************************************
- *     
+ *
  *     radio-gemtek-pci.c - Gemtek PCI Radio driver
  *     (C) 2001 Vladimir Shebordaev <vshebordaev@mail.ru>
  *
@@ -31,7 +31,7 @@
  *     radio device driver.
  *
  *     Please, let me know if this piece of code was useful :)
- * 
+ *
  *     TODO: multiple device support and portability were not tested
  *
  ***************************************************************************
@@ -69,18 +69,18 @@
 #define TRUE (1)
 #endif
 
-#ifndef FALSE 
+#ifndef FALSE
 #define FALSE (0)
 #endif
 
 struct gemtek_pci_card {
 	struct video_device *videodev;
-	
+
 	u32 iobase;
 	u32 length;
 	u8  chiprev;
 	u16 model;
-	
+
 	u32 current_frequency;
 	u8  mute;
 };
@@ -96,7 +96,7 @@
 	return (u8)value;
 }
 
-#define _b0( v ) *((u8 *)&v)  
+#define _b0( v ) *((u8 *)&v)
 static void __gemtek_pci_cmd( u16 value, u32 port, u8 *last_byte, int keep )
 {
 	register u8 byte = *last_byte;
@@ -104,7 +104,7 @@
 	if ( !value ) {
 		if ( !keep )
 			value = (u16)port;
-		byte &= 0xfd;	
+		byte &= 0xfd;
 	} else
 		byte |= 2;
 
@@ -116,7 +116,7 @@
 	byte &= 0xfe;
 	_b0( value ) = byte;
 	outw( value, port );
-	
+
 	*last_byte = byte;
 }
 
@@ -193,13 +193,13 @@
 			c->audios = 1;
 			strcpy( c->name, "Gemtek PCI Radio" );
 			return 0;
-		} 
+		}
 
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *t = arg;
 
-			if ( t->tuner ) 
+			if ( t->tuner )
 				return -EINVAL;
 
 			t->rangelow = GEMTEK_PCI_RANGE_LOW;
@@ -228,7 +228,7 @@
 		case VIDIOCSFREQ:
 		{
 			unsigned long *freq = arg;
-	 
+
 			if ( (*freq < GEMTEK_PCI_RANGE_LOW) ||
 			     (*freq > GEMTEK_PCI_RANGE_HIGH) )
 				return -EINVAL;
@@ -239,9 +239,9 @@
 
 			return 0;
 		}
-  
+
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *a = arg;
 
 			memset( a, 0, sizeof( *a ) );
@@ -249,17 +249,17 @@
 			a->volume = 1;
 			a->step = 65535;
 			strcpy( a->name, "Radio" );
-			return 0;			
+			return 0;
 		}
 
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *a = arg;
 
-			if ( a->audio ) 
+			if ( a->audio )
 				return -EINVAL;
 
-			if ( a->flags & VIDEO_AUDIO_MUTE ) 
+			if ( a->flags & VIDEO_AUDIO_MUTE )
 				gemtek_pci_mute( card );
 			else
 				gemtek_pci_unmute( card );
@@ -323,9 +323,9 @@
 		return -ENOMEM;
 	}
 
-	if ( pci_enable_device( pci_dev ) ) 
+	if ( pci_enable_device( pci_dev ) )
 		goto err_pci;
-	
+
 	card->iobase = pci_resource_start( pci_dev, 0 );
 	card->length = pci_resource_len( pci_dev, 0 );
 
@@ -338,7 +338,7 @@
 	pci_read_config_word( pci_dev, PCI_SUBSYSTEM_ID, &card->model );
 
 	pci_set_drvdata( pci_dev, card );
- 
+
 	if ( (devradio = kmalloc( sizeof( struct video_device ), GFP_KERNEL )) == NULL ) {
 		printk( KERN_ERR "gemtek_pci: out of memory\n" );
 		goto err_video;
@@ -354,7 +354,7 @@
 	devradio->priv = card;
 	gemtek_pci_mute( card );
 
-	printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", 
+	printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n",
 		card->chiprev, card->iobase, card->iobase + card->length - 1 );
 
 	return 0;
@@ -364,7 +364,7 @@
 
 err_pci:
 	kfree( card );
-	return -ENODEV;        
+	return -ENODEV;
 }
 
 static void __devexit gemtek_pci_remove( struct pci_dev *pci_dev )
@@ -375,12 +375,12 @@
 	kfree( card->videodev );
 
 	release_region( card->iobase, card->length );
-	
+
 	if ( mx )
 		gemtek_pci_mute( card );
 
 	kfree( card );
-	
+
 	pci_set_drvdata( pci_dev, NULL );
 }
 
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 47173be..77a1e12 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -6,7 +6,7 @@
  * Besides the protocol changes, this is mostly a copy of:
  *
  *    RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
- * 
+ *
  *    Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
  *    Converted to new API by Alan Cox <Alan.Cox@linux.org>
  *    Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
@@ -29,7 +29,7 @@
 #define CONFIG_RADIO_GEMTEK_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_GEMTEK_PORT; 
+static int io = CONFIG_RADIO_GEMTEK_PORT;
 static int radio_nr = -1;
 static spinlock_t lock;
 
@@ -48,7 +48,7 @@
  */
 static void gemtek_mute(struct gemtek_device *dev)
 {
-        if(dev->muted)
+	if(dev->muted)
 		return;
 	spin_lock(&lock);
 	outb(0x10, io);
@@ -94,20 +94,20 @@
 	freq /= 100000;
 
 	spin_lock(&lock);
-	
+
 	/* 2 start bits */
 	outb_p(0x03, io);
 	udelay(5);
 	outb_p(0x07, io);
 	udelay(5);
 
-        /* 28 frequency bits (lsb first) */
+	/* 28 frequency bits (lsb first) */
 	for (i = 0; i < 14; i++)
 		if (freq & (1 << i))
 			one();
 		else
 			zero();
-        /* 36 unknown bits */
+	/* 36 unknown bits */
 	for (i = 0; i < 11; i++)
 		zero();
 	one();
@@ -123,7 +123,7 @@
 	udelay(5);
 
 	spin_unlock(&lock);
-	
+
 	return 0;
 }
 
@@ -159,7 +159,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=87*16000;
 			v->rangehigh=108*16000;
@@ -193,25 +193,25 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE;
 			v->volume=1;
 			v->step=65535;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
 
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				gemtek_mute(rt);
 			else
-			        gemtek_unmute(rt);
+				gemtek_unmute(rt);
 
 			return 0;
 		}
@@ -254,14 +254,14 @@
 		return -EINVAL;
 	}
 
-	if (!request_region(io, 4, "gemtek")) 
+	if (!request_region(io, 4, "gemtek"))
 	{
 		printk(KERN_ERR "gemtek: port 0x%x already in use\n", io);
 		return -EBUSY;
 	}
 
 	gemtek_radio.priv=&gemtek_unit;
-	
+
 	if(video_register_device(&gemtek_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 	{
 		release_region(io, 4);
@@ -274,7 +274,7 @@
 	/* this is _maybe_ unnecessary */
 	outb(0x01, io);
 
- 	/* mute card - prevents noisy bootups */
+	/* mute card - prevents noisy bootups */
 	gemtek_unit.muted = 0;
 	gemtek_mute(&gemtek_unit);
 
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c
index 39c1d91..2501792 100644
--- a/drivers/media/radio/radio-maestro.c
+++ b/drivers/media/radio/radio-maestro.c
@@ -2,7 +2,7 @@
  * (c) 2000 A. Tlalka, atlka@pg.gda.pl
  * Notes on the hardware
  *
- *  + Frequency control is done digitally 
+ *  + Frequency control is done digitally
  *  + No volume control - only mute/unmute - you have to use Aux line volume
  *  control on Maestro card to set the volume
  *  + Radio status (tuned/not_tuned and stereo/mono) is valid some time after
@@ -103,7 +103,7 @@
 struct radio_device {
 	u16	io,	/* base of Maestro card radio io (GPIO_DATA)*/
 		muted,	/* VIDEO_AUDIO_MUTE */
-		stereo,	/* VIDEO_TUNER_STEREO_ON */	
+		stereo,	/* VIDEO_TUNER_STEREO_ON */
 		tuned;	/* signal strength (0 or 0xffff) */
 	struct mutex lock;
 };
@@ -122,14 +122,14 @@
 	for (l=24;l--;) {
 		outw(STR_CLK, io);		/* HI state */
 		udelay(2);
-		if(!l) 
+		if(!l)
 			dev->tuned = inw(io) & STR_MOST ? 0 : 0xffff;
 		outw(0, io);			/* LO state */
 		udelay(2);
 		data <<= 1;			/* shift data */
 		rdata = inw(io);
 		if(!l)
-			dev->stereo =  rdata & STR_MOST ? 
+			dev->stereo =  rdata & STR_MOST ?
 			0 : VIDEO_TUNER_STEREO_ON;
 		else
 			if(rdata & STR_DATA)
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index f0bf47b..fe25525 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -1,15 +1,15 @@
-/* 
- * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux 
+/*
+ * Guillemot Maxi Radio FM 2000 PCI radio card driver for Linux
  * (C) 2001 Dimitromanolakis Apostolos <apdim@grecian.net>
  *
  * Based in the radio Maestro PCI driver. Actually it uses the same chip
  * for radio but different pci controller.
  *
  * I didn't have any specs I reversed engineered the protocol from
- * the windows driver (radio.dll). 
+ * the windows driver (radio.dll).
  *
  * The card uses the TEA5757 chip that includes a search function but it
- * is useless as I haven't found any way to read back the frequency. If 
+ * is useless as I haven't found any way to read back the frequency. If
  * anybody does please mail me.
  *
  * For the pdf file see:
@@ -24,7 +24,7 @@
  *     - tiding up
  *     - removed support for multiple devices as it didn't work anyway
  *
- * BUGS: 
+ * BUGS:
  *   - card unmutes if you change frequency
  *
  */
@@ -80,7 +80,7 @@
 	.owner		= THIS_MODULE,
 	.open           = video_exclusive_open,
 	.release        = video_exclusive_release,
-	.ioctl	        = radio_ioctl,
+	.ioctl		= radio_ioctl,
 	.compat_ioctl	= v4l_compat_ioctl32,
 	.llseek         = no_llseek,
 };
@@ -97,11 +97,11 @@
 {
 	__u16	io,	/* base of radio io */
 		muted,	/* VIDEO_AUDIO_MUTE */
-		stereo,	/* VIDEO_TUNER_STEREO_ON */	
+		stereo,	/* VIDEO_TUNER_STEREO_ON */
 		tuned;	/* signal strength (0 or 0xffff) */
-		
+
 	unsigned long freq;
-	
+
 	struct mutex lock;
 } radio_unit = {0, 0, 0, 0, };
 
@@ -114,7 +114,7 @@
 			outb(  power|wren|data|clk ,io); udelay(4);
 			outb(  power|wren|data     ,io); udelay(4);
 		}
-	else	
+	else
 		{
 			outb(  power|wren          ,io); udelay(4);
 			outb(  power|wren|clk      ,io); udelay(4);
@@ -132,12 +132,12 @@
 {
 	unsigned long int si;
 	int bl;
-	
+
 	/* TEA5757 shift register bits (see pdf) */
 
-	outbit(0,io); // 24  search 
+	outbit(0,io); // 24  search
 	outbit(1,io); // 23  search up/down
-	
+
 	outbit(0,io); // 22  stereo/mono
 
 	outbit(0,io); // 21  band
@@ -145,24 +145,24 @@
 
 	outbit(0,io); // 19  port ?
 	outbit(0,io); // 18  port ?
-	
+
 	outbit(0,io); // 17  search level
 	outbit(0,io); // 16  search level
- 
+
 	si = 0x8000;
 	for(bl = 1; bl <= 16 ; bl++) { outbit(data & si,io); si >>=1; }
-	
+
 	outb(power,io);
 }
 
 static int get_stereo(__u16 io)
-{	
+{
 	outb(power,io); udelay(4);
 	return !(inb(io) & mo_st);
 }
 
 static int get_tune(__u16 io)
-{	
+{
 	outb(power+clk,io); udelay(4);
 	return !(inb(io) & mo_st);
 }
@@ -177,7 +177,7 @@
 	switch(cmd) {
 		case VIDIOCGCAP: {
 			struct video_capability *v = arg;
-			
+
 			memset(v,0,sizeof(*v));
 			strcpy(v->name, "Maxi Radio FM2000 radio");
 			v->type=VID_TYPE_TUNER;
@@ -186,22 +186,22 @@
 		}
 		case VIDIOCGTUNER: {
 			struct video_tuner *v = arg;
-			
+
 			if(v->tuner)
 				return -EINVAL;
-				
+
 			card->stereo = 0xffff * get_stereo(card->io);
 			card->tuned = 0xffff * get_tune(card->io);
-			
+
 			v->flags = VIDEO_TUNER_LOW | card->stereo;
 			v->signal = card->tuned;
-			
+
 			strcpy(v->name, "FM");
-			
+
 			v->rangelow = FREQ_LO;
 			v->rangehigh = FREQ_HI;
 			v->mode = VIDEO_MODE_AUTO;
-			
+
 			return 0;
 		}
 		case VIDIOCSTUNER: {
@@ -212,13 +212,13 @@
 		}
 		case VIDIOCGFREQ: {
 			unsigned long *freq = arg;
-			
+
 			*freq = card->freq;
 			return 0;
 		}
 		case VIDIOCSFREQ: {
 			unsigned long *freq = arg;
-			
+
 			if (*freq < FREQ_LO || *freq > FREQ_HI)
 				return -EINVAL;
 			card->freq = *freq;
@@ -226,18 +226,18 @@
 			msleep(125);
 			return 0;
 		}
-		case VIDIOCGAUDIO: {	
+		case VIDIOCGAUDIO: {
 			struct video_audio *v = arg;
 			memset(v,0,sizeof(*v));
 			strcpy(v->name, "Radio");
 			v->flags=VIDEO_AUDIO_MUTABLE | card->muted;
 			v->mode=VIDEO_SOUND_STEREO;
-			return 0;		
+			return 0;
 		}
-		
+
 		case VIDIOCSAUDIO: {
 			struct video_audio *v = arg;
-			
+
 			if(v->audio)
 				return -EINVAL;
 			card->muted = v->flags & VIDEO_AUDIO_MUTE;
@@ -249,13 +249,13 @@
 		}
 		case VIDIOCGUNIT: {
 			struct video_unit *v = arg;
-			
+
 			v->video=VIDEO_NO_UNIT;
 			v->vbi=VIDEO_NO_UNIT;
 			v->radio=dev->minor;
 			v->audio=0;
 			v->teletext=VIDEO_NO_UNIT;
-			return 0;		
+			return 0;
 		}
 		default: return -ENOIOCTLCMD;
 	}
@@ -267,7 +267,7 @@
 	struct video_device *dev = video_devdata(file);
 	struct radio_device *card=dev->priv;
 	int ret;
-	
+
 	mutex_lock(&card->lock);
 	ret = video_usercopy(inode, file, cmd, arg, radio_function);
 	mutex_unlock(&card->lock);
@@ -282,21 +282,21 @@
 static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	if(!request_region(pci_resource_start(pdev, 0),
-	                   pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
-	        printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
-	        goto err_out;
+			   pci_resource_len(pdev, 0), "Maxi Radio FM 2000")) {
+		printk(KERN_ERR "radio-maxiradio: can't reserve I/O ports\n");
+		goto err_out;
 	}
 
 	if (pci_enable_device(pdev))
-	        goto err_out_free_region;
+		goto err_out_free_region;
 
 	radio_unit.io = pci_resource_start(pdev, 0);
 	mutex_init(&radio_unit.lock);
 	maxiradio_radio.priv = &radio_unit;
 
 	if(video_register_device(&maxiradio_radio, VFL_TYPE_RADIO, radio_nr)==-1) {
-	        printk("radio-maxiradio: can't register device!");
-	        goto err_out_free_region;
+		printk("radio-maxiradio: can't register device!");
+		goto err_out_free_region;
 	}
 
 	printk(KERN_INFO "radio-maxiradio: version "
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c
index 28a47c9..3821d25 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -1,5 +1,5 @@
 /* RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
- * 
+ *
  * Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
  * Converted to new API by Alan Cox <Alan.Cox@linux.org>
  * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
@@ -22,7 +22,7 @@
 #define CONFIG_RADIO_RTRACK2_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_RTRACK2_PORT; 
+static int io = CONFIG_RADIO_RTRACK2_PORT;
 static int radio_nr = -1;
 static spinlock_t lock;
 
@@ -38,7 +38,7 @@
 
 static void rt_mute(struct rt_device *dev)
 {
-        if(dev->muted)
+	if(dev->muted)
 		return;
 	spin_lock(&lock);
 	outb(1, io);
@@ -58,14 +58,14 @@
 
 static void zero(void)
 {
-        outb_p(1, io);
+	outb_p(1, io);
 	outb_p(3, io);
 	outb_p(1, io);
 }
 
 static void one(void)
 {
-        outb_p(5, io);
+	outb_p(5, io);
 	outb_p(7, io);
 	outb_p(5, io);
 }
@@ -75,7 +75,7 @@
 	int i;
 
 	freq = freq / 200 + 856;
-	
+
 	spin_lock(&lock);
 
 	outb_p(0xc8, io);
@@ -94,7 +94,7 @@
 	outb_p(0xc8, io);
 	if (!dev->muted)
 		outb_p(0, io);
-		
+
 	spin_unlock(&lock);
 	return 0;
 }
@@ -127,7 +127,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=88*16000;
 			v->rangehigh=108*16000;
@@ -159,25 +159,25 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE;
 			v->volume=1;
 			v->step=65535;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
 
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				rt_mute(rt);
 			else
-			        rt_unmute(rt);
+				rt_unmute(rt);
 
 			return 0;
 		}
@@ -219,7 +219,7 @@
 		printk(KERN_ERR "You must set an I/O address with io=0x20c or io=0x30c\n");
 		return -EINVAL;
 	}
-	if (!request_region(io, 4, "rtrack2")) 
+	if (!request_region(io, 4, "rtrack2"))
 	{
 		printk(KERN_ERR "rtrack2: port 0x%x already in use\n", io);
 		return -EBUSY;
@@ -227,16 +227,16 @@
 
 	rtrack2_radio.priv=&rtrack2_unit;
 
-	spin_lock_init(&lock);	
+	spin_lock_init(&lock);
 	if(video_register_device(&rtrack2_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 	{
 		release_region(io, 4);
 		return -EINVAL;
 	}
-		
+
 	printk(KERN_INFO "AIMSlab Radiotrack II card driver.\n");
 
- 	/* mute card - prevents noisy bootups */
+	/* mute card - prevents noisy bootups */
 	outb(1, io);
 	rtrack2_unit.muted = 1;
 
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 53073b4..70cfbc3 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -12,7 +12,7 @@
  *  Frequency control is done digitally -- ie out(port,encodefreq(95.8));
  *  No volume control - only mute/unmute - you have to use line volume
  *  control on SB-part of SF16FMI
- *  
+ *
  */
 
 #include <linux/kernel.h>	/* __setup			*/
@@ -29,19 +29,19 @@
 struct fmi_device
 {
 	int port;
-        int curvol; /* 1 or 0 */
-        unsigned long curfreq; /* freq in kHz */
-        __u32 flags;
+	int curvol; /* 1 or 0 */
+	unsigned long curfreq; /* freq in kHz */
+	__u32 flags;
 };
 
-static int io = -1; 
+static int io = -1;
 static int radio_nr = -1;
 static struct pnp_dev *dev = NULL;
 static struct mutex lock;
 
 /* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
 /* It is only useful to give freq in intervall of 800 (=0.05Mhz),
- * other bits will be truncated, e.g 92.7400016 -> 92.7, but 
+ * other bits will be truncated, e.g 92.7400016 -> 92.7, but
  * 92.7400017 -> 92.75
  */
 #define RSF16_ENCODE(x)	((x)/800+214)
@@ -51,7 +51,7 @@
 static void outbits(int bits, unsigned int data, int port)
 {
 	while(bits--) {
- 		if(data & 1) {
+		if(data & 1) {
 			outb(5, port);
 			udelay(6);
 			outb(7, port);
@@ -101,7 +101,7 @@
 	int res;
 	int myport = dev->port;
 
-	
+
 	mutex_lock(&lock);
 	val = dev->curvol ? 0x08 : 0x00;	/* unmute/mute */
 	outb(val, myport);
@@ -109,7 +109,7 @@
 	msleep(143); 		/* was schedule_timeout(HZ/7) */
 	res = (int)inb(myport+1);
 	outb(val, myport);
-	
+
 	mutex_unlock(&lock);
 	return (res & 2) ? 0 : 0xFFFF;
 }
@@ -119,7 +119,7 @@
 {
 	struct video_device *dev = video_devdata(file);
 	struct fmi_device *fmi=dev->priv;
-	
+
 	switch(cmd)
 	{
 		case VIDIOCGCAP:
@@ -174,18 +174,18 @@
 				return -EINVAL;
 			/*rounding in steps of 800 to match th freq
 			  that will be used */
-			fmi->curfreq = (*freq/800)*800; 
+			fmi->curfreq = (*freq/800)*800;
 			fmi_setfreq(fmi);
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0,sizeof(*v));
 			v->flags=( (!fmi->curvol)*VIDEO_AUDIO_MUTE | VIDEO_AUDIO_MUTABLE);
 			strcpy(v->name, "Radio");
 			v->mode=VIDEO_SOUND_STEREO;
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
@@ -193,19 +193,19 @@
 			if(v->audio)
 				return -EINVAL;
 			fmi->curvol= v->flags&VIDEO_AUDIO_MUTE ? 0 : 1;
-			fmi->curvol ? 
+			fmi->curvol ?
 				fmi_unmute(fmi->port) : fmi_mute(fmi->port);
 			return 0;
 		}
-	        case VIDIOCGUNIT:
+		case VIDIOCGUNIT:
 		{
-               		struct video_unit *v = arg;
+			struct video_unit *v = arg;
 			v->video=VIDEO_NO_UNIT;
 			v->vbi=VIDEO_NO_UNIT;
 			v->radio=dev->minor;
 			v->audio=0; /* How do we find out this??? */
 			v->teletext=VIDEO_NO_UNIT;
-			return 0;			
+			return 0;
 		}
 		default:
 			return -ENOIOCTLCMD;
@@ -295,14 +295,14 @@
 	fmi_unit.curfreq = 0;
 	fmi_unit.flags = VIDEO_TUNER_LOW;
 	fmi_radio.priv = &fmi_unit;
-	
+
 	mutex_init(&lock);
-	
+
 	if (video_register_device(&fmi_radio, VFL_TYPE_RADIO, radio_nr) == -1) {
 		release_region(io, 2);
 		return -EINVAL;
 	}
-		
+
 	printk(KERN_INFO "SF16FMx radio card driver at 0x%x\n", io);
 	/* mute card - prevents noisy bootups */
 	fmi_mute(io);
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index bcebd8c..ca560a4 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -202,7 +202,7 @@
 }
 
 static int fmr2_do_ioctl(struct inode *inode, struct file *file,
-                      unsigned int cmd, void *arg)
+		      unsigned int cmd, void *arg)
 {
 	struct video_device *dev = video_devdata(file);
 	struct fmr2_device *fmr2 = dev->priv;
@@ -344,7 +344,7 @@
 }
 
 static int fmr2_ioctl(struct inode *inode, struct file *file,
-                      unsigned int cmd, unsigned long arg)
+		      unsigned int cmd, unsigned long arg)
  {
 	return video_usercopy(inode, file, cmd, arg, fmr2_do_ioctl);
 }
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c
index fcfde2e..3ac0c36 100644
--- a/drivers/media/radio/radio-terratec.c
+++ b/drivers/media/radio/radio-terratec.c
@@ -2,11 +2,11 @@
  * (c) 1999 R. Offermanns (rolf@offermanns.de)
  * based on the aimslab radio driver from M. Kirkwood
  * many thanks to Michael Becker and Friedhelm Birth (from TerraTec)
- * 
+ *
  *
  * History:
  * 1999-05-21	First preview release
- * 
+ *
  *  Notes on the hardware:
  *  There are two "main" chips on the card:
  *  - Philips OM5610 (http://www-us.semiconductors.philips.com/acrobat/datasheets/OM5610_2.pdf)
@@ -20,7 +20,7 @@
  *  (as soon i have understand how to get started :)
  *  If you can help me out with that, please contact me!!
  *
- *  
+ *
  */
 
 #include <linux/module.h>	/* Modules 			*/
@@ -49,7 +49,7 @@
 #define WRT_EN		0x10
 /*******************************************************************/
 
-static int io = CONFIG_RADIO_TERRATEC_PORT; 
+static int io = CONFIG_RADIO_TERRATEC_PORT;
 static int radio_nr = -1;
 static spinlock_t lock;
 
@@ -88,15 +88,15 @@
 
 static int tt_setvol(struct tt_device *dev, int vol)
 {
-	
+
 //	printk(KERN_ERR "setvol called, vol = %d\n", vol);
 
 	if(vol == dev->curvol) {	/* requested volume = current */
 		if (dev->muted) {	/* user is unmuting the card  */
 			dev->muted = 0;
 			cardWriteVol(vol);	/* enable card */
-		}	
-	
+		}
+
 		return 0;
 	}
 
@@ -107,9 +107,9 @@
 	}
 
 	dev->muted = 0;
-	
+
 	cardWriteVol(vol);
-	 
+
 	dev->curvol = vol;
 
 	return 0;
@@ -121,13 +121,13 @@
 /* many more or less strange things are going on here, but hey, it works :) */
 
 static int tt_setfreq(struct tt_device *dev, unsigned long freq1)
-{	
+{
 	int freq;
 	int i;
 	int p;
 	int  temp;
 	long rest;
-     
+
 	unsigned char buffer[25];		/* we have to bit shift 25 registers */
 	freq = freq1/160;			/* convert the freq. to a nice to handle value */
 	for(i=24;i>-1;i--)
@@ -142,9 +142,9 @@
 	{
 		if (rest%temp  == rest)
 			buffer[i] = 0;
-		else 
+		else
 		{
-			buffer[i] = 1; 
+			buffer[i] = 1;
 			rest = rest-temp;
 		}
 		i--;
@@ -153,10 +153,10 @@
        }
 
 	spin_lock(&lock);
-	
+
 	for (i=24;i>-1;i--)			/* bit shift the values to the radiocard */
 	{
-		if (buffer[i]==1) 
+		if (buffer[i]==1)
 		{
 			outb(WRT_EN|DATA, BASEPORT);
 			outb(WRT_EN|DATA|CLK_ON  , BASEPORT);
@@ -168,11 +168,11 @@
 			outb(WRT_EN|0x00|CLK_ON  , BASEPORT);
 		}
 	}
-	outb(0x00, BASEPORT);     
-	
+	outb(0x00, BASEPORT);
+
 	spin_unlock(&lock);
-  
-  	return 0;
+
+	return 0;
 }
 
 static int tt_getsigstr(struct tt_device *dev)		/* TODO */
@@ -190,7 +190,7 @@
 {
 	struct video_device *dev = video_devdata(file);
 	struct tt_device *tt=dev->priv;
-	
+
 	switch(cmd)
 	{
 		case VIDIOCGCAP:
@@ -206,7 +206,7 @@
 		case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 			v->rangelow=(87*16000);
 			v->rangehigh=(108*16000);
@@ -238,21 +238,21 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 			memset(v,0, sizeof(*v));
 			v->flags|=VIDEO_AUDIO_MUTABLE|VIDEO_AUDIO_VOLUME;
 			v->volume=tt->curvol * 6554;
 			v->step=6554;
 			strcpy(v->name, "Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
-			if(v->flags&VIDEO_AUDIO_MUTE) 
+			if(v->flags&VIDEO_AUDIO_MUTE)
 				tt_mute(tt);
 			else
 				tt_setvol(tt,v->volume/6554);
@@ -296,25 +296,25 @@
 		printk(KERN_ERR "You must set an I/O address with io=0x???\n");
 		return -EINVAL;
 	}
-	if (!request_region(io, 2, "terratec")) 
+	if (!request_region(io, 2, "terratec"))
 	{
 		printk(KERN_ERR "TerraTec: port 0x%x already in use\n", io);
 		return -EBUSY;
 	}
 
 	terratec_radio.priv=&terratec_unit;
-	
+
 	spin_lock_init(&lock);
-	
+
 	if(video_register_device(&terratec_radio, VFL_TYPE_RADIO, radio_nr)==-1)
 	{
 		release_region(io,2);
 		return -EINVAL;
 	}
-		
+
 	printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver.\n");
 
- 	/* mute card - prevents noisy bootups */
+	/* mute card - prevents noisy bootups */
 
 	/* this ensures that the volume is all the way down  */
 	cardWriteVol(0);
@@ -334,7 +334,7 @@
 {
 	video_unregister_device(&terratec_radio);
 	release_region(io,2);
-	printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver unloaded.\n");	
+	printk(KERN_INFO "TERRATEC ActivRadio Standalone card driver unloaded.\n");
 }
 
 module_init(terratec_init);
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c
index 5a099a5..efcec01 100644
--- a/drivers/media/radio/radio-trust.c
+++ b/drivers/media/radio/radio-trust.c
@@ -1,14 +1,14 @@
-/* radio-trust.c - Trust FM Radio card driver for Linux 2.2 
+/* radio-trust.c - Trust FM Radio card driver for Linux 2.2
  * by Eric Lammerts <eric@scintilla.utwente.nl>
  *
  * Based on radio-aztech.c. Original notes:
  *
- * Adapted to support the Video for Linux API by 
+ * Adapted to support the Video for Linux API by
  * Russell Kroll <rkroll@exploits.org>.  Based on original tuner code by:
  *
  * Quay Ly
  * Donald Song
- * Jason Lewis      (jlewis@twilight.vtc.vsc.edu) 
+ * Jason Lewis      (jlewis@twilight.vtc.vsc.edu)
  * Scott McGrath    (smcgrath@twilight.vtc.vsc.edu)
  * William McGrath  (wmcgrath@twilight.vtc.vsc.edu)
  *
@@ -30,7 +30,7 @@
 #define CONFIG_RADIO_TRUST_PORT -1
 #endif
 
-static int io = CONFIG_RADIO_TRUST_PORT; 
+static int io = CONFIG_RADIO_TRUST_PORT;
 static int radio_nr = -1;
 static int ioval = 0xf;
 static __u16 curvol;
@@ -135,7 +135,7 @@
 static int tr_getsigstr(void)
 {
 	int i, v;
-	
+
 	for(i = 0, v = 0; i < 100; i++) v |= inb(io);
 	return (v & 1)? 0 : 0xffff;
 }
@@ -175,7 +175,7 @@
 		{
 			struct video_tuner *v = arg;
 
-			if(v->tuner)	/* Only 1 tuner */ 
+			if(v->tuner)	/* Only 1 tuner */
 				return -EINVAL;
 
 			v->rangelow = 87500 * 16;
@@ -211,28 +211,28 @@
 			return 0;
 		}
 		case VIDIOCGAUDIO:
-		{	
+		{
 			struct video_audio *v = arg;
 
 			memset(v,0, sizeof(*v));
 			v->flags = VIDEO_AUDIO_MUTABLE | VIDEO_AUDIO_VOLUME |
-			          VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE;
+				  VIDEO_AUDIO_BASS | VIDEO_AUDIO_TREBLE;
 			v->mode = curstereo? VIDEO_SOUND_STEREO : VIDEO_SOUND_MONO;
 			v->volume = curvol * 2048;
 			v->step = 2048;
 			v->bass = curbass * 4370;
 			v->treble = curtreble * 4370;
-			
+
 			strcpy(v->name, "Trust FM Radio");
-			return 0;			
+			return 0;
 		}
 		case VIDIOCSAUDIO:
 		{
 			struct video_audio *v = arg;
 
-			if(v->audio) 
+			if(v->audio)
 				return -EINVAL;
-			tr_setvol(v->volume);					
+			tr_setvol(v->volume);
 			tr_setbass(v->bass);
 			tr_settreble(v->treble);
 			tr_setstereo(v->mode & VIDEO_SOUND_STEREO);
@@ -292,7 +292,7 @@
 	write_i2c(2, TDA7318_ADDR, 0xe0);	/* speaker att. RR = 0 dB */
 	write_i2c(2, TDA7318_ADDR, 0x40);	/* stereo 1 input, gain = 18.75 dB */
 
-	tr_setvol(0x8000);					
+	tr_setvol(0x8000);
 	tr_setbass(0x8000);
 	tr_settreble(0x8000);
 	tr_setstereo(1);
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index e509558..e424099 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -361,7 +361,7 @@
 
 #ifdef CONFIG_RADIO_TYPHOON_PROC_FS
 	if (!create_proc_info_entry("driver/radio-typhoon", 0, NULL,
-				    typhoon_get_info)) 
+				    typhoon_get_info))
 	    	printk(KERN_ERR "radio-typhoon: registering /proc/driver/radio-typhoon failed\n");
 #endif
 
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index 7bf1a42..8aceea0 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -1,7 +1,7 @@
 /* zoltrix radio plus driver for Linux radio support
  * (c) 1998 C. van Schaik <carl@leg.uct.ac.za>
  *
- * BUGS  
+ * BUGS
  *  Due to the inconsistency in reading from the signal flags
  *  it is difficult to get an accurate tuned signal.
  *
@@ -14,7 +14,7 @@
  *
  * 1999-05-06 - (C. van Schaik)
  *	      - Make signal strength and stereo scans
- *	        kinder to cpu while in delay
+ *		kinder to cpu while in delay
  * 1999-01-05 - (C. van Schaik)
  *	      - Changed tuning to 1/160Mhz accuracy
  *	      - Added stereo support
@@ -105,7 +105,7 @@
 	i = 45;
 
 	mutex_lock(&dev->lock);
-	
+
 	outb(0, io);
 	outb(0, io);
 	inb(io + 3);            /* Zoltrix needs to be read to confirm */
@@ -139,8 +139,8 @@
 	udelay(1000);
 	inb(io+2);
 
-        udelay(1000);
-        
+	udelay(1000);
+
 	if (dev->muted)
 	{
 		outb(0, io);
@@ -148,12 +148,12 @@
 		inb(io + 3);
 		udelay(1000);
 	}
-	
+
 	mutex_unlock(&dev->lock);
-	
+
 	if(!dev->muted)
 	{
-	        zol_setvol(dev, dev->curvol);
+		zol_setvol(dev, dev->curvol);
 	}
 	return 0;
 }
@@ -174,14 +174,14 @@
 	b = inb(io);
 
 	mutex_unlock(&dev->lock);
-	
+
 	if (a != b)
 		return (0);
 
-        if ((a == 0xcf) || (a == 0xdf)  /* I found this out by playing */
+	if ((a == 0xcf) || (a == 0xdf)  /* I found this out by playing */
 		|| (a == 0xef))       /* with a binary scanner on the card io */
 		return (1);
- 	return (0);
+	return (0);
 }
 
 static int zol_is_stereo (struct zol_device *dev)
@@ -189,7 +189,7 @@
 	int x1, x2;
 
 	mutex_lock(&dev->lock);
-	
+
 	outb(0x00, io);
 	outb(dev->curvol, io);
 	msleep(20);
@@ -199,7 +199,7 @@
 	x2 = inb(io);
 
 	mutex_unlock(&dev->lock);
-	
+
 	if ((x1 == x2) && (x1 == 0xcf))
 		return 1;
 	return 0;
@@ -226,7 +226,7 @@
 	case VIDIOCGTUNER:
 		{
 			struct video_tuner *v = arg;
-			if (v->tuner)	
+			if (v->tuner)
 				return -EINVAL;
 			strcpy(v->name, "FM");
 			v->rangelow = (int) (88.0 * 16000);
@@ -351,7 +351,7 @@
 	printk(KERN_INFO "Zoltrix Radio Plus card driver.\n");
 
 	mutex_init(&zoltrix_unit.lock);
-	
+
 	/* mute card - prevents noisy bootups */
 
 	/* this ensures that the volume is all the way down  */
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 85d84e8..b8d4913 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -67,10 +67,10 @@
 static unsigned short colorspace_conv;
 module_param(colorspace_conv, ushort, 0444);
 MODULE_PARM_DESC(colorspace_conv,
-                 " Colorspace conversion:"
-                 "\n  0 = disable, 1 = enable"
-                 "\n  Default value is 0"
-                 );
+		 " Colorspace conversion:"
+		 "\n  0 = disable, 1 = enable"
+		 "\n  Default value is 0"
+		 );
 
 #define ABOUT "V4L-Driver for Vision CPiA based cameras"
 
