Commit cd4cd730 authored by Grant Likely's avatar Grant Likely

sparc: remove references to of_device and to_of_device

of_device is just a #define alias to platform_device.  This patch
replaces all references to it with platform_device.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a454dc50
...@@ -57,7 +57,7 @@ extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long s ...@@ -57,7 +57,7 @@ extern void of_iounmap(struct resource *res, void __iomem *base, unsigned long s
/* These routines are here to provide compatibility with how powerpc /* These routines are here to provide compatibility with how powerpc
* handles IRQ mapping for OF device nodes. We precompute and permanently * handles IRQ mapping for OF device nodes. We precompute and permanently
* register them in the of_device objects, whereas powerpc computes them * register them in the platform_device objects, whereas powerpc computes them
* on request. * on request.
*/ */
static inline void irq_dispose_mapping(unsigned int virq) static inline void irq_dispose_mapping(unsigned int virq)
......
...@@ -68,7 +68,7 @@ static void apc_swift_idle(void) ...@@ -68,7 +68,7 @@ static void apc_swift_idle(void)
#endif #endif
} }
static inline void apc_free(struct of_device *op) static inline void apc_free(struct platform_device *op)
{ {
of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0])); of_iounmap(&op->resource[0], regs, resource_size(&op->resource[0]));
} }
...@@ -136,7 +136,7 @@ static const struct file_operations apc_fops = { ...@@ -136,7 +136,7 @@ static const struct file_operations apc_fops = {
static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops }; static struct miscdevice apc_miscdev = { APC_MINOR, APC_DEVNAME, &apc_fops };
static int __devinit apc_probe(struct of_device *op, static int __devinit apc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
int err; int err;
......
...@@ -102,7 +102,8 @@ static struct of_device_id __initdata auxio_match[] = { ...@@ -102,7 +102,8 @@ static struct of_device_id __initdata auxio_match[] = {
MODULE_DEVICE_TABLE(of, auxio_match); MODULE_DEVICE_TABLE(of, auxio_match);
static int __devinit auxio_probe(struct of_device *dev, const struct of_device_id *match) static int __devinit auxio_probe(struct platform_device *dev,
const struct of_device_id *match)
{ {
struct device_node *dp = dev->dev.of_node; struct device_node *dp = dev->dev.of_node;
unsigned long size; unsigned long size;
......
...@@ -59,7 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p) ...@@ -59,7 +59,7 @@ static int __devinit clock_board_calc_nslots(struct clock_board *p)
} }
} }
static int __devinit clock_board_probe(struct of_device *op, static int __devinit clock_board_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL); struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
...@@ -157,7 +157,7 @@ static struct of_platform_driver clock_board_driver = { ...@@ -157,7 +157,7 @@ static struct of_platform_driver clock_board_driver = {
}, },
}; };
static int __devinit fhc_probe(struct of_device *op, static int __devinit fhc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL); struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
......
...@@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p, ...@@ -392,7 +392,7 @@ static void __devinit jbusmc_construct_dimm_groups(struct jbusmc *p,
} }
} }
static int __devinit jbusmc_probe(struct of_device *op, static int __devinit jbusmc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *mem_regs; const struct linux_prom64_registers *mem_regs;
...@@ -690,7 +690,7 @@ static void chmc_fetch_decode_regs(struct chmc *p) ...@@ -690,7 +690,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
chmc_read_mcreg(p, CHMCTRL_DECODE4)); chmc_read_mcreg(p, CHMCTRL_DECODE4));
} }
static int __devinit chmc_probe(struct of_device *op, static int __devinit chmc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
...@@ -765,7 +765,7 @@ static int __devinit chmc_probe(struct of_device *op, ...@@ -765,7 +765,7 @@ static int __devinit chmc_probe(struct of_device *op,
goto out; goto out;
} }
static int __devinit us3mc_probe(struct of_device *op, static int __devinit us3mc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
if (mc_type == MC_TYPE_SAFARI) if (mc_type == MC_TYPE_SAFARI)
...@@ -775,21 +775,21 @@ static int __devinit us3mc_probe(struct of_device *op, ...@@ -775,21 +775,21 @@ static int __devinit us3mc_probe(struct of_device *op,
return -ENODEV; return -ENODEV;
} }
static void __devexit chmc_destroy(struct of_device *op, struct chmc *p) static void __devexit chmc_destroy(struct platform_device *op, struct chmc *p)
{ {
list_del(&p->list); list_del(&p->list);
of_iounmap(&op->resource[0], p->regs, 0x48); of_iounmap(&op->resource[0], p->regs, 0x48);
kfree(p); kfree(p);
} }
static void __devexit jbusmc_destroy(struct of_device *op, struct jbusmc *p) static void __devexit jbusmc_destroy(struct platform_device *op, struct jbusmc *p)
{ {
mc_list_del(&p->list); mc_list_del(&p->list);
of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE); of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);
kfree(p); kfree(p);
} }
static int __devexit us3mc_remove(struct of_device *op) static int __devexit us3mc_remove(struct platform_device *op)
{ {
void *p = dev_get_drvdata(&op->dev); void *p = dev_get_drvdata(&op->dev);
......
...@@ -253,7 +253,7 @@ EXPORT_SYMBOL(sbus_set_sbus64); ...@@ -253,7 +253,7 @@ EXPORT_SYMBOL(sbus_set_sbus64);
static void *sbus_alloc_coherent(struct device *dev, size_t len, static void *sbus_alloc_coherent(struct device *dev, size_t len,
dma_addr_t *dma_addrp, gfp_t gfp) dma_addr_t *dma_addrp, gfp_t gfp)
{ {
struct of_device *op = to_of_device(dev); struct platform_device *op = to_platform_device(dev);
unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK; unsigned long len_total = (len + PAGE_SIZE-1) & PAGE_MASK;
unsigned long va; unsigned long va;
struct resource *res; struct resource *res;
......
...@@ -241,10 +241,10 @@ static int __init use_1to1_mapping(struct device_node *pp) ...@@ -241,10 +241,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
static int of_resource_verbose; static int of_resource_verbose;
static void __init build_device_resources(struct of_device *op, static void __init build_device_resources(struct platform_device *op,
struct device *parent) struct device *parent)
{ {
struct of_device *p_op; struct platform_device *p_op;
struct of_bus *bus; struct of_bus *bus;
int na, ns; int na, ns;
int index, num_reg; int index, num_reg;
...@@ -253,7 +253,7 @@ static void __init build_device_resources(struct of_device *op, ...@@ -253,7 +253,7 @@ static void __init build_device_resources(struct of_device *op,
if (!parent) if (!parent)
return; return;
p_op = to_of_device(parent); p_op = to_platform_device(parent);
bus = of_match_bus(p_op->dev.of_node); bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->dev.of_node, &na, &ns); bus->count_cells(op->dev.of_node, &na, &ns);
...@@ -335,10 +335,10 @@ static void __init build_device_resources(struct of_device *op, ...@@ -335,10 +335,10 @@ static void __init build_device_resources(struct of_device *op,
} }
} }
static struct of_device * __init scan_one_device(struct device_node *dp, static struct platform_device * __init scan_one_device(struct device_node *dp,
struct device *parent) struct device *parent)
{ {
struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL); struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const struct linux_prom_irqs *intr; const struct linux_prom_irqs *intr;
struct dev_archdata *sd; struct dev_archdata *sd;
int len, i; int len, i;
...@@ -443,7 +443,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, ...@@ -443,7 +443,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
static void __init scan_tree(struct device_node *dp, struct device *parent) static void __init scan_tree(struct device_node *dp, struct device *parent)
{ {
while (dp) { while (dp) {
struct of_device *op = scan_one_device(dp, parent); struct platform_device *op = scan_one_device(dp, parent);
if (op) if (op)
scan_tree(dp->child, &op->dev); scan_tree(dp->child, &op->dev);
...@@ -455,7 +455,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) ...@@ -455,7 +455,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
static int __init scan_of_devices(void) static int __init scan_of_devices(void)
{ {
struct device_node *root = of_find_node_by_path("/"); struct device_node *root = of_find_node_by_path("/");
struct of_device *parent; struct platform_device *parent;
parent = scan_one_device(root, NULL); parent = scan_one_device(root, NULL);
if (!parent) if (!parent)
......
...@@ -310,10 +310,10 @@ static int __init use_1to1_mapping(struct device_node *pp) ...@@ -310,10 +310,10 @@ static int __init use_1to1_mapping(struct device_node *pp)
static int of_resource_verbose; static int of_resource_verbose;
static void __init build_device_resources(struct of_device *op, static void __init build_device_resources(struct platform_device *op,
struct device *parent) struct device *parent)
{ {
struct of_device *p_op; struct platform_device *p_op;
struct of_bus *bus; struct of_bus *bus;
int na, ns; int na, ns;
int index, num_reg; int index, num_reg;
...@@ -322,7 +322,7 @@ static void __init build_device_resources(struct of_device *op, ...@@ -322,7 +322,7 @@ static void __init build_device_resources(struct of_device *op,
if (!parent) if (!parent)
return; return;
p_op = to_of_device(parent); p_op = to_platform_device(parent);
bus = of_match_bus(p_op->dev.of_node); bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->dev.of_node, &na, &ns); bus->count_cells(op->dev.of_node, &na, &ns);
...@@ -528,7 +528,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp, ...@@ -528,7 +528,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,
static int of_irq_verbose; static int of_irq_verbose;
static unsigned int __init build_one_device_irq(struct of_device *op, static unsigned int __init build_one_device_irq(struct platform_device *op,
struct device *parent, struct device *parent,
unsigned int irq) unsigned int irq)
{ {
...@@ -630,10 +630,10 @@ static unsigned int __init build_one_device_irq(struct of_device *op, ...@@ -630,10 +630,10 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
return irq; return irq;
} }
static struct of_device * __init scan_one_device(struct device_node *dp, static struct platform_device * __init scan_one_device(struct device_node *dp,
struct device *parent) struct device *parent)
{ {
struct of_device *op = kzalloc(sizeof(*op), GFP_KERNEL); struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const unsigned int *irq; const unsigned int *irq;
struct dev_archdata *sd; struct dev_archdata *sd;
int len, i; int len, i;
...@@ -686,7 +686,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp, ...@@ -686,7 +686,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
static void __init scan_tree(struct device_node *dp, struct device *parent) static void __init scan_tree(struct device_node *dp, struct device *parent)
{ {
while (dp) { while (dp) {
struct of_device *op = scan_one_device(dp, parent); struct platform_device *op = scan_one_device(dp, parent);
if (op) if (op)
scan_tree(dp->child, &op->dev); scan_tree(dp->child, &op->dev);
...@@ -698,7 +698,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent) ...@@ -698,7 +698,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
static int __init scan_of_devices(void) static int __init scan_of_devices(void)
{ {
struct device_node *root = of_find_node_by_path("/"); struct device_node *root = of_find_node_by_path("/");
struct of_device *parent; struct platform_device *parent;
parent = scan_one_device(root, NULL); parent = scan_one_device(root, NULL);
if (!parent) if (!parent)
......
...@@ -13,19 +13,19 @@ ...@@ -13,19 +13,19 @@
static int node_match(struct device *dev, void *data) static int node_match(struct device *dev, void *data)
{ {
struct of_device *op = to_of_device(dev); struct platform_device *op = to_platform_device(dev);
struct device_node *dp = data; struct device_node *dp = data;
return (op->dev.of_node == dp); return (op->dev.of_node == dp);
} }
struct of_device *of_find_device_by_node(struct device_node *dp) struct platform_device *of_find_device_by_node(struct device_node *dp)
{ {
struct device *dev = bus_find_device(&platform_bus_type, NULL, struct device *dev = bus_find_device(&platform_bus_type, NULL,
dp, node_match); dp, node_match);
if (dev) if (dev)
return to_of_device(dev); return to_platform_device(dev);
return NULL; return NULL;
} }
...@@ -33,7 +33,7 @@ EXPORT_SYMBOL(of_find_device_by_node); ...@@ -33,7 +33,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
unsigned int irq_of_parse_and_map(struct device_node *node, int index) unsigned int irq_of_parse_and_map(struct device_node *node, int index)
{ {
struct of_device *op = of_find_device_by_node(node); struct platform_device *op = of_find_device_by_node(node);
if (!op || index >= op->archdata.num_irqs) if (!op || index >= op->archdata.num_irqs)
return 0; return 0;
...@@ -43,16 +43,16 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index) ...@@ -43,16 +43,16 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index)
EXPORT_SYMBOL(irq_of_parse_and_map); EXPORT_SYMBOL(irq_of_parse_and_map);
/* Take the archdata values for IOMMU, STC, and HOSTDATA found in /* Take the archdata values for IOMMU, STC, and HOSTDATA found in
* BUS and propagate to all child of_device objects. * BUS and propagate to all child platform_device objects.
*/ */
void of_propagate_archdata(struct of_device *bus) void of_propagate_archdata(struct platform_device *bus)
{ {
struct dev_archdata *bus_sd = &bus->dev.archdata; struct dev_archdata *bus_sd = &bus->dev.archdata;
struct device_node *bus_dp = bus->dev.of_node; struct device_node *bus_dp = bus->dev.of_node;
struct device_node *dp; struct device_node *dp;
for (dp = bus_dp->child; dp; dp = dp->sibling) { for (dp = bus_dp->child; dp; dp = dp->sibling) {
struct of_device *op = of_find_device_by_node(dp); struct platform_device *op = of_find_device_by_node(dp);
op->dev.archdata.iommu = bus_sd->iommu; op->dev.archdata.iommu = bus_sd->iommu;
op->dev.archdata.stc = bus_sd->stc; op->dev.archdata.stc = bus_sd->stc;
......
...@@ -198,7 +198,7 @@ static unsigned long pci_parse_of_flags(u32 addr0) ...@@ -198,7 +198,7 @@ static unsigned long pci_parse_of_flags(u32 addr0)
* into physical address resources, we only have to figure out the register * into physical address resources, we only have to figure out the register
* mapping. * mapping.
*/ */
static void pci_parse_of_addrs(struct of_device *op, static void pci_parse_of_addrs(struct platform_device *op,
struct device_node *node, struct device_node *node,
struct pci_dev *dev) struct pci_dev *dev)
{ {
...@@ -248,7 +248,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, ...@@ -248,7 +248,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
{ {
struct dev_archdata *sd; struct dev_archdata *sd;
struct pci_slot *slot; struct pci_slot *slot;
struct of_device *op; struct platform_device *op;
struct pci_dev *dev; struct pci_dev *dev;
const char *type; const char *type;
u32 class; u32 class;
......
...@@ -410,7 +410,7 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm) ...@@ -410,7 +410,7 @@ static void pci_fire_hw_init(struct pci_pbm_info *pbm)
} }
static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 portid) struct platform_device *op, u32 portid)
{ {
const struct linux_prom64_registers *regs; const struct linux_prom64_registers *regs;
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
...@@ -455,7 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm, ...@@ -455,7 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
return 0; return 0;
} }
static int __devinit fire_probe(struct of_device *op, static int __devinit fire_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
......
...@@ -91,7 +91,7 @@ struct pci_pbm_info { ...@@ -91,7 +91,7 @@ struct pci_pbm_info {
char *name; char *name;
/* OBP specific information. */ /* OBP specific information. */
struct of_device *op; struct platform_device *op;
u64 ino_bitmap; u64 ino_bitmap;
/* PBM I/O and Memory space resources. */ /* PBM I/O and Memory space resources. */
......
...@@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id) ...@@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */ #define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
static void psycho_register_error_handlers(struct pci_pbm_info *pbm) static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
unsigned long base = pbm->controller_regs; unsigned long base = pbm->controller_regs;
u64 tmp; u64 tmp;
int err; int err;
...@@ -483,7 +483,7 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm, ...@@ -483,7 +483,7 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,
#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL #define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL
static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm, static void __devinit psycho_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, int is_pbm_a) struct platform_device *op, int is_pbm_a)
{ {
psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO); psycho_pbm_init_common(pbm, op, "PSYCHO", PBM_CHIP_TYPE_PSYCHO);
psycho_pbm_strbuf_init(pbm, is_pbm_a); psycho_pbm_strbuf_init(pbm, is_pbm_a);
...@@ -503,7 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid) ...@@ -503,7 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)
#define PSYCHO_CONFIGSPACE 0x001000000UL #define PSYCHO_CONFIGSPACE 0x001000000UL
static int __devinit psycho_probe(struct of_device *op, static int __devinit psycho_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *pr_regs; const struct linux_prom64_registers *pr_regs;
......
...@@ -311,7 +311,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id) ...@@ -311,7 +311,7 @@ static irqreturn_t sabre_ce_intr(int irq, void *dev_id)
static void sabre_register_error_handlers(struct pci_pbm_info *pbm) static void sabre_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct device_node *dp = pbm->op->dev.of_node; struct device_node *dp = pbm->op->dev.of_node;
struct of_device *op; struct platform_device *op;
unsigned long base = pbm->controller_regs; unsigned long base = pbm->controller_regs;
u64 tmp; u64 tmp;
int err; int err;
...@@ -443,7 +443,7 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm, ...@@ -443,7 +443,7 @@ static void __devinit sabre_scan_bus(struct pci_pbm_info *pbm,
} }
static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op) struct platform_device *op)
{ {
psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE); psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);
pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR; pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR;
...@@ -452,7 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm, ...@@ -452,7 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
sabre_scan_bus(pbm, &op->dev); sabre_scan_bus(pbm, &op->dev);
} }
static int __devinit sabre_probe(struct of_device *op, static int __devinit sabre_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *pr_regs; const struct linux_prom64_registers *pr_regs;
......
...@@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino) ...@@ -844,7 +844,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
*/ */
static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
u64 tmp, err_mask, err_no_mask; u64 tmp, err_mask, err_no_mask;
int err; int err;
...@@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm) ...@@ -939,7 +939,7 @@ static void tomatillo_register_error_handlers(struct pci_pbm_info *pbm)
static void schizo_register_error_handlers(struct pci_pbm_info *pbm) static void schizo_register_error_handlers(struct pci_pbm_info *pbm)
{ {
struct of_device *op = of_find_device_by_node(pbm->op->dev.of_node); struct platform_device *op = of_find_device_by_node(pbm->op->dev.of_node);
u64 tmp, err_mask, err_no_mask; u64 tmp, err_mask, err_no_mask;
int err; int err;
...@@ -1307,7 +1307,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm) ...@@ -1307,7 +1307,7 @@ static void schizo_pbm_hw_init(struct pci_pbm_info *pbm)
} }
static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm, static int __devinit schizo_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 portid, struct platform_device *op, u32 portid,
int chip_type) int chip_type)
{ {
const struct linux_prom64_registers *regs; const struct linux_prom64_registers *regs;
...@@ -1413,7 +1413,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid, ...@@ -1413,7 +1413,7 @@ static struct pci_pbm_info * __devinit schizo_find_sibling(u32 portid,
return NULL; return NULL;
} }
static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type) static int __devinit __schizo_init(struct platform_device *op, unsigned long chip_type)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
struct pci_pbm_info *pbm; struct pci_pbm_info *pbm;
...@@ -1460,7 +1460,7 @@ static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type ...@@ -1460,7 +1460,7 @@ static int __devinit __schizo_init(struct of_device *op, unsigned long chip_type
return err; return err;
} }
static int __devinit schizo_probe(struct of_device *op, static int __devinit schizo_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
return __schizo_init(op, (unsigned long) match->data); return __schizo_init(op, (unsigned long) match->data);
......
...@@ -879,7 +879,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm) ...@@ -879,7 +879,7 @@ static void pci_sun4v_msi_init(struct pci_pbm_info *pbm)
#endif /* !(CONFIG_PCI_MSI) */ #endif /* !(CONFIG_PCI_MSI) */
static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
struct of_device *op, u32 devhandle) struct platform_device *op, u32 devhandle)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
int err; int err;
...@@ -918,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm, ...@@ -918,7 +918,7 @@ static int __devinit pci_sun4v_pbm_init(struct pci_pbm_info *pbm,
return 0; return 0;
} }
static int __devinit pci_sun4v_probe(struct of_device *op, static int __devinit pci_sun4v_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
const struct linux_prom64_registers *regs; const struct linux_prom64_registers *regs;
......
...@@ -51,7 +51,7 @@ static void pmc_swift_idle(void) ...@@ -51,7 +51,7 @@ static void pmc_swift_idle(void)
#endif #endif
} }
static int __devinit pmc_probe(struct of_device *op, static int __devinit pmc_probe(struct platform_device *op,
const struct of_device_id *match) const struct of_device_id *match)
{ {
regs = of_ioremap(&op->resource[0], 0, regs = of_ioremap(&op->resource[0], 0,
......
...@@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node * ...@@ -33,7 +33,7 @@ static int __devinit has_button_interrupt(unsigned int irq, struct device_node *
return 1; return 1;
} }
static int __devinit power_probe(struct of_device *op, const struct of_device_id *match) static int __devinit power_probe(struct platform_device *op, const struct of_device_id *match)
{ {
struct resource *res = &op->resource[0]; struct resource *res = &op->resource[0];
unsigned int irq = op->archdata.irqs[0]; unsigned int irq = op->archdata.irqs[0];
......
...@@ -719,7 +719,7 @@ static unsigned int central_build_irq(struct device_node *dp, ...@@ -719,7 +719,7 @@ static unsigned int central_build_irq(struct device_node *dp,
void *_data) void *_data)
{ {
struct device_node *central_dp = _data; struct device_node *central_dp = _data;
struct of_device *central_op = of_find_device_by_node(central_dp); struct platform_device *central_op = of_find_device_by_node(central_dp);
struct resource *res; struct resource *res;
unsigned long imap, iclr; unsigned long imap, iclr;
u32 tmp; u32 tmp;
......
...@@ -447,7 +447,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, ...@@ -447,7 +447,7 @@ int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
} }
void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct of_device *op, void psycho_pbm_init_common(struct pci_pbm_info *pbm, struct platform_device *op,
const char *chip_name, int chip_type) const char *chip_name, int chip_type)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
......
...@@ -42,7 +42,7 @@ extern int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize, ...@@ -42,7 +42,7 @@ extern int psycho_iommu_init(struct pci_pbm_info *pbm, int tsbsize,
unsigned long write_complete_offset); unsigned long write_complete_offset);
extern void psycho_pbm_init_common(struct pci_pbm_info *pbm, extern void psycho_pbm_init_common(struct pci_pbm_info *pbm,
struct of_device *op, struct platform_device *op,
const char *chip_name, int chip_type); const char *chip_name, int chip_type);
#endif /* _PSYCHO_COMMON_H */ #endif /* _PSYCHO_COMMON_H */
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
void sbus_set_sbus64(struct device *dev, int bursts) void sbus_set_sbus64(struct device *dev, int bursts)
{ {
struct iommu *iommu = dev->archdata.iommu; struct iommu *iommu = dev->archdata.iommu;
struct of_device *op = to_of_device(dev); struct platform_device *op = to_platform_device(dev);
const struct linux_prom_registers *regs; const struct linux_prom_registers *regs;
unsigned long cfg_reg; unsigned long cfg_reg;
int slot; int slot;
...@@ -204,7 +204,7 @@ static unsigned long sysio_imap_to_iclr(unsigned long imap) ...@@ -204,7 +204,7 @@ static unsigned long sysio_imap_to_iclr(unsigned long imap)
return imap + diff; return imap + diff;
} }
static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino) static unsigned int sbus_build_irq(struct platform_device *op, unsigned int ino)
{ {
struct iommu *iommu = op->dev.archdata.iommu; struct iommu *iommu = op->dev.archdata.iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
...@@ -267,7 +267,7 @@ static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino) ...@@ -267,7 +267,7 @@ static unsigned int sbus_build_irq(struct of_device *op, unsigned int ino)
#define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ #define SYSIO_UEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_ue_handler(int irq, void *dev_id) static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
{ {
struct of_device *op = dev_id; struct platform_device *op = dev_id;
struct iommu *iommu = op->dev.archdata.iommu; struct iommu *iommu = op->dev.archdata.iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned long afsr_reg, afar_reg; unsigned long afsr_reg, afar_reg;
...@@ -341,7 +341,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id) ...@@ -341,7 +341,7 @@ static irqreturn_t sysio_ue_handler(int irq, void *dev_id)
#define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */ #define SYSIO_CEAFSR_RESV2 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_ce_handler(int irq, void *dev_id) static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
{ {
struct of_device *op = dev_id; struct platform_device *op = dev_id;
struct iommu *iommu = op->dev.archdata.iommu; struct iommu *iommu = op->dev.archdata.iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
unsigned long afsr_reg, afar_reg; unsigned long afsr_reg, afar_reg;
...@@ -420,7 +420,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id) ...@@ -420,7 +420,7 @@ static irqreturn_t sysio_ce_handler(int irq, void *dev_id)
#define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */ #define SYSIO_SBAFSR_RESV3 0x0000001fffffffffUL /* Reserved */
static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
{ {
struct of_device *op = dev_id; struct platform_device *op = dev_id;
struct iommu *iommu = op->dev.archdata.iommu; struct iommu *iommu = op->dev.archdata.iommu;
unsigned long afsr_reg, afar_reg, reg_base; unsigned long afsr_reg, afar_reg, reg_base;
unsigned long afsr, afar, error_bits; unsigned long afsr, afar, error_bits;
...@@ -488,7 +488,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id) ...@@ -488,7 +488,7 @@ static irqreturn_t sysio_sbus_error_handler(int irq, void *dev_id)
#define SYSIO_CE_INO 0x35 #define SYSIO_CE_INO 0x35
#define SYSIO_SBUSERR_INO 0x36 #define SYSIO_SBUSERR_INO 0x36
static void __init sysio_register_error_handlers(struct of_device *op) static void __init sysio_register_error_handlers(struct platform_device *op)
{ {
struct iommu *iommu = op->dev.archdata.iommu; struct iommu *iommu = op->dev.archdata.iommu;
unsigned long reg_base = iommu->write_complete_reg - 0x2000UL; unsigned long reg_base = iommu->write_complete_reg - 0x2000UL;
...@@ -534,7 +534,7 @@ static void __init sysio_register_error_handlers(struct of_device *op) ...@@ -534,7 +534,7 @@ static void __init sysio_register_error_handlers(struct of_device *op)
} }
/* Boot time initialization. */ /* Boot time initialization. */
static void __init sbus_iommu_init(struct of_device *op) static void __init sbus_iommu_init(struct platform_device *op)
{ {
const struct linux_prom64_registers *pr; const struct linux_prom64_registers *pr;
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
...@@ -663,7 +663,7 @@ static int __init sbus_init(void) ...@@ -663,7 +663,7 @@ static int __init sbus_init(void)
struct device_node *dp; struct device_node *dp;
for_each_node_by_name(dp, "sbus") { for_each_node_by_name(dp, "sbus") {
struct of_device *op = of_find_device_by_node(dp); struct platform_device *op = of_find_device_by_node(dp);
sbus_iommu_init(op); sbus_iommu_init(op);
of_propagate_archdata(op); of_propagate_archdata(op);
......
...@@ -142,7 +142,7 @@ static struct platform_device m48t59_rtc = { ...@@ -142,7 +142,7 @@ static struct platform_device m48t59_rtc = {
}, },
}; };
static int __devinit clock_probe(struct of_device *op, const struct of_device_id *match) static int __devinit clock_probe(struct platform_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
const char *model = of_get_property(dp, "model", NULL); const char *model = of_get_property(dp, "model", NULL);
......
...@@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = { ...@@ -419,7 +419,7 @@ static struct platform_device rtc_cmos_device = {
.num_resources = 1, .num_resources = 1,
}; };
static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *match) static int __devinit rtc_probe(struct platform_device *op, const struct of_device_id *match)
{ {
struct resource *r; struct resource *r;
...@@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = { ...@@ -477,7 +477,7 @@ static struct platform_device rtc_bq4802_device = {
.num_resources = 1, .num_resources = 1,
}; };
static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match) static int __devinit bq4802_probe(struct platform_device *op, const struct of_device_id *match)
{ {
printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n", printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
...@@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = { ...@@ -534,7 +534,7 @@ static struct platform_device m48t59_rtc = {
}, },
}; };
static int __devinit mostek_probe(struct of_device *op, const struct of_device_id *match) static int __devinit mostek_probe(struct platform_device *op, const struct of_device_id *match)
{ {
struct device_node *dp = op->dev.of_node; struct device_node *dp = op->dev.of_node;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID) #define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID)
#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM) #define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM)
static void __init iounit_iommu_init(struct of_device *op) static void __init iounit_iommu_init(struct platform_device *op)
{ {
struct iounit_struct *iounit; struct iounit_struct *iounit;
iopte_t *xpt, *xptend; iopte_t *xpt, *xptend;
...@@ -74,7 +74,7 @@ static int __init iounit_init(void) ...@@ -74,7 +74,7 @@ static int __init iounit_init(void)
struct device_node *dp; struct device_node *dp;
for_each_node_by_name(dp, "sbi") { for_each_node_by_name(dp, "sbi") {
struct of_device *op = of_find_device_by_node(dp); struct platform_device *op = of_find_device_by_node(dp);
iounit_iommu_init(op); iounit_iommu_init(op);
of_propagate_archdata(op); of_propagate_archdata(op);
......
...@@ -56,7 +56,7 @@ static pgprot_t dvma_prot; /* Consistent mapping pte flags */ ...@@ -56,7 +56,7 @@ static pgprot_t dvma_prot; /* Consistent mapping pte flags */
#define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID) #define IOPERM (IOPTE_CACHE | IOPTE_WRITE | IOPTE_VALID)
#define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ) #define MKIOPTE(pfn, perm) (((((pfn)<<8) & IOPTE_PAGE) | (perm)) & ~IOPTE_WAZ)
static void __init sbus_iommu_init(struct of_device *op) static void __init sbus_iommu_init(struct platform_device *op)
{ {
struct iommu_struct *iommu; struct iommu_struct *iommu;
unsigned int impl, vers; unsigned int impl, vers;
...@@ -132,7 +132,7 @@ static int __init iommu_init(void) ...@@ -132,7 +132,7 @@ static int __init iommu_init(void)
struct device_node *dp; struct device_node *dp;
for_each_node_by_name(dp, "iommu") { for_each_node_by_name(dp, "iommu") {
struct of_device *op = of_find_device_by_node(dp); struct platform_device *op = of_find_device_by_node(dp);
sbus_iommu_init(op); sbus_iommu_init(op);
of_propagate_archdata(op); of_propagate_archdata(op);
......
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