public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] pcibios removal changes for 2.5.48
@ 2002-11-20  5:17 Greg KH
  2002-11-20  5:17 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2002-11-20  5:17 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hi,

Here are a few changesets that removes almost all of the remaining usages
of pcibios_read_config* and pcibios_write_config* calls.  It also
removes them from pci.h and deletes drivers/pci/compat.c.

These changes have been in the -ac tree for a while, and I have been
running a lot of different types of machines with them for a number of
weeks (servers to laptops).



Please pull from:  bk://linuxusb.bkbits.net/pci-2.5



There are still a small number of places in the tree where these
functions show up, but the usage falls into one of three categories:

 - compatibility code for older kernels.  This includes the following
   files:
	drivers/scsi/gdth.c
	drivers/scsi/sym53c8xx.c
	drivers/scsi/sym53c8xx_comm.h
	drivers/scsi/tmscsim.c
	drivers/scsi/megaraid.c
	drivers/net/wan/sdladrv.c
	drivers/char/ip2main.c
	linux/compatmac.h

 - drivers that are outdated and do not build anyway:
	drivers/isdn/hisax/hfc_pci.c
	drivers/isdn/eicon/lincfg.c
	drivers/isdn/eicon/linio.c

 - arch specific code that I can not build, nor test.  A number of these
   instances contain code that directly touches hardware (the network
   driver is an example of that), or is doing other platform specific
   stuff that I do not know how to fix:
	drivers/video/S3triofb.c
	drivers/net/gt96100eth.c
	alpha/kernel/sys_nautilus.c
	alpha/kernel/sys_sio.c


I also think that a number of older pcibios functions can be removed
from m68knommu/kernel/comempci.c, but will have to ask the author of
that file first.

thanks,

greg k-h



 drivers/pci/compat.c        |   37 -------------------------------------
 drivers/isdn/hisax/bkm_a8.c |   23 ++++++++---------------
 drivers/pci/Makefile        |    4 ++--
 drivers/pcmcia/cistpl.c     |    5 ++++-
 include/linux/pci.h         |   17 -----------------
 5 files changed, 14 insertions(+), 72 deletions(-)
-----

ChangeSet@1.872.3.3, 2002-11-19 20:30:40-08:00, greg@kroah.com
  PCI: removed pcibios_read_config_* and pcibios_write_config_* functions.

 drivers/pci/compat.c |   37 -------------------------------------
 drivers/pci/Makefile |    4 ++--
 include/linux/pci.h  |   17 -----------------
 3 files changed, 2 insertions(+), 56 deletions(-)
------

ChangeSet@1.872.3.2, 2002-11-19 20:24:56-08:00, greg@kroah.com
  PCMCIA: remove usage of pcibios_read_config_dword

 drivers/pcmcia/cistpl.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)
------

ChangeSet@1.872.3.1, 2002-11-19 20:23:31-08:00, greg@kroah.com
  ISDN: Convert usages of pcibios_* functions to pci_*

 drivers/isdn/hisax/bkm_a8.c |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
------


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] pcibios removal changes for 2.5.48
  2002-11-20  5:17 [BK PATCH] pcibios removal changes for 2.5.48 Greg KH
