also update spec file ...
[linux-flexiantxendom0-3.2.10.git] / drivers / pnp / names.c
1 /*
2  * names.c - a very simple name database for PnP devices
3  *
4  * Some code is based on names.c from linux pci
5  * Copyright 1993--1999 Drew Eckhardt, Frederic Potter,
6  * David Mosberger-Tang, Martin Mares
7  *
8  * Copyright 2002 Adam Belay <ambx1@neo.rr.com>
9  *
10  */
11
12 #include <linux/string.h>
13 #include <linux/pnp.h>
14
15 #include "base.h"
16
17 #ifdef CONFIG_PNP_NAMES
18
19 static char *pnp_id_eisaid[] = {
20 #define ID(x,y) x,
21 #include "idlist.h"
22 };
23
24 static char *pnp_id_names[] = {
25 #define ID(x,y) y,
26 #include "idlist.h"
27 };
28
29 void
30 pnp_name_device(struct pnp_dev *dev)
31 {
32         int i;
33         char *name = dev->dev.name;
34         for(i=0; i<sizeof(pnp_id_eisaid)/sizeof(pnp_id_eisaid[0]); i++){
35                 if (compare_pnp_id(dev->id,pnp_id_eisaid[i])){
36                         snprintf(name, DEVICE_NAME_SIZE, "%s", pnp_id_names[i]);
37                         return;
38                 }
39         }
40 }
41
42 #else
43
44 void
45 pnp_name_device(struct pnp_dev *dev)
46 {
47         return;
48 }
49
50 #endif /* CONFIG_PNP_NAMES */