summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/solaris
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 20:21:22 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 23:15:36 -0700
commit25c7581bcdd11cf9b82a8ef062a10bea310cc9e9 (patch)
treec88f4ee5e91fa7921ff13627f373e1bfbcec8b81 /arch/sparc64/solaris
parent44bdef5e8f2e64ba5974b587989a829d57126bad (diff)
downloadlinux-25c7581bcdd11cf9b82a8ef062a10bea310cc9e9.tar.gz
linux-25c7581bcdd11cf9b82a8ef062a10bea310cc9e9.tar.bz2
linux-25c7581bcdd11cf9b82a8ef062a10bea310cc9e9.zip
[SPARC64]: Kill off some more prom_getproperty() remnants.
The remaining ones occur before we have imported the device tree. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/solaris')
-rw-r--r--arch/sparc64/solaris/misc.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/arch/sparc64/solaris/misc.c b/arch/sparc64/solaris/misc.c
index 5284996780a7..719c90905a1e 100644
--- a/arch/sparc64/solaris/misc.c
+++ b/arch/sparc64/solaris/misc.c
@@ -23,6 +23,7 @@
#include <asm/oplib.h>
#include <asm/idprom.h>
#include <asm/smp.h>
+#include <asm/prom.h>
#include "conv.h"
@@ -194,14 +195,17 @@ static char *machine(void)
}
}
-static char *platform(char *buffer)
+static char *platform(char *buffer, int sz)
{
+ struct device_node *dp = of_find_node_by_path("/");
int len;
*buffer = 0;
- len = prom_getproperty(prom_root_node, "name", buffer, 256);
- if(len > 0)
- buffer[len] = 0;
+ len = strlen(dp->name);
+ if (len > sz)
+ len = sz;
+ memcpy(buffer, dp->name, len);
+ buffer[len] = 0;
if (*buffer) {
char *p;
@@ -213,16 +217,22 @@ static char *platform(char *buffer)
return "sun4u";
}
-static char *serial(char *buffer)
+static char *serial(char *buffer, int sz)
{
- int node = prom_getchild(prom_root_node);
+ struct device_node *dp = of_find_node_by_path("/options");
int len;
- node = prom_searchsiblings(node, "options");
*buffer = 0;
- len = prom_getproperty(node, "system-board-serial#", buffer, 256);
- if(len > 0)
- buffer[len] = 0;
+ if (dp) {
+ char *val = of_get_property(dp, "system-board-serial#", &len);
+
+ if (val && len > 0) {
+ if (len > sz)
+ len = sz;
+ memcpy(buffer, val, len);
+ buffer[len] = 0;
+ }
+ }
if (!*buffer)
return "4512348717234";
else
@@ -305,8 +315,8 @@ asmlinkage int solaris_sysinfo(int cmd, u32 buf, s32 count)
case SI_MACHINE: r = machine(); break;
case SI_ARCHITECTURE: r = "sparc"; break;
case SI_HW_PROVIDER: r = "Sun_Microsystems"; break;
- case SI_HW_SERIAL: r = serial(buffer); break;
- case SI_PLATFORM: r = platform(buffer); break;
+ case SI_HW_SERIAL: r = serial(buffer, sizeof(buffer)); break;
+ case SI_PLATFORM: r = platform(buffer, sizeof(buffer)); break;
case SI_SRPC_DOMAIN: r = ""; break;
case SI_VERSION: r = "Generic"; break;
default: return -EINVAL;