linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: linux-pci@vger.kernel.org
Cc: linux-pcmcia@lists.infradead.org, Yinghai Lu <yinghai@kernel.org>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Subject: [PATCH v2 09/16] PCI: Remove unused, commented-out, code
Date: Fri, 17 Aug 2012 17:36:31 -0600	[thread overview]
Message-ID: <20120817233631.10973.50100.stgit@bhelgaas.mtv.corp.google.com> (raw)
In-Reply-To: <20120817233100.10973.59521.stgit@bhelgaas.mtv.corp.google.com>

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/hotplug/acpiphp_glue.c |   28 -----------------
 drivers/pci/proc.c                 |   19 ------------
 drivers/pci/remove.c               |   19 ------------
 drivers/pci/rom.c                  |   59 ------------------------------------
 4 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index b5d798e..7be4ca5 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1461,34 +1461,6 @@ int __init acpiphp_get_num_slots(void)
 }
 
 
-#if 0
-/**
- * acpiphp_for_each_slot - call function for each slot
- * @fn: callback function
- * @data: context to be passed to callback function
- */
-static int acpiphp_for_each_slot(acpiphp_callback fn, void *data)
-{
-	struct list_head *node;
-	struct acpiphp_bridge *bridge;
-	struct acpiphp_slot *slot;
-	int retval = 0;
-
-	list_for_each (node, &bridge_list) {
-		bridge = (struct acpiphp_bridge *)node;
-		for (slot = bridge->slots; slot; slot = slot->next) {
-			retval = fn(slot, data);
-			if (!retval)
-				goto err_exit;
-		}
-	}
-
- err_exit:
-	return retval;
-}
-#endif
-
-
 /**
  * acpiphp_enable_slot - power on slot
  * @slot: ACPI PHP slot
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 27911b5..eb907a8f 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -434,25 +434,6 @@ int pci_proc_detach_device(struct pci_dev *dev)
 	return 0;
 }
 
-#if 0
-int pci_proc_attach_bus(struct pci_bus* bus)
-{
-	struct proc_dir_entry *de = bus->procdir;
-
-	if (!proc_initialized)
-		return -EACCES;
-
-	if (!de) {
-		char name[16];
-		sprintf(name, "%02x", bus->number);
-		de = bus->procdir = proc_mkdir(name, proc_bus_pci_dir);
-		if (!de)
-			return -ENOMEM;
-	}
-	return 0;
-}
-#endif  /*  0  */
-
 int pci_proc_detach_bus(struct pci_bus* bus)
 {
 	struct proc_dir_entry *de = bus->procdir;
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 3828104..44f479f 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -43,25 +43,6 @@ static void pci_destroy_dev(struct pci_dev *dev)
 	pci_dev_put(dev);
 }
 
-/**
- * pci_remove_device_safe - remove an unused hotplug device
- * @dev: the device to remove
- *
- * Delete the device structure from the device lists and 
- * notify userspace (/sbin/hotplug), but only if the device
- * in question is not being used by a driver.
- * Returns 0 on success.
- */
-#if 0
-int pci_remove_device_safe(struct pci_dev *dev)
-{
-	if (pci_dev_driver(dev))
-		return -EBUSY;
-	pci_destroy_dev(dev);
-	return 0;
-}
-#endif  /*  0  */
-
 void pci_remove_bus(struct pci_bus *pci_bus)
 {
 	pci_proc_detach_bus(pci_bus);
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 48ebdb2..0b3037a 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -167,44 +167,6 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
 	return rom;
 }
 