@ 2002-11-20  5:17 ` Greg KH
  2002-11-20  5:18   ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2002-11-20  5:17 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.872.3.1, 2002/11/19 20:23:31-08:00, greg@kroah.com

ISDN: Convert usages of pcibios_* functions to pci_*


diff -Nru a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c
--- a/drivers/isdn/hisax/bkm_a8.c	Tue Nov 19 21:07:10 2002
+++ b/drivers/isdn/hisax/bkm_a8.c	Tue Nov 19 21:07:10 2002
@@ -278,8 +278,6 @@
 static struct pci_dev *dev_a8 __initdata = NULL;
 static u16  sub_vendor_id __initdata = 0;
 static u16  sub_sys_id __initdata = 0;
-static u_char pci_bus __initdata = 0;
-static u_char pci_device_fn __initdata = 0;
 static u_char pci_irq __initdata = 0;
 
 #endif /* CONFIG_PCI */
@@ -328,8 +326,6 @@
 					return(0);
 				pci_ioaddr1 = pci_resource_start(dev_a8, 1);
 				pci_irq = dev_a8->irq;
-				pci_bus = dev_a8->bus->number;
-				pci_device_fn = dev_a8->devfn;
 				found = 1;
 				break;
 			}
@@ -342,20 +338,17 @@
 		}
 #ifdef ATTEMPT_PCI_REMAPPING
 /* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */
-		pcibios_read_config_byte(pci_bus, pci_device_fn,
-			PCI_REVISION_ID, &pci_rev_id);
+		pci_read_config_byte(dev_a8, PCI_REVISION_ID, &pci_rev_id);
 		if ((pci_ioaddr1 & 0x80) && (pci_rev_id == 1)) {
 			printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n",
 				CardType[card->typ],
 				sct_quadro_subtypes[cs->subtyp]);
 			/* Restart PCI negotiation */
-			pcibios_write_config_dword(pci_bus, pci_device_fn,
-				PCI_BASE_ADDRESS_1, (u_int) - 1);
+			pci_write_config_dword(dev_a8, PCI_BASE_ADDRESS_1, (u_int) - 1);
 			/* Move up by 0x80 byte */
 			pci_ioaddr1 += 0x80;
 			pci_ioaddr1 &= PCI_BASE_ADDRESS_IO_MASK;
-			pcibios_write_config_dword(pci_bus, pci_device_fn,
-				PCI_BASE_ADDRESS_1, pci_ioaddr1);
+			pci_write_config_dword(dev_a8, PCI_BASE_ADDRESS_1, pci_ioaddr1);
 			dev_a8->resource[ 1].start = pci_ioaddr1;
 		}
 #endif /* End HACK */
@@ -366,11 +359,11 @@
 		       sct_quadro_subtypes[cs->subtyp]);
 		return (0);
 	}
-	pcibios_read_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &pci_ioaddr1);
-	pcibios_read_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_2, &pci_ioaddr2);
-	pcibios_read_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_3, &pci_ioaddr3);
-	pcibios_read_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_4, &pci_ioaddr4);
-	pcibios_read_config_dword(pci_bus, pci_device_fn, PCI_BASE_ADDRESS_5, &pci_ioaddr5);
+	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_1, &pci_ioaddr1);
+	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_2, &pci_ioaddr2);
+	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_3, &pci_ioaddr3);
+	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_4, &pci_ioaddr4);
+	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_5, &pci_ioaddr5);
 	if (!pci_ioaddr1 || !pci_ioaddr2 || !pci_ioaddr3 || !pci_ioaddr4 || !pci_ioaddr5) {
 		printk(KERN_WARNING "HiSax: %s (%s): No IO base address(es)\n",
 		       CardType[card->typ],

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pcibios removal changes for 2.5.48
  2002-11-20  5:17 ` [PATCH] " Greg KH
@ 2002-11-20  5:18   ` Greg KH
  2002-11-20  5:19     ` Greg KH
  2002-11-20 10:16     ` Ivan Kokshaysky
  0 siblings, 2 replies; 6+ messages in thread
From: Greg KH @ 2002-11-20  5:18 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.872.3.2, 2002/11/19 20:24:56-08:00, greg@kroah.com

PCMCIA: remove usage of pcibios_read_config_dword


diff -Nru a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
--- a/drivers/pcmcia/cistpl.c	Tue Nov 19 21:06:55 2002
+++ b/drivers/pcmcia/cistpl.c	Tue Nov 19 21:06:55 2002
@@ -430,7 +430,10 @@
 #ifdef CONFIG_CARDBUS
     if (s->state & SOCKET_CARDBUS) {
 	u_int ptr;
-	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+	struct pci_dev *dev = pci_find_slot (s->cap.cb_dev->subordinate->number, 0);
+	if (!dev)
+	    return CS_BAD_HANDLE;
+	pci_read_config_dword(dev, 0x28, &ptr);
 	tuple->CISOffset = ptr & ~7;
 	SPACE(tuple->Flags) = (ptr & 7);
     } else

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pcibios removal changes for 2.5.48
  2002-11-20  5:18   ` Greg KH
