Make dtsname a static part of the device structure.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@405 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Stefan Reinauer 2007-06-28 20:09:41 +00:00
commit adc9554e5c
2 changed files with 2 additions and 5 deletions

View file

@ -221,10 +221,6 @@ struct device *alloc_dev(struct bus *parent, struct device_path *path,
last_dev_p = &dev->next;
/* Give the device a name. */
dev->dtsname = malloc(32);
if (dev->dtsname == NULL) {
die("DEV: out of memory.\n");
}
sprintf(dev->dtsname, "dynamic %s", dev_path(dev));
// spin_unlock(&dev_lock);

View file

@ -169,6 +169,7 @@ struct bus {
#define MAX_RESOURCES 12
#define MAX_LINKS 8
#define MAX_DTSNAME_SIZE 64
/*
* There is one device structure for each slot-number/function-number
* combination:
@ -181,7 +182,7 @@ struct device {
struct device * next; /* chain of all devices */
struct device_path path;
char * dtsname; /* the name from the dts */
char dtsname[MAX_DTSNAME_SIZE]; /* the name from the dts */
unsigned vendor;
unsigned device;
unsigned int class; /* 3 bytes: (base,sub,prog-if) */