patch-2.4.0-test2 linux/drivers/char/stallion.c

Next file: linux/drivers/char/stradis.c
Previous file: linux/drivers/char/sh-sci.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/char/stallion.c linux/drivers/char/stallion.c
@@ -511,8 +511,6 @@
 static void	stl_waituntilsent(struct tty_struct *tty, int timeout);
 static void	stl_sendxchar(struct tty_struct *tty, char ch);
 static void	stl_hangup(struct tty_struct *tty);
-static int	stl_memopen(struct inode *ip, struct file *fp);
-static int	stl_memclose(struct inode *ip, struct file *fp);
 static int	stl_memioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
 static int	stl_portinfo(stlport_t *portp, int portnr, char *pos);
 static int	stl_readproc(char *page, char **start, off_t off, int count, int *eof, void *data);
@@ -744,9 +742,8 @@
  *	to get at port stats - only not using the port device itself.
  */
 static struct file_operations	stl_fsiomem = {
+	owner:		THIS_MODULE,
 	ioctl:		stl_memioctl,
-	open:		stl_memopen,
-	release:	stl_memclose,
 };
 
 /*****************************************************************************/
@@ -2795,8 +2792,8 @@
  */
 #if DEBUG
 	printk("%s(%d): BAR[]=%x,%x,%x,%x IRQ=%x\n", __FILE__, __LINE__,
-		devp->resource[0].start, devp->resource[1].start,
-		devp->resource[2].start, devp->resource[3].start, devp->irq);
+		pci_resource_start(devp, 0), pci_resource_start(devp, 1),
+		pci_resource_start(devp, 2), pci_resource_start(devp, 3), devp->irq);
 #endif
 
 /*
@@ -2805,22 +2802,16 @@
  */
 	switch (brdtype) {
 	case BRD_ECHPCI:
-		brdp->ioaddr2 = (devp->resource[0].start &
-			PCI_BASE_ADDRESS_IO_MASK);
-		brdp->ioaddr1 = (devp->resource[1].start &
-			PCI_BASE_ADDRESS_IO_MASK);
+		brdp->ioaddr2 = pci_resource_start(devp, 0);
+		brdp->ioaddr1 = pci_resource_start(devp, 1);
 		break;
 	case BRD_ECH64PCI:
-		brdp->ioaddr2 = (devp->resource[2].start &
-			PCI_BASE_ADDRESS_IO_MASK);
-		brdp->ioaddr1 = (devp->resource[1].start &
-			PCI_BASE_ADDRESS_IO_MASK);
+		brdp->ioaddr2 = pci_resource_start(devp, 2);
+		brdp->ioaddr1 = pci_resource_start(devp, 1);
 		break;
 	case BRD_EASYIOPCI:
-		brdp->ioaddr1 = (devp->resource[2].start &
-			PCI_BASE_ADDRESS_IO_MASK);
-		brdp->ioaddr2 = (devp->resource[1].start &
-			PCI_BASE_ADDRESS_IO_MASK);
+		brdp->ioaddr1 = pci_resource_start(devp, 2);
+		brdp->ioaddr2 = pci_resource_start(devp, 1);
 		break;
 	default:
 		printk("STALLION: unknown PCI board type=%d\n", brdtype);
@@ -3123,27 +3114,6 @@
 /*****************************************************************************/
 
 /*
- *	Memory device open code. Need to keep track of opens and close
- *	for module handling.
- */
-
-static int stl_memopen(struct inode *ip, struct file *fp)
-{
-	MOD_INC_USE_COUNT;
-	return(0);
-}
-
-/*****************************************************************************/
-
-static int stl_memclose(struct inode *ip, struct file *fp)
-{
-	MOD_DEC_USE_COUNT;
-	return(0);
-}
-
-/*****************************************************************************/
-
-/*
  *	The "staliomem" device is also required to do some special operations
  *	on the board and/or ports. In this driver it is mostly used for stats
  *	collection.
@@ -3224,7 +3194,7 @@
 	devfs_handle = devfs_mk_dir (NULL, "staliomem", 9, NULL);
 	devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT,
 			       STL_SIOMEMMAJOR, 0,
-			       S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+			       S_IFCHR | S_IRUSR | S_IWUSR,
 			       &stl_fsiomem, NULL);
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)