Author: stepan Date: 2007-06-28 22:09:41 +0200 (Thu, 28 Jun 2007) New Revision: 405
Modified: LinuxBIOSv3/device/device.c LinuxBIOSv3/include/device/device.h Log: 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
Modified: LinuxBIOSv3/device/device.c =================================================================== --- LinuxBIOSv3/device/device.c 2007-06-28 18:30:55 UTC (rev 404) +++ LinuxBIOSv3/device/device.c 2007-06-28 20:09:41 UTC (rev 405) @@ -221,10 +221,6 @@ 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);
Modified: LinuxBIOSv3/include/device/device.h =================================================================== --- LinuxBIOSv3/include/device/device.h 2007-06-28 18:30:55 UTC (rev 404) +++ LinuxBIOSv3/include/device/device.h 2007-06-28 20:09:41 UTC (rev 405) @@ -169,6 +169,7 @@
#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 * 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) */