@ 2002-11-20  5:19     ` Greg KH
  2002-11-20 10:16     ` Ivan Kokshaysky
  1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2002-11-20  5:19 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.872.3.3, 2002/11/19 20:30:40-08:00, greg@kroah.com

PCI: removed pcibios_read_config_* and pcibios_write_config_* functions.


diff -Nru a/drivers/pci/Makefile b/drivers/pci/Makefile
--- a/drivers/pci/Makefile	Tue Nov 19 21:06:39 2002
+++ b/drivers/pci/Makefile	Tue Nov 19 21:06:39 2002
@@ -3,10 +3,10 @@
 #
 
 export-objs	:= access.o hotplug.o pci-driver.o pci.o pool.o \
-			probe.o proc.o search.o compat.o setup-bus.o
+			probe.o proc.o search.o setup-bus.o
 
 obj-y		+= access.o probe.o pci.o pool.o quirks.o \
-			compat.o names.o pci-driver.o search.o hotplug.o
+			names.o pci-driver.o search.o hotplug.o
 obj-$(CONFIG_PM)  += power.o
 obj-$(CONFIG_PROC_FS) += proc.o
 
diff -Nru a/drivers/pci/compat.c b/drivers/pci/compat.c
--- a/drivers/pci/compat.c	Tue Nov 19 21:06:39 2002
+++ /dev/null	Wed Dec 31 16:00:00 1969
@@ -1,37 +0,0 @@
-/*
- *	$Id: compat.c,v 1.1 1998/02/16 10:35:50 mj Exp $
- *
- *	PCI Bus Services -- Function For Backward Compatibility
- *
- *	Copyright 1998--2000 Martin Mares <mj@ucw.cz>
- */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-
-/* Obsolete functions, these will be going away... */
-
-#define PCI_OP(rw,size,type)							\
-int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn,	\
-				  unsigned char where, unsigned type val)	\
-{										\
-	struct pci_dev *dev = pci_find_slot(bus, dev_fn);			\
-	if (!dev) return PCIBIOS_DEVICE_NOT_FOUND;				\
-	return pci_##rw##_config_##size(dev, where, val);			\
-}
-
-PCI_OP(read, byte, char *)
-PCI_OP(read, word, short *)
-PCI_OP(read, dword, int *)
-PCI_OP(write, byte, char)
-PCI_OP(write, word, short)
-PCI_OP(write, dword, int)
-
-EXPORT_SYMBOL(pcibios_read_config_byte);
-EXPORT_SYMBOL(pcibios_read_config_word);
-EXPORT_SYMBOL(pcibios_read_config_dword);
-EXPORT_SYMBOL(pcibios_write_config_byte);
-EXPORT_SYMBOL(pcibios_write_config_word);
-EXPORT_SYMBOL(pcibios_write_config_dword);
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Tue Nov 19 21:06:39 2002
+++ b/include/linux/pci.h	Tue Nov 19 21:06:39 2002
@@ -517,21 +517,6 @@
 void pcibios_update_irq(struct pci_dev *, int irq);
 void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
 
-/* Backward compatibility, don't use in new code! */
-
-int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn,
-			      unsigned char where, unsigned char *val);
-int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn,
-			      unsigned char where, unsigned short *val);
-int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn,
-			       unsigned char where, unsigned int *val);
-int pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn,
-			       unsigned char where, unsigned char val);
-int pcibios_write_config_word (unsigned char bus, unsigned char dev_fn,
-			       unsigned char where, unsigned short val);
-int pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn,
-				unsigned char where, unsigned int val);
-
 /* Generic PCI functions used internally */
 
 int pci_bus_exists(const struct list_head *list, int nr);
