aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2006-06-25 12:58:57 -0400
committerKyle McMartin <kyle@hera.kernel.org>2006-06-27 19:28:43 -0400
commit67a061a191017f984a1ef0ff73ae988b9b15f6d3 (patch)
treef7f84d047dbeafe40711386bd6a8a4ae50bd80de
parentec1fdc24c2ae012b078ba0187ceef208e08a3aec (diff)
[PARISC] Add os_id_to_string helper
Add a helper to asm/pdc.h to translate OS_ID values to strings and use it in the pdc_stable driver. Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
-rw-r--r--drivers/parisc/pdc_stable.c14
-rw-r--r--include/asm-parisc/pdc.h13
2 files changed, 15 insertions, 12 deletions
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 97b345858043..ea1b7a63598e 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -622,22 +622,12 @@ static ssize_t
622pdcs_osid_read(struct subsystem *entry, char *buf) 622pdcs_osid_read(struct subsystem *entry, char *buf)
623{ 623{
624 char *out = buf; 624 char *out = buf;
625 char *tmpstr = NULL;
626 625
627 if (!entry || !buf) 626 if (!entry || !buf)
628 return -EINVAL; 627 return -EINVAL;
629 628
630 switch (pdcs_osid) { 629 out += sprintf(out, "%s dependent data (0x%.4x)\n",
631 case 0x0000: tmpstr = "No OS"; break; 630 os_id_to_string(pdcs_osid), pdcs_osid);
632 case 0x0001: tmpstr = "HP-UX"; break;
633 case 0x0002: tmpstr = "MPE-iX"; break;
634 case 0x0003: tmpstr = "OSF"; break;
635 case 0x0004: tmpstr = "HP-RT"; break;
636 case 0x0005: tmpstr = "Novell Netware"; break;
637 case 0x0006: tmpstr = "Linux"; break;
638 default: tmpstr = "Unknown"; break;
639 }
640 out += sprintf(out, "%s dependent data (0x%.4x)\n", tmpstr, pdcs_osid);
641 631
642 return out - buf; 632 return out - buf;
643} 633}
diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h
index 33bff615d6e1..7a21f106ade6 100644
--- a/include/asm-parisc/pdc.h
+++ b/include/asm-parisc/pdc.h
@@ -284,6 +284,19 @@ typedef struct {
284#define OS_ID_NOVEL 5 /* NOVELL OS */ 284#define OS_ID_NOVEL 5 /* NOVELL OS */
285#define OS_ID_LINUX 6 /* Linux */ 285#define OS_ID_LINUX 6 /* Linux */
286 286
287static inline char * os_id_to_string(u16 os_id) {
288 switch(os_id) {
289 case OS_ID_NONE: return "No OS";
290 case OS_ID_HPUX: return "HP-UX";
291 case OS_ID_MPEXL: return "MPE-iX";
292 case OS_ID_OSF: return "OSF";
293 case OS_ID_HPRT: return "HP-RT";
294 case OS_ID_NOVEL: return "Novell Netware";
295 case OS_ID_LINUX: return "Linux";
296 default: return "Unknown";
297 }
298}
299
287 300
288/* constants for PDC_CHASSIS */ 301/* constants for PDC_CHASSIS */
289#define OSTAT_OFF 0 302#define OSTAT_OFF 0