|
@@ -25,11 +25,11 @@
|
|
#include <asm/rtas.h>
|
|
#include <asm/rtas.h>
|
|
|
|
|
|
struct cc_workarea {
|
|
struct cc_workarea {
|
|
- u32 drc_index;
|
|
|
|
- u32 zero;
|
|
|
|
- u32 name_offset;
|
|
|
|
- u32 prop_length;
|
|
|
|
- u32 prop_offset;
|
|
|
|
|
|
+ __be32 drc_index;
|
|
|
|
+ __be32 zero;
|
|
|
|
+ __be32 name_offset;
|
|
|
|
+ __be32 prop_length;
|
|
|
|
+ __be32 prop_offset;
|
|
};
|
|
};
|
|
|
|
|
|
void dlpar_free_cc_property(struct property *prop)
|
|
void dlpar_free_cc_property(struct property *prop)
|
|
@@ -49,11 +49,11 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
|
|
if (!prop)
|
|
if (!prop)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
- name = (char *)ccwa + ccwa->name_offset;
|
|
|
|
|
|
+ name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
|
|
prop->name = kstrdup(name, GFP_KERNEL);
|
|
prop->name = kstrdup(name, GFP_KERNEL);
|
|
|
|
|
|
- prop->length = ccwa->prop_length;
|
|
|
|
- value = (char *)ccwa + ccwa->prop_offset;
|
|
|
|
|
|
+ prop->length = be32_to_cpu(ccwa->prop_length);
|
|
|
|
+ value = (char *)ccwa + be32_to_cpu(ccwa->prop_offset);
|
|
prop->value = kmemdup(value, prop->length, GFP_KERNEL);
|
|
prop->value = kmemdup(value, prop->length, GFP_KERNEL);
|
|
if (!prop->value) {
|
|
if (!prop->value) {
|
|
dlpar_free_cc_property(prop);
|
|
dlpar_free_cc_property(prop);
|
|
@@ -79,7 +79,7 @@ static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
|
|
if (!dn)
|
|
if (!dn)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
- name = (char *)ccwa + ccwa->name_offset;
|
|
|
|
|
|
+ name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
|
|
dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
|
|
dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
|
|
if (!dn->full_name) {
|
|
if (!dn->full_name) {
|
|
kfree(dn);
|
|
kfree(dn);
|
|
@@ -126,7 +126,7 @@ void dlpar_free_cc_nodes(struct device_node *dn)
|
|
#define CALL_AGAIN -2
|
|
#define CALL_AGAIN -2
|
|
#define ERR_CFG_USE -9003
|
|
#define ERR_CFG_USE -9003
|
|
|
|
|
|
-struct device_node *dlpar_configure_connector(u32 drc_index,
|
|
|
|
|
|
+struct device_node *dlpar_configure_connector(__be32 drc_index,
|
|
struct device_node *parent)
|
|
struct device_node *parent)
|
|
{
|
|
{
|
|
struct device_node *dn;
|
|
struct device_node *dn;
|
|
@@ -414,7 +414,7 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count)
|
|
if (!parent)
|
|
if (!parent)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
- dn = dlpar_configure_connector(drc_index, parent);
|
|
|
|
|
|
+ dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent);
|
|
if (!dn)
|
|
if (!dn)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|