[coreboot-gerrit] Change in coreboot[master]: src/device: Get rid of device_t

Elyes HAOUAS (Code Review) gerrit at coreboot.org
Fri May 4 18:28:02 CEST 2018


Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/26067


Change subject: src/device: Get rid of device_t
......................................................................

src/device: Get rid of device_t

Use of device_t has been abandoned in ramstage.

Change-Id: I7bd8b93922f113bdaf7ba460acf6a7d62c4df013
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
M src/device/cpu_device.c
M src/device/device.c
M src/device/device_util.c
M src/device/hypertransport.c
M src/device/pci_rom.c
5 files changed, 18 insertions(+), 18 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/26067/1

diff --git a/src/device/cpu_device.c b/src/device/cpu_device.c
index ccbe6ec..4abb791 100644
--- a/src/device/cpu_device.c
+++ b/src/device/cpu_device.c
@@ -17,10 +17,10 @@
 #include <device/device.h>
 #include <console/console.h>
 
-device_t add_cpu_device(struct bus *cpu_bus, unsigned apic_id, int enabled)
+struct device *add_cpu_device(struct bus *cpu_bus, unsigned apic_id, int enabled)
 {
 	struct device_path cpu_path;
-	device_t cpu;
+	struct device *cpu;
 
 	/* Build the CPU device path */
 	cpu_path.type = DEVICE_PATH_APIC;
@@ -41,7 +41,7 @@
 	return cpu;
 }
 
-void set_cpu_topology(device_t cpu, unsigned node, unsigned package, unsigned core, unsigned thread)
+void set_cpu_topology(struct device *cpu, unsigned node, unsigned package, unsigned core, unsigned thread)
 {
 	cpu->path.apic.node_id = node;
 	cpu->path.apic.package_id = package;
diff --git a/src/device/device.c b/src/device/device.c
index b896f5e..1222345 100644
--- a/src/device/device.c
+++ b/src/device/device.c
@@ -122,7 +122,7 @@
  */
 static device_t __alloc_dev(struct bus *parent, struct device_path *path)
 {
-	device_t dev, child;
+	struct device *dev, child;
 
 	/* Find the last child of our parent. */
 	for (child = parent->children; child && child->sibling; /* */ )
@@ -154,9 +154,9 @@
 	return dev;
 }
 
-device_t alloc_dev(struct bus *parent, struct device_path *path)
+struct device *alloc_dev(struct bus *parent, struct device_path *path)
 {
-	device_t dev;
+	struct device *dev;
 	spin_lock(&dev_lock);
 	dev = __alloc_dev(parent, path);
 	spin_unlock(&dev_lock);
@@ -170,9 +170,9 @@
  * @param path The relative path from the bus to the appropriate device.
  * @return Pointer to a device structure for the device on bus at path.
  */
-device_t alloc_find_dev(struct bus *parent, struct device_path *path)
+struct device *alloc_find_dev(struct bus *parent, struct device_path *path)
 {
-	device_t child;
+	struct device *child;
 	spin_lock(&dev_lock);
 	child = find_dev_path(parent, path);
 	if (!child)
@@ -754,7 +754,7 @@
 	}
 }
 
-device_t vga_pri = 0;
+struct device *vga_pri = 0;
 static void set_vga_bridge_bits(void)
 {
 	/*
diff --git a/src/device/device_util.c b/src/device/device_util.c
index a64b63a..1975dcf 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -138,7 +138,7 @@
  * @param path_type The Device Path Type.
  * @return Pointer to the device structure (if found), 0 otherwise.
  */
-struct device *dev_find_path(device_t prev_match,
+struct device *dev_find_path(struct device *prev_match,
 				enum device_path_type path_type)
 {
 	struct device *dev;
diff --git a/src/device/hypertransport.c b/src/device/hypertransport.c
index 472adfc..9712585 100644
--- a/src/device/hypertransport.c
+++ b/src/device/hypertransport.c
@@ -34,9 +34,9 @@
 	unsigned char ctrl_off, config_off, freq_off, freq_cap_off;
 };
 
-static device_t ht_scan_get_devs(device_t *old_devices)
+static struct device *ht_scan_get_devs(device_t *old_devices)
 {
-	device_t first, last;
+	struct device *first, last;
 
 	first = *old_devices;
 	last = first;
@@ -53,7 +53,7 @@
 	}
 
 	if (first) {
-		device_t child;
+		struct device *child;
 
 		/* Unlink the chain from the list of old devices. */
 		*old_devices = last->sibling;
@@ -73,7 +73,7 @@
 	return first;
 }
 
-static int ht_setup_link(struct ht_link *prev, device_t dev, unsigned pos)
+static int ht_setup_link(struct ht_link *prev, struct device *dev, unsigned pos)
 {
 	struct ht_link cur[1];
 	int linkb_to_host;
@@ -256,7 +256,7 @@
 	 * optimize link.
 	 */
 	unsigned int next_unitid, last_unitid, min_unitid, max_unitid;
-	device_t old_devices, dev, func, last_func = 0;
+	struct device *old_devices, dev, func, last_func = 0;
 	struct ht_link prev;
 	int ht_dev_num = 0;
 
@@ -271,7 +271,7 @@
 	 */
 	unsigned int real_last_unitid = 0, end_used = 0;
 	u8 real_last_pos = 0;
-	device_t real_last_dev = NULL;
+	struct device *real_last_dev = NULL;
 #endif
 
 	/* Restore the hypertransport chain to it's uninitialized state. */
@@ -458,7 +458,7 @@
 	 * a problem in devicetree.cb.
 	 */
 	if (old_devices) {
-		device_t left;
+		struct device *left;
 		for (left = old_devices; left; left = left->sibling)
 			printk(BIOS_DEBUG, "%s\n", dev_path(left));
 
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 299f7c8..ad4c8e1 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -153,7 +153,7 @@
 	 */
 	if (PCI_CLASS_DISPLAY_VGA == (dev->class >> 8)) {
 #if !IS_ENABLED(CONFIG_MULTIPLE_VGA_ADAPTERS)
-		extern device_t vga_pri; /* Primary VGA device (device.c). */
+		extern struct device *vga_pri; /* Primary VGA device (device.c). */
 		if (dev != vga_pri) return NULL; /* Only one VGA supported. */
 #endif
 		if ((void *)PCI_VGA_RAM_IMAGE_START != rom_header) {

-- 
To view, visit https://review.coreboot.org/26067
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7bd8b93922f113bdaf7ba460acf6a7d62c4df013
Gerrit-Change-Number: 26067
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas at noos.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180504/11ea93c1/attachment-0001.html>


More information about the coreboot-gerrit mailing list