Skip to content

Commit

Permalink
sparc: remove references to of_device and to_of_device
Browse files Browse the repository at this point in the history
of_device is just a #define alias to platform_device.  This patch
replaces all references to it with platform_device.

Signed-off-by: Grant Likely <[email protected]>
Acked-by: David S. Miller <[email protected]>
  • Loading branch information
glikely committed Jul 24, 2010
1 parent a454dc5 commit cd4cd73
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 74 deletions.
2 changes: 1 addition & 1 deletion arch/sparc/include/asm/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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.
*/
static inline void irq_dispose_mapping(unsigned int virq)
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/apc.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static void apc_swift_idle(void)
#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]));
}
Expand Down Expand Up @@ -136,7 +136,7 @@ static const struct file_operations 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)
{
int err;
Expand Down
3 changes: 2 additions & 1 deletion arch/sparc/kernel/auxio_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ static struct of_device_id __initdata 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;
unsigned long size;
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/central.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct clock_board *p = kzalloc(sizeof(*p), GFP_KERNEL);
Expand Down Expand Up @@ -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)
{
struct fhc *p = kzalloc(sizeof(*p), GFP_KERNEL);
Expand Down
12 changes: 6 additions & 6 deletions arch/sparc/kernel/chmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 linux_prom64_registers *mem_regs;
Expand Down Expand Up @@ -690,7 +690,7 @@ static void chmc_fetch_decode_regs(struct chmc *p)
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)
{
struct device_node *dp = op->dev.of_node;
Expand Down Expand Up @@ -765,7 +765,7 @@ static int __devinit chmc_probe(struct of_device *op,
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)
{
if (mc_type == MC_TYPE_SAFARI)
Expand All @@ -775,21 +775,21 @@ static int __devinit us3mc_probe(struct of_device *op,
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);
of_iounmap(&op->resource[0], p->regs, 0x48);
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);
of_iounmap(&op->resource[0], p->regs, JBUSMC_REGS_SIZE);
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);

Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/ioport.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ EXPORT_SYMBOL(sbus_set_sbus64);
static void *sbus_alloc_coherent(struct device *dev, size_t len,
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 va;
struct resource *res;
Expand Down
14 changes: 7 additions & 7 deletions arch/sparc/kernel/of_device_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ static int __init use_1to1_mapping(struct device_node *pp)

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 of_device *p_op;
struct platform_device *p_op;
struct of_bus *bus;
int na, ns;
int index, num_reg;
Expand All @@ -253,7 +253,7 @@ static void __init build_device_resources(struct of_device *op,
if (!parent)
return;

p_op = to_of_device(parent);
p_op = to_platform_device(parent);
bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->dev.of_node, &na, &ns);

Expand Down Expand Up @@ -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 of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const struct linux_prom_irqs *intr;
struct dev_archdata *sd;
int len, i;
Expand Down Expand Up @@ -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)
{
while (dp) {
struct of_device *op = scan_one_device(dp, parent);
struct platform_device *op = scan_one_device(dp, parent);

if (op)
scan_tree(dp->child, &op->dev);
Expand All @@ -455,7 +455,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
static int __init scan_of_devices(void)
{
struct device_node *root = of_find_node_by_path("/");
struct of_device *parent;
struct platform_device *parent;

parent = scan_one_device(root, NULL);
if (!parent)
Expand Down
16 changes: 8 additions & 8 deletions arch/sparc/kernel/of_device_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ static int __init use_1to1_mapping(struct device_node *pp)

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 of_device *p_op;
struct platform_device *p_op;
struct of_bus *bus;
int na, ns;
int index, num_reg;
Expand All @@ -322,7 +322,7 @@ static void __init build_device_resources(struct of_device *op,
if (!parent)
return;

p_op = to_of_device(parent);
p_op = to_platform_device(parent);
bus = of_match_bus(p_op->dev.of_node);
bus->count_cells(op->dev.of_node, &na, &ns);

Expand Down Expand Up @@ -528,7 +528,7 @@ static unsigned int __init pci_irq_swizzle(struct device_node *dp,

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,
unsigned int irq)
{
Expand Down Expand Up @@ -630,10 +630,10 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
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 of_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
struct platform_device *op = kzalloc(sizeof(*op), GFP_KERNEL);
const unsigned int *irq;
struct dev_archdata *sd;
int len, i;
Expand Down Expand Up @@ -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)
{
while (dp) {
struct of_device *op = scan_one_device(dp, parent);
struct platform_device *op = scan_one_device(dp, parent);

if (op)
scan_tree(dp->child, &op->dev);
Expand All @@ -698,7 +698,7 @@ static void __init scan_tree(struct device_node *dp, struct device *parent)
static int __init scan_of_devices(void)
{
struct device_node *root = of_find_node_by_path("/");
struct of_device *parent;
struct platform_device *parent;

parent = scan_one_device(root, NULL);
if (!parent)
Expand Down
14 changes: 7 additions & 7 deletions arch/sparc/kernel/of_device_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@

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;

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,
dp, node_match);

if (dev)
return to_of_device(dev);
return to_platform_device(dev);

return NULL;
}
EXPORT_SYMBOL(of_find_device_by_node);

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)
return 0;
Expand All @@ -43,16 +43,16 @@ unsigned int irq_of_parse_and_map(struct device_node *node, int index)
EXPORT_SYMBOL(irq_of_parse_and_map);

/* 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 device_node *bus_dp = bus->dev.of_node;
struct device_node *dp;

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.stc = bus_sd->stc;
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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 pci_dev *dev)
{
Expand Down Expand Up @@ -248,7 +248,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
{
struct dev_archdata *sd;
struct pci_slot *slot;
struct of_device *op;
struct platform_device *op;
struct pci_dev *dev;
const char *type;
u32 class;
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/pci_fire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct of_device *op, u32 portid)
struct platform_device *op, u32 portid)
{
const struct linux_prom64_registers *regs;
struct device_node *dp = op->dev.of_node;
Expand Down Expand Up @@ -455,7 +455,7 @@ static int __devinit pci_fire_pbm_init(struct pci_pbm_info *pbm,
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)
{
struct device_node *dp = op->dev.of_node;
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/pci_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct pci_pbm_info {
char *name;

/* OBP specific information. */
struct of_device *op;
struct platform_device *op;
u64 ino_bitmap;

/* PBM I/O and Memory space resources. */
Expand Down
6 changes: 3 additions & 3 deletions arch/sparc/kernel/pci_psycho.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static irqreturn_t psycho_ce_intr(int irq, void *dev_id)
#define PSYCHO_ECCCTRL_CE 0x2000000000000000UL /* Enable CE INterrupts */
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;
u64 tmp;
int err;
Expand Down Expand Up @@ -483,7 +483,7 @@ static void psycho_pbm_strbuf_init(struct pci_pbm_info *pbm,
#define PSYCHO_MEMSPACE_SIZE 0x07fffffffUL

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_strbuf_init(pbm, is_pbm_a);
Expand All @@ -503,7 +503,7 @@ static struct pci_pbm_info * __devinit psycho_find_sibling(u32 upa_portid)

#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 linux_prom64_registers *pr_regs;
Expand Down
6 changes: 3 additions & 3 deletions arch/sparc/kernel/pci_sabre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct device_node *dp = pbm->op->dev.of_node;
struct of_device *op;
struct platform_device *op;
unsigned long base = pbm->controller_regs;
u64 tmp;
int err;
Expand Down Expand Up @@ -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,
struct of_device *op)
struct platform_device *op)
{
psycho_pbm_init_common(pbm, op, "SABRE", PBM_CHIP_TYPE_SABRE);
pbm->pci_afsr = pbm->controller_regs + SABRE_PIOAFSR;
Expand All @@ -452,7 +452,7 @@ static void __devinit sabre_pbm_init(struct pci_pbm_info *pbm,
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 linux_prom64_registers *pr_regs;
Expand Down
Loading

0 comments on commit cd4cd73

Please sign in to comment.