-#if 0
-/**
- * pci_map_rom_copy - map a PCI ROM to kernel space, create a copy
- * @pdev: pointer to pci device struct
- * @size: pointer to receive size of pci window over ROM
- *
- * Return: kernel virtual pointer to image of ROM
- *
- * Map a PCI ROM into kernel space. If ROM is boot video ROM,
- * the shadow BIOS copy will be returned instead of the
- * actual ROM.
- */
-void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size)
-{
-	struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
-	void __iomem *rom;
-
-	rom = pci_map_rom(pdev, size);
-	if (!rom)
-		return NULL;
-
-	if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_SHADOW |
-			  IORESOURCE_ROM_BIOS_COPY))
-		return rom;
-
-	res->start = (unsigned long)kmalloc(*size, GFP_KERNEL);
-	if (!res->start)
-		return rom;
-
-	res->end = res->start + *size;
-	memcpy_fromio((void*)(unsigned long)res->start, rom, *size);
-	pci_unmap_rom(pdev, rom);
-	res->flags |= IORESOURCE_ROM_COPY;
-
-	return (void __iomem *)(unsigned long)res->start;
-}
-#endif  /*  0  */
-
 /**
  * pci_unmap_rom - unmap the ROM from kernel space
  * @pdev: pointer to pci device struct
@@ -226,27 +188,6 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom)
 		pci_disable_rom(pdev);
 }
 
-#if 0
-/**
- * pci_remove_rom - disable the ROM and remove its sysfs attribute
- * @pdev: pointer to pci device struct
- *
- * Remove the rom file in sysfs and disable ROM decoding.
- */
-void pci_remove_rom(struct pci_dev *pdev)
-{
-	struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
-
-	if (pci_resource_len(pdev, PCI_ROM_RESOURCE))
-		sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr);
-	if (!(res->flags & (IORESOURCE_ROM_ENABLE |
-			    IORESOURCE_ROM_SHADOW |
-			    IORESOURCE_ROM_BIOS_COPY |
-			    IORESOURCE_ROM_COPY)))
-		pci_disable_rom(pdev);
-}
-#endif  /*  0  */
-
 /**
  * pci_cleanup_rom - free the ROM copy created by pci_map_rom_copy
  * @pdev: pointer to pci device struct


  parent reply	other threads:[~2012-08-17 23:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 23:35 [PATCH v2 00/16] Clean up drivers/pci/remove.c Bjorn Helgaas
2012-08-17 23:35 ` [PATCH v2 01/16] PCI: acpiphp: Stop disabling bridges on remove Bjorn Helgaas
2012-08-17 23:35 ` [PATCH v2 02/16] PCI: acpiphp: Use common pci_stop_and_remove_bus_device() Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 03/16] pcmcia: " Bjorn Helgaas
2012-08-18  0:58   ` Yinghai Lu
2012-08-20 14:46     ` Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 04/16] PCI: Don't export stop_bus_device and remove_bus_device interfaces Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 05/16] PCI: Remove pci_stop_and_remove_behind_bridge() Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 06/16] PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 07/16] PCI: Fold stop and remove helpers into their callers Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 08/16] PCI: Stop and remove devices in one pass Bjorn Helgaas
2012-08-18  1:21   ` Yinghai Lu
2012-08-20 15:27     ` Bjorn Helgaas
2012-08-21  5:39       ` Yinghai Lu
2012-08-22 17:40         ` Bjorn Helgaas
2012-08-17 23:36 ` Bjorn Helgaas [this message]
2012-08-17 23:36 ` [PATCH v2 10/16] PCI: Rename local variables to conventional names Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 11/16] PCI: Leave normal LIST_POISON in deleted list entries Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 12/16] frv/PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 13/16] parisc/PCI: Enable PERR/SERR on all devices Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 14/16] parisc/PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:37 ` [PATCH v2 15/16] sgi-agp: " Bjorn Helgaas
2012-08-17 23:37 ` [PATCH v2 16/16] PCI: Remove unused pci_dev_b() Bjorn Helgaas
2012-08-20  4:58 ` [PATCH v2 00/16] Clean up drivers/pci/remove.c Yijing Wang
2012-08-20 15:40   ` Bjorn Helgaas
2012-08-21  3:45     ` Yijing Wang
2012-08-22 17:26       ` Bjorn Helgaas
2012-08-24 21:25 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120817233631.10973.50100.stgit@bhelgaas.mtv.corp.google.com \
    --to=bhelgaas@google.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).