From adc9554e5ca068f987893c3c1361140b83e59d31 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 28 Jun 2007 20:09:41 +0000 Subject: [PATCH] Make dtsname a static part of the device structure. Signed-off-by: Stefan Reinauer Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@405 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- device/device.c | 4 ---- include/device/device.h | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/device/device.c b/device/device.c index b6bc87bff0..0fce2fec93 100644 --- a/device/device.c +++ b/device/device.c @@ -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); diff --git a/include/device/device.h b/include/device/device.h index 8b67ad64bb..f66234d8ba 100644 --- a/include/device/device.h +++ b/include/device/device.h @@ -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) */