extern spinlock_t pnp_lock;
 void *pnp_alloc(long size);
-int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
+struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id);
 int pnp_interface_attach_device(struct pnp_dev *dev);
 void pnp_fixup_device(struct pnp_dev *dev);
 void pnp_free_option(struct pnp_option *option);
 
 
 /**
  * pnp_add_id - adds an EISA id to the specified device
- * @id: pointer to a pnp_id structure
  * @dev: pointer to the desired device
+ * @id: pointer to an EISA id string
  */
-int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
+struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id)
 {
-       struct pnp_id *ptr;
+       struct pnp_id *dev_id, *ptr;
 
-       id->next = NULL;
+       dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
+       if (!dev_id)
+               return NULL;
+
+       dev_id->id[0] = id[0];
+       dev_id->id[1] = id[1];
+       dev_id->id[2] = id[2];
+       dev_id->id[3] = tolower(id[3]);
+       dev_id->id[4] = tolower(id[4]);
+       dev_id->id[5] = tolower(id[5]);
+       dev_id->id[6] = tolower(id[6]);
+       dev_id->id[7] = '\0';
+
+       dev_id->next = NULL;
        ptr = dev->id;
        while (ptr && ptr->next)
                ptr = ptr->next;
        if (ptr)
-               ptr->next = id;
+               ptr->next = dev_id;
        else
-               dev->id = id;
-       return 0;
+               dev->id = dev_id;
+
+       return dev_id;
 }
 
 EXPORT_SYMBOL(pnp_register_driver);
 
 #include <linux/mutex.h>
 #include <asm/io.h>
 
+#include "../base.h"
+
 #if 0
 #define ISAPNP_REGION_OK
 #endif
 static void isapnp_parse_id(struct pnp_dev *dev, unsigned short vendor,
                            unsigned short device)
 {
-       struct pnp_id *id;
+       char id[8];
 
-       if (!dev)
-               return;
-       id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
-       if (!id)
-               return;
-       sprintf(id->id, "%c%c%c%x%x%x%x",
+       sprintf(id, "%c%c%c%x%x%x%x",
                'A' + ((vendor >> 2) & 0x3f) - 1,
                'A' + (((vendor & 3) << 3) | ((vendor >> 13) & 7)) - 1,
                'A' + ((vendor >> 8) & 0x1f) - 1,
                (device >> 4) & 0x0f,
                device & 0x0f, (device >> 12) & 0x0f, (device >> 8) & 0x0f);
-       pnp_add_id(id, dev);
+
+       pnp_add_id(dev, id);
 }
 
 /*
 
        return 1;
 }
 
-static void __init pnpidacpi_to_pnpid(char *id, char *str)
-{
-       str[0] = id[0];
-       str[1] = id[1];
-       str[2] = id[2];
-       str[3] = tolower(id[3]);
-       str[4] = tolower(id[4]);
-       str[5] = tolower(id[5]);
-       str[6] = tolower(id[6]);
-       str[7] = '\0';
-}
-
 static int pnpacpi_get_resources(struct pnp_dev *dev,
                                 struct pnp_resource_table *res)
 {
 
        dev->number = num;
 
-       /* set the initial values for the PnP device */
-       dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
+       dev_id = pnp_add_id(dev, acpi_device_hid(device));
        if (!dev_id)
                goto err;
-       pnpidacpi_to_pnpid(acpi_device_hid(device), dev_id->id);
-       pnp_add_id(dev_id, dev);
 
        if (dev->active) {
                /* parse allocated resource */
                }
        }
 
-       /* parse compatible ids */
        if (device->flags.compatible_ids) {
                struct acpi_compatible_id_list *cid_list = device->pnp.cid_list;
                int i;
                for (i = 0; i < cid_list->count; i++) {
                        if (!ispnpidacpi(cid_list->id[i].value))
                                continue;
-                       dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
-                       if (!dev_id)
-                               continue;
-
-                       pnpidacpi_to_pnpid(cid_list->id[i].value, dev_id->id);
-                       pnp_add_id(dev_id, dev);
+                       pnp_add_id(dev, cid_list->id[i].value);
                }
        }
 
 
        if (!dev)
                return -1;
 
-       dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
+       pnpid32_to_pnpid(node->eisa_id, id);
+       dev_id = pnp_add_id(dev, id);
        if (!dev_id) {
                kfree(dev);
                return -1;
        }
 
        dev->number = node->handle;
-       pnpid32_to_pnpid(node->eisa_id, id);
-       memcpy(dev_id->id, id, 7);
-       pnp_add_id(dev_id, dev);
        pnpbios_parse_data_stream(dev, node);
        dev->active = pnp_is_active(dev);
        dev->flags = node->flags;
 
 }
 #endif                         /* CONFIG_PCI */
 
+#include "../base.h"
 #include "pnpbios.h"
 
 /* standard resource tags */
                case SMALL_TAG_COMPATDEVID:     /* compatible ID */
                        if (len != 4)
                                goto len_err;
-                       dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL);
-                       if (!dev_id)
-                               return NULL;
                        pnpid32_to_pnpid(p[1] | p[2] << 8 | p[3] << 16 | p[4] <<
                                         24, id);
-                       memcpy(&dev_id->id, id, 7);
-                       pnp_add_id(dev_id, dev);
+                       dev_id = pnp_add_id(dev, id);
+                       if (!dev_id)
+                               return NULL;
                        break;
 
                case SMALL_TAG_END: