[POWERPC] powermac: Constify & voidify get_property()
Now that get_property() returns a void *, there's no need to cast its return value. Also, treat the return value as const, so we can constify get_property later. powermac platform & macintosh driver changes. Built for pmac32_defconfig, g5_defconfig Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:

committed by
Paul Mackerras

parent
eeb2b723ef
commit
018a3d1db7
@@ -1058,8 +1058,8 @@ core99_reset_cpu(struct device_node *node, long param, long value)
|
||||
if (np == NULL)
|
||||
return -ENODEV;
|
||||
for (np = np->child; np != NULL; np = np->sibling) {
|
||||
u32 *num = (u32 *)get_property(np, "reg", NULL);
|
||||
u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
|
||||
u32 *num = get_property(np, "reg", NULL);
|
||||
u32 *rst = get_property(np, "soft-reset", NULL);
|
||||
if (num == NULL || rst == NULL)
|
||||
continue;
|
||||
if (param == *num) {
|
||||
@@ -1087,7 +1087,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
|
||||
{
|
||||
struct macio_chip *macio;
|
||||
unsigned long flags;
|
||||
char *prop;
|
||||
const char *prop;
|
||||
int number;
|
||||
u32 reg;
|
||||
|
||||
@@ -1096,7 +1096,7 @@ core99_usb_enable(struct device_node *node, long param, long value)
|
||||
macio->type != macio_intrepid)
|
||||
return -ENODEV;
|
||||
|
||||
prop = (char *)get_property(node, "AAPL,clock-id", NULL);
|
||||
prop = get_property(node, "AAPL,clock-id", NULL);
|
||||
if (!prop)
|
||||
return -ENODEV;
|
||||
if (strncmp(prop, "usb0u048", 8) == 0)
|
||||
@@ -1507,8 +1507,8 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)
|
||||
if (np == NULL)
|
||||
return -ENODEV;
|
||||
for (np = np->child; np != NULL; np = np->sibling) {
|
||||
u32 *num = (u32 *)get_property(np, "reg", NULL);
|
||||
u32 *rst = (u32 *)get_property(np, "soft-reset", NULL);
|
||||
const u32 *num = get_property(np, "reg", NULL);
|
||||
const u32 *rst = get_property(np, "soft-reset", NULL);
|
||||
if (num == NULL || rst == NULL)
|
||||
continue;
|
||||
if (param == *num) {
|
||||
@@ -2408,7 +2408,7 @@ static int __init probe_motherboard(void)
|
||||
*/
|
||||
dt = find_devices("device-tree");
|
||||
if (dt != NULL)
|
||||
model = (const char *) get_property(dt, "model", NULL);
|
||||
model = get_property(dt, "model", NULL);
|
||||
for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
|
||||
if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
|
||||
pmac_mb = pmac_mb_defs[i];
|
||||
@@ -2536,7 +2536,7 @@ found:
|
||||
*/
|
||||
static void __init probe_uninorth(void)
|
||||
{
|
||||
u32 *addrp;
|
||||
const u32 *addrp;
|
||||
phys_addr_t address;
|
||||
unsigned long actrl;
|
||||
|
||||
@@ -2555,7 +2555,7 @@ static void __init probe_uninorth(void)
|
||||
if (uninorth_node == NULL)
|
||||
return;
|
||||
|
||||
addrp = (u32 *)get_property(uninorth_node, "reg", NULL);
|
||||
addrp = get_property(uninorth_node, "reg", NULL);
|
||||
if (addrp == NULL)
|
||||
return;
|
||||
address = of_translate_address(uninorth_node, addrp);
|
||||
@@ -2596,7 +2596,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
|
||||
struct device_node* node;
|
||||
int i;
|
||||
volatile u32 __iomem *base;
|
||||
u32 *addrp, *revp;
|
||||
const u32 *addrp, *revp;
|
||||
phys_addr_t addr;
|
||||
u64 size;
|
||||
|
||||
@@ -2639,7 +2639,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
|
||||
return;
|
||||
}
|
||||
if (type == macio_keylargo || type == macio_keylargo2) {
|
||||
u32 *did = (u32 *)get_property(node, "device-id", NULL);
|
||||
const u32 *did = get_property(node, "device-id", NULL);
|
||||
if (*did == 0x00000025)
|
||||
type = macio_pangea;
|
||||
if (*did == 0x0000003e)
|
||||
@@ -2652,7 +2652,7 @@ static void __init probe_one_macio(const char *name, const char *compat, int typ
|
||||
macio_chips[i].base = base;
|
||||
macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
|
||||
macio_chips[i].name = macio_names[type];
|
||||
revp = (u32 *)get_property(node, "revision-id", NULL);
|
||||
revp = get_property(node, "revision-id", NULL);
|
||||
if (revp)
|
||||
macio_chips[i].rev = *revp;
|
||||
printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
|
||||
@@ -2695,15 +2695,15 @@ static void __init
|
||||
initial_serial_shutdown(struct device_node *np)
|
||||
{
|
||||
int len;
|
||||
struct slot_names_prop {
|
||||
const struct slot_names_prop {
|
||||
int count;
|
||||
char name[1];
|
||||
} *slots;
|
||||
char *conn;
|
||||
const char *conn;
|
||||
int port_type = PMAC_SCC_ASYNC;
|
||||
int modem = 0;
|
||||
|
||||
slots = (struct slot_names_prop *)get_property(np, "slot-names", &len);
|
||||
slots = get_property(np, "slot-names", &len);
|
||||
conn = get_property(np, "AAPL,connector", &len);
|
||||
if (conn && (strcmp(conn, "infrared") == 0))
|
||||
port_type = PMAC_SCC_IRDA;
|
||||
|
Reference in New Issue
Block a user