Commit 47d463b6 authored by Linus Torvalds's avatar Linus Torvalds

ppc64: fix more 0/NULL confusion

parent 1fcedc2b
......@@ -473,10 +473,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
{
struct eeh_early_enable_info *info = data;
int ret;
char *status = get_property(dn, "status", 0);
u32 *class_code = (u32 *)get_property(dn, "class-code", 0);
u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", 0);
u32 *device_id = (u32 *)get_property(dn, "device-id", 0);
char *status = get_property(dn, "status", NULL);
u32 *class_code = (u32 *)get_property(dn, "class-code", NULL);
u32 *vendor_id = (u32 *)get_property(dn, "vendor-id", NULL);
u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
u32 *regs;
int enable;
......@@ -522,7 +522,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
/* Ok... see if this device supports EEH. Some do, some don't,
* and the only way to find out is to check each and every one. */
regs = (u32 *)get_property(dn, "reg", 0);
regs = (u32 *)get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
/* Try to enable eeh */
......@@ -802,7 +802,7 @@ static int eeh_check_opts_config(struct device_node *dn,
/* Build list of strings to match */
nstrs = 0;
s = (char *)get_property(dn, "ibm,loc-code", 0);
s = (char *)get_property(dn, "ibm,loc-code", NULL);
if (s)
strs[nstrs++] = s;
sprintf(devname, "dev%04x:%04x", vendor_id, device_id);
......
......@@ -76,7 +76,7 @@ int hvc_count(int *start_termno)
* we should _always_ be able to find one. */
vty = of_find_node_by_name(NULL, "vty");
if (vty && device_is_compatible(vty, "hvterm1")) {
u32 *termno = (u32 *)get_property(vty, "reg", 0);
u32 *termno = (u32 *)get_property(vty, "reg", NULL);
if (termno && start_termno)
*start_termno = *termno;
......
......@@ -168,7 +168,7 @@ void __init pSeries_init_openpic(void)
struct device_node *np;
int i;
unsigned int *addrp;
unsigned char* chrp_int_ack_special = 0;
unsigned char* chrp_int_ack_special = NULL;
unsigned char init_senses[NR_IRQS - NUM_ISA_INTERRUPTS];
int nmi_irq = -1;
#if defined(CONFIG_VT) && defined(CONFIG_ADB_KEYBOARD) && defined(XMON)
......@@ -642,13 +642,13 @@ void openpic_request_IPIs(void)
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(openpic_vec_ipi, openpic_ipi_action, SA_INTERRUPT,
"IPI0 (call function)", 0);
"IPI0 (call function)", NULL);
request_irq(openpic_vec_ipi+1, openpic_ipi_action, SA_INTERRUPT,
"IPI1 (reschedule)", 0);
"IPI1 (reschedule)", NULL);
request_irq(openpic_vec_ipi+2, openpic_ipi_action, SA_INTERRUPT,
"IPI2 (unused)", 0);
"IPI2 (unused)", NULL);
request_irq(openpic_vec_ipi+3, openpic_ipi_action, SA_INTERRUPT,
"IPI3 (debugger break)", 0);
"IPI3 (debugger break)", NULL);
for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
openpic_enable_ipi(openpic_vec_ipi+i);
......
......@@ -147,7 +147,7 @@ static void iommu_buses_init_lpar(struct list_head *bus_list)
bus = pci_bus_b(ln);
busdn = PCI_GET_DN(bus);
dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", 0);
dma_window = (unsigned int *)get_property(busdn, "ibm,dma-window", NULL);
if (dma_window) {
/* Bussubno hasn't been copied yet.
* Do it now because iommu_table_setparms_lpar needs it.
......@@ -231,7 +231,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
{
unsigned int *dma_window;
dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", 0);
dma_window = (unsigned int *)get_property(dn, "ibm,dma-window", NULL);
if (!dma_window)
panic("iommu_table_setparms_lpar: device %s has no"
......
......@@ -269,7 +269,7 @@ static int find_udbg_vterm(void)
}
/* now we have the stdout node; figure out what type of device it is. */
name = (char *)get_property(stdout_node, "name", 0);
name = (char *)get_property(stdout_node, "name", NULL);
if (!name) {
printk(KERN_WARNING "stdout node missing 'name' property!\n");
goto out;
......@@ -277,7 +277,7 @@ static int find_udbg_vterm(void)
if (strncmp(name, "vty", 3) == 0) {
if (device_is_compatible(stdout_node, "hvterm1")) {
termno = (u32 *)get_property(stdout_node, "reg", 0);
termno = (u32 *)get_property(stdout_node, "reg", NULL);
if (termno) {
vtermno = termno[0];
ppc_md.udbg_putc = udbg_putcLP;
......
......@@ -49,13 +49,13 @@ update_dn_pci_info(struct device_node *dn, void *data)
#ifdef CONFIG_PPC_PSERIES
struct pci_controller *phb = (struct pci_controller *)data;
u32 *regs;
char *device_type = get_property(dn, "device_type", 0);
char *device_type = get_property(dn, "device_type", NULL);
char *model;
dn->phb = phb;
if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", 0) == 0) {
if (device_type && strcmp(device_type, "pci") == 0 && get_property(dn, "class-code", NULL) == 0) {
/* special case for PHB's. Sigh. */
regs = (u32 *)get_property(dn, "bus-range", 0);
regs = (u32 *)get_property(dn, "bus-range", NULL);
dn->busno = regs[0];
model = (char *)get_property(dn, "model", NULL);
......@@ -65,7 +65,7 @@ update_dn_pci_info(struct device_node *dn, void *data)
else
dn->devfn = 0; /* assumption */
} else {
regs = (u32 *)get_property(dn, "reg", 0);
regs = (u32 *)get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
dn->busno = (regs[0] >> 16) & 0xff;
......@@ -107,7 +107,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, travers
for (dn = start->child; dn; dn = nextdn) {
nextdn = NULL;
#ifdef CONFIG_PPC_PSERIES
if (get_property(dn, "class-code", 0)) {
if (get_property(dn, "class-code", NULL)) {
if (pre && (ret = pre(dn, data)) != NULL)
return ret;
if (dn->child) {
......
......@@ -57,7 +57,7 @@ static int __init fixup_one_level_bus_range(struct device_node *node, int higher
int len;
/* For PCI<->PCI bridges or CardBus bridges, we go down */
class_code = (unsigned int *) get_property(node, "class-code", 0);
class_code = (unsigned int *) get_property(node, "class-code", NULL);
if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI &&
(*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS))
continue;
......
......@@ -84,7 +84,7 @@ static int __init proc_ppc64_create(void)
{
struct proc_dir_entry *root;
root = proc_mkdir("ppc64", 0);
root = proc_mkdir("ppc64", NULL);
if (!root)
return 1;
......@@ -94,7 +94,7 @@ static int __init proc_ppc64_create(void)
if (!proc_mkdir("rtas", root))
return 1;
if (!proc_symlink("rtas", 0, "ppc64/rtas"))
if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
return 1;
return 0;
......
......@@ -31,7 +31,7 @@
#include <asm/delay.h>
#include <asm/uaccess.h>
struct flash_block_list_header rtas_firmware_flash_list = {0, 0};
struct flash_block_list_header rtas_firmware_flash_list = {0, NULL};
struct rtas_t rtas = {
.lock = SPIN_LOCK_UNLOCKED
......@@ -329,7 +329,7 @@ rtas_flash_firmware(void)
if (f->next)
f->next = (struct flash_block_list *)virt_to_abs(f->next);
else
f->next = 0LL;
f->next = NULL;
/* make num_blocks into the version/length field */
f->num_blocks = (FLASH_BLOCK_LIST_VERSION << 56) | ((f->num_blocks+1)*16);
}
......
......@@ -455,7 +455,7 @@ static int __init rtas_init(void)
else
printk(KERN_ERR "Failed to create error_log proc entry\n");
if (kernel_thread(rtasd, 0, CLONE_FS) < 0)
if (kernel_thread(rtasd, NULL, CLONE_FS) < 0)
printk(KERN_ERR "Failed to start RTAS daemon\n");
return 0;
......
......@@ -207,7 +207,7 @@ static int __init rtc_init(void)
return retval;
#ifdef CONFIG_PROC_FS
if(create_proc_read_entry ("driver/rtc", 0, 0, rtc_read_proc, NULL) == NULL)
if (create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL) == NULL)
misc_deregister(&rtc_dev);
return -ENOMEM;
#endif
......
......@@ -715,7 +715,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
printk("smp_call_function on cpu %d: other cpus not "
"responding (%d)\n", smp_processor_id(),
atomic_read(&data.started));
debugger(0);
debugger(NULL);
goto out;
}
}
......@@ -730,7 +730,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
smp_processor_id(),
atomic_read(&data.finished),
atomic_read(&data.started));
debugger(0);
debugger(NULL);
goto out;
}
}
......
......@@ -380,7 +380,7 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
viodev->dev.platform_data = of_node_get(of_node);
viodev->irq = NO_IRQ;
irq_p = (unsigned int *)get_property(of_node, "interrupts", 0);
irq_p = (unsigned int *)get_property(of_node, "interrupts", NULL);
if (irq_p) {
int virq = virt_irq_create_mapping(*irq_p);
if (virq == NO_IRQ) {
......
......@@ -475,7 +475,7 @@ void xics_init_IRQ(void)
while (1);
}
nextnode:
ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", 0);
ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL);
if (ireg) {
/*
* set node starting index for this node
......@@ -532,7 +532,7 @@ void xics_init_IRQ(void)
xics_irq_8259_cascade_real = -1;
xics_irq_8259_cascade = -1;
} else {
ireg = (uint *) get_property(np, "interrupts", 0);
ireg = (uint *) get_property(np, "interrupts", NULL);
if (!ireg) {
printk(KERN_WARNING "Can't find ISA Interrupts Property\n");
udbg_printf("Can't find ISA Interrupts Property\n");
......@@ -589,7 +589,7 @@ static int __init xics_setup_i8259(void)
if (naca->interrupt_controller == IC_PPC_XIC &&
xics_irq_8259_cascade != -1) {
if (request_irq(irq_offset_up(xics_irq_8259_cascade),
no_action, 0, "8259 cascade", 0))
no_action, 0, "8259 cascade", NULL))
printk(KERN_ERR "xics_init_IRQ: couldn't get 8259 cascade\n");
i8259_init();
}
......@@ -604,7 +604,7 @@ void xics_request_IPIs(void)
/* IPIs are marked SA_INTERRUPT as they must run with irqs disabled */
request_irq(irq_offset_up(XICS_IPI), xics_ipi_action, SA_INTERRUPT,
"IPI", 0);
"IPI", NULL);
get_irq_desc(irq_offset_up(XICS_IPI))->status |= IRQ_PER_CPU;
}
#endif
......
......@@ -140,7 +140,7 @@ void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de
lastp = &al->next;
}
of_node_put(child);
*lastp = 0;
*lastp = NULL;
de->subdir = list;
}
......@@ -152,7 +152,7 @@ void proc_device_tree_init(void)
struct device_node *root;
if ( !have_of )
return;
proc_device_tree = proc_mkdir("device-tree", 0);
proc_device_tree = proc_mkdir("device-tree", NULL);
if (proc_device_tree == 0)
return;
root = of_find_node_by_path("/");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment