Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 34048
b: refs/heads/master
c: 954a46e
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed Jul 31, 2006
1 parent 2c5286a commit 2dc142f
Show file tree
Hide file tree
Showing 17 changed files with 73 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7f67bdf2c9f24509b8e81e0f35573b611987c80
refs/heads/master: 954a46e2d5aec6f59976ddeb1d232b486e59b54a
12 changes: 6 additions & 6 deletions trunk/arch/powerpc/platforms/pseries/eeh.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,11 @@ 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", 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;
const char *status = get_property(dn, "status", NULL);
const u32 *class_code = get_property(dn, "class-code", NULL);
const u32 *vendor_id = get_property(dn, "vendor-id", NULL);
const u32 *device_id = get_property(dn, "device-id", NULL);
const u32 *regs;
int enable;
struct pci_dn *pdn = PCI_DN(dn);

Expand Down Expand Up @@ -737,7 +737,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", NULL);
regs = get_property(dn, "reg", NULL);
if (regs) {
/* First register entry is addr (00BBSS00) */
/* Try to enable eeh */
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/eeh_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ struct pci_dn * handle_eeh_events (struct eeh_event *event)

if (!frozen_dn) {

location = (char *) get_property(event->dn, "ibm,loc-code", NULL);
location = get_property(event->dn, "ibm,loc-code", NULL);
location = location ? location : "unknown";
printk(KERN_ERR "EEH: Error: Cannot find partition endpoint "
"for location=%s pci addr=%s\n",
location, pci_name(event->dev));
return NULL;
}
location = (char *) get_property(frozen_dn, "ibm,loc-code", NULL);
location = get_property(frozen_dn, "ibm,loc-code", NULL);
location = location ? location : "unknown";

/* There are two different styles for coming up with the PE.
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/eeh_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ int eeh_send_failure_event (struct device_node *dn,
{
unsigned long flags;
struct eeh_event *event;
char *location;
const char *location;

if (!mem_init_done) {
printk(KERN_ERR "EEH: event during early boot not handled\n");
location = (char *) get_property(dn, "ibm,loc-code", NULL);
location = get_property(dn, "ibm,loc-code", NULL);
printk(KERN_ERR "EEH: device node = %s\n", dn->full_name);
printk(KERN_ERR "EEH: PCI location = %s\n", location);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/pseries/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
void __init fw_feature_init(void)
{
struct device_node *dn;
char *hypertas, *s;
const char *hypertas, *s;
int len, i;

DBG(" -> fw_feature_init()\n");
Expand Down
13 changes: 6 additions & 7 deletions trunk/arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,12 @@ static void iommu_table_setparms(struct pci_controller *phb,
struct iommu_table *tbl)
{
struct device_node *node;
unsigned long *basep;
unsigned int *sizep;
const unsigned long *basep, *sizep;

node = (struct device_node *)phb->arch_data;

basep = (unsigned long *)get_property(node, "linux,tce-base", NULL);
sizep = (unsigned int *)get_property(node, "linux,tce-size", NULL);
basep = get_property(node, "linux,tce-base", NULL);
sizep = get_property(node, "linux,tce-size", NULL);
if (basep == NULL || sizep == NULL) {
printk(KERN_ERR "PCI_DMA: iommu_table_setparms: %s has "
"missing tce entries !\n", dn->full_name);
Expand Down Expand Up @@ -315,7 +314,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
static void iommu_table_setparms_lpar(struct pci_controller *phb,
struct device_node *dn,
struct iommu_table *tbl,
unsigned char *dma_window)
const void *dma_window)
{
unsigned long offset, size;

Expand Down Expand Up @@ -415,7 +414,7 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
struct iommu_table *tbl;
struct device_node *dn, *pdn;
struct pci_dn *ppci;
unsigned char *dma_window = NULL;
const void *dma_window = NULL;

DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self);

Expand Down Expand Up @@ -519,7 +518,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
{
struct device_node *pdn, *dn;
struct iommu_table *tbl;
unsigned char *dma_window = NULL;
const void *dma_window = NULL;
struct pci_dn *pci;

DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, pci_name(dev));
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/powerpc/platforms/pseries/lpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,20 @@ void __init udbg_init_debug_lpar(void)
void __init find_udbg_vterm(void)
{
struct device_node *stdout_node;
u32 *termno;
char *name;
const u32 *termno;
const char *name;
int add_console;

/* find the boot console from /chosen/stdout */
if (!of_chosen)
return;
name = (char *)get_property(of_chosen, "linux,stdout-path", NULL);
name = get_property(of_chosen, "linux,stdout-path", NULL);
if (name == NULL)
return;
stdout_node = of_find_node_by_path(name);
if (!stdout_node)
return;
name = (char *)get_property(stdout_node, "name", NULL);
name = get_property(stdout_node, "name", NULL);
if (!name) {
printk(KERN_WARNING "stdout node missing 'name' property!\n");
goto out;
Expand All @@ -228,7 +228,7 @@ void __init find_udbg_vterm(void)
/* Check if it's a virtual terminal */
if (strncmp(name, "vty", 3) != 0)
goto out;
termno = (u32 *)get_property(stdout_node, "reg", NULL);
termno = get_property(stdout_node, "reg", NULL);
if (termno == NULL)
goto out;
vtermno = termno[0];
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/nvram.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ static ssize_t pSeries_nvram_get_size(void)
int __init pSeries_nvram_init(void)
{
struct device_node *nvram;
unsigned int *nbytes_p, proplen;
const unsigned int *nbytes_p;
unsigned int proplen;

nvram = of_find_node_by_type(NULL, "nvram");
if (nvram == NULL)
return -ENODEV;

nbytes_p = (unsigned int *)get_property(nvram, "#bytes", &proplen);
nbytes_p = get_property(nvram, "#bytes", &proplen);
if (nbytes_p == NULL || proplen != sizeof(unsigned int))
return -EIO;

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/pseries/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_name_device);
static void __devinit check_s7a(void)
{
struct device_node *root;
char *model;
const char *model;

s7a_workaround = 0;
root = of_find_node_by_path("/");
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/ras.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ static void request_ras_irqs(struct device_node *np,
{
int i, index, count = 0;
struct of_irq oirq;
u32 *opicprop;
const u32 *opicprop;
unsigned int opicplen;
unsigned int virqs[16];

/* Check for obsolete "open-pic-interrupt" property. If present, then
* map those interrupts using the default interrupt host and default
* trigger
*/
opicprop = (u32 *)get_property(np, "open-pic-interrupt", &opicplen);
opicprop = get_property(np, "open-pic-interrupt", &opicplen);
if (opicprop) {
opicplen /= sizeof(u32);
for (i = 0; i < opicplen; i++) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/platforms/pseries/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ static int enable_surveillance(int timeout)
static int get_eventscan_parms(void)
{
struct device_node *node;
int *ip;
const int *ip;

node = of_find_node_by_path("/rtas");

ip = (int *)get_property(node, "rtas-event-scan-rate", NULL);
ip = get_property(node, "rtas-event-scan-rate", NULL);
if (ip == NULL) {
printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
of_node_put(node);
Expand Down
12 changes: 6 additions & 6 deletions trunk/arch/powerpc/platforms/pseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,17 @@ void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc,
static void __init pseries_mpic_init_IRQ(void)
{
struct device_node *np, *old, *cascade = NULL;
unsigned int *addrp;
const unsigned int *addrp;
unsigned long intack = 0;
unsigned int *opprop;
const unsigned int *opprop;
unsigned long openpic_addr = 0;
unsigned int cascade_irq;
int naddr, n, i, opplen;
struct mpic *mpic;

np = of_find_node_by_path("/");
naddr = prom_n_addr_cells(np);
opprop = (unsigned int *) get_property(np, "platform-open-pic", &opplen);
opprop = get_property(np, "platform-open-pic", &opplen);
if (opprop != 0) {
openpic_addr = of_read_number(opprop, naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
Expand Down Expand Up @@ -192,7 +192,7 @@ static void __init pseries_mpic_init_IRQ(void)
break;
if (strcmp(np->name, "pci") != 0)
continue;
addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge",
addrp = get_property(np, "8259-interrupt-acknowledge",
NULL);
if (addrp == NULL)
continue;
Expand Down Expand Up @@ -249,11 +249,11 @@ static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
static void __init pseries_discover_pic(void)
{
struct device_node *np;
char *typep;
const char *typep;

for (np = NULL; (np = of_find_node_by_name(np,
"interrupt-controller"));) {
typep = (char *)get_property(np, "compatible", NULL);
typep = get_property(np, "compatible", NULL);
if (strstr(typep, "open-pic")) {
pSeries_mpic_node = of_node_get(np);
ppc_md.init_IRQ = pseries_mpic_init_IRQ;
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/powerpc/platforms/pseries/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ static int pSeries_add_processor(struct device_node *np)
unsigned int cpu;
cpumask_t candidate_map, tmp = CPU_MASK_NONE;
int err = -ENOSPC, len, nthreads, i;
u32 *intserv;
const u32 *intserv;

intserv = (u32 *)get_property(np, "ibm,ppc-interrupt-server#s", &len);
intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len);
if (!intserv)
return 0;

Expand Down Expand Up @@ -205,9 +205,9 @@ static void pSeries_remove_processor(struct device_node *np)
{
unsigned int cpu;
int len, nthreads, i;
u32 *intserv;
const u32 *intserv;

intserv = (u32 *)get_property(np, "ibm,ppc-interrupt-server#s", &len);
intserv = get_property(np, "ibm,ppc-interrupt-server#s", &len);
if (!intserv)
return;

Expand Down
22 changes: 11 additions & 11 deletions trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,14 @@ static void __init xics_init_one_node(struct device_node *np,
unsigned int *indx)
{
unsigned int ilen;
u32 *ireg;
const u32 *ireg;

/* This code does the theorically broken assumption that the interrupt
* server numbers are the same as the hard CPU numbers.
* This happens to be the case so far but we are playing with fire...
* should be fixed one of these days. -BenH.
*/
ireg = (u32 *)get_property(np, "ibm,interrupt-server-ranges", NULL);
ireg = get_property(np, "ibm,interrupt-server-ranges", NULL);

/* Do that ever happen ? we'll know soon enough... but even good'old
* f80 does have that property ..
Expand All @@ -623,7 +623,7 @@ static void __init xics_init_one_node(struct device_node *np,
*/
*indx = *ireg;
}
ireg = (u32 *)get_property(np, "reg", &ilen);
ireg = get_property(np, "reg", &ilen);
if (!ireg)
panic("xics_init_IRQ: can't find interrupt reg property");

Expand All @@ -649,7 +649,7 @@ static void __init xics_setup_8259_cascade(void)
{
struct device_node *np, *old, *found = NULL;
int cascade, naddr;
u32 *addrp;
const u32 *addrp;
unsigned long intack = 0;

for_each_node_by_type(np, "interrupt-controller")
Expand All @@ -675,7 +675,7 @@ static void __init xics_setup_8259_cascade(void)
break;
if (strcmp(np->name, "pci") != 0)
continue;
addrp = (u32 *)get_property(np, "8259-interrupt-acknowledge", NULL);
addrp = get_property(np, "8259-interrupt-acknowledge", NULL);
if (addrp == NULL)
continue;
naddr = prom_n_addr_cells(np);
Expand All @@ -694,7 +694,8 @@ void __init xics_init_IRQ(void)
{
int i;
struct device_node *np;
u32 *ireg, ilen, indx = 0;
u32 ilen, indx = 0;
const u32 *ireg;
int found = 0;

ppc64_boot_msg(0x20, "XICS Init");
Expand All @@ -719,18 +720,17 @@ void __init xics_init_IRQ(void)
for (np = of_find_node_by_type(NULL, "cpu");
np;
np = of_find_node_by_type(np, "cpu")) {
ireg = (u32 *)get_property(np, "reg", &ilen);
ireg = get_property(np, "reg", &ilen);
if (ireg && ireg[0] == get_hard_smp_processor_id(boot_cpuid)) {
ireg = (u32 *)get_property(np,
"ibm,ppc-interrupt-gserver#s",
&ilen);
ireg = get_property(np,
"ibm,ppc-interrupt-gserver#s", &ilen);
i = ilen / sizeof(int);
if (ireg && i > 0) {
default_server = ireg[0];
/* take last element */
default_distrib_server = ireg[i-1];
}
ireg = (u32 *)get_property(np,
ireg = get_property(np,
"ibm,interrupt-server#-size", NULL);
if (ireg)
interrupt_server_size = *ireg;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/char/hvc_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ static int hvc_find_vtys(void)

for (vty = of_find_node_by_name(NULL, "vty"); vty != NULL;
vty = of_find_node_by_name(vty, "vty")) {
uint32_t *vtermno;
const uint32_t *vtermno;

/* We have statically defined space for only a certain number
* of console adapters.
*/
if (num_found >= MAX_NR_HVC_CONSOLES)
break;

vtermno = (uint32_t *)get_property(vty, "reg", NULL);
vtermno = get_property(vty, "reg", NULL);
if (!vtermno)
continue;

Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/char/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1276,11 +1276,10 @@ static int __init hvsi_console_init(void)
vty != NULL;
vty = of_find_compatible_node(vty, "serial", "hvterm-protocol")) {
struct hvsi_struct *hp;
uint32_t *vtermno;
uint32_t *irq;
const uint32_t *vtermno, *irq;

vtermno = (uint32_t *)get_property(vty, "reg", NULL);
irq = (uint32_t *)get_property(vty, "interrupts", NULL);
vtermno = get_property(vty, "reg", NULL);
irq = get_property(vty, "interrupts", NULL);
if (!vtermno || !irq)
continue;

Expand Down
Loading

0 comments on commit 2dc142f

Please sign in to comment.