@@ -668,8 +653,6 @@
 static inline int pci_present(void) { return 0; }
 
 #define _PCI_NOP(o,s,t) \
-	static inline int pcibios_##o##_config_##s (u8 bus, u8 dfn, u8 where, t val) \
-		{ return PCIBIOS_FUNC_NOT_SUPPORTED; } \
 	static inline int pci_##o##_config_##s (struct pci_dev *dev, int where, t val) \
 		{ return PCIBIOS_FUNC_NOT_SUPPORTED; }
 #define _PCI_NOP_ALL(o,x)	_PCI_NOP(o,byte,u8 x) \

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pcibios removal changes for 2.5.48
  2002-11-20  5:18   ` Greg KH
  2002-11-20  5:19     ` Greg KH
@ 2002-11-20 10:16     ` Ivan Kokshaysky
  2002-11-26  0:18       ` Greg KH
  1 sibling, 1 reply; 6+ messages in thread
From: Ivan Kokshaysky @ 2002-11-20 10:16 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

On Tue, Nov 19, 2002 at 09:18:20PM -0800, Greg KH wrote:
>  #ifdef CONFIG_CARDBUS
>      if (s->state & SOCKET_CARDBUS) {
>  	u_int ptr;
> -	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
> +	struct pci_dev *dev = pci_find_slot (s->cap.cb_dev->subordinate->number, 0);
> +	if (!dev)
> +	    return CS_BAD_HANDLE;
> +	pci_read_config_dword(dev, 0x28, &ptr);
>  	tuple->CISOffset = ptr & ~7;
>  	SPACE(tuple->Flags) = (ptr & 7);
>      } else

pci_find_slot seems to be an overkill. Why not just
-	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
+	pci_bus_read_config_dword(s->cap.cb_dev->subordinate, 0, 0x28, &ptr);

?

Ivan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] pcibios removal changes for 2.5.48
  2002-11-20 10:16     ` Ivan Kokshaysky
@ 2002-11-26  0:18       ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2002-11-26  0:18 UTC (permalink / raw)
  To: Ivan Kokshaysky; +Cc: linux-kernel

On Wed, Nov 20, 2002 at 01:16:29PM +0300, Ivan Kokshaysky wrote:
> On Tue, Nov 19, 2002 at 09:18:20PM -0800, Greg KH wrote:
> >  #ifdef CONFIG_CARDBUS
> >      if (s->state & SOCKET_CARDBUS) {
> >  	u_int ptr;
> > -	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
> > +	struct pci_dev *dev = pci_find_slot (s->cap.cb_dev->subordinate->number, 0);
> > +	if (!dev)
> > +	    return CS_BAD_HANDLE;
> > +	pci_read_config_dword(dev, 0x28, &ptr);
> >  	tuple->CISOffset = ptr & ~7;
> >  	SPACE(tuple->Flags) = (ptr & 7);
> >      } else
> 
> pci_find_slot seems to be an overkill. Why not just
> -	pcibios_read_config_dword(s->cap.cb_dev->subordinate->number, 0, 0x28, &ptr);
> +	pci_bus_read_config_dword(s->cap.cb_dev->subordinate, 0, 0x28, &ptr);

Heh, didn't think of that one, I guess it would work too :)

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-26  0:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-20  5:17 [BK PATCH] pcibios removal changes for 2.5.48 Greg KH
2002-11-20  5:17 ` [PATCH] " Greg KH
2002-11-20  5:18   ` Greg KH
2002-11-20  5:19     ` Greg KH
2002-11-20 10:16     ` Ivan Kokshaysky
2002-11-26  0:18       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox