of/device: Replace struct of_device with struct platform_device

of_device is just an alias for platform_device, so remove it entirely.  Also
replace to_of_device() with to_platform_device() and update comment blocks.

This patch was initially generated from the following semantic patch, and then
edited by hand to pick up the bits that coccinelle didn't catch.

@@
@@
-struct of_device
+struct platform_device

Signed-off-by: Grant Likely <[email protected]>
Reviewed-by: David S. Miller <[email protected]>
This commit is contained in:
Grant Likely 2010-08-06 09:25:50 -06:00
commit 2dc1158137
158 changed files with 519 additions and 527 deletions

View file

@ -43,7 +43,7 @@ struct of_flash {
#ifdef CONFIG_MTD_PARTITIONS
#define OF_FLASH_PARTS(info) ((info)->parts)
static int parse_obsolete_partitions(struct of_device *dev,
static int parse_obsolete_partitions(struct platform_device *dev,
struct of_flash *info,
struct device_node *dp)
{
@ -93,7 +93,7 @@ static int parse_obsolete_partitions(struct of_device *dev,
#define parse_partitions(info, dev) (0)
#endif /* MTD_PARTITIONS */
static int of_flash_remove(struct of_device *dev)
static int of_flash_remove(struct platform_device *dev)
{
struct of_flash *info;
int i;
@ -140,7 +140,7 @@ static int of_flash_remove(struct of_device *dev)
/* Helper function to handle probing of the obsolete "direct-mapped"
* compatible binding, which has an extra "probe-type" property
* describing the type of flash probe necessary. */
static struct mtd_info * __devinit obsolete_probe(struct of_device *dev,
static struct mtd_info * __devinit obsolete_probe(struct platform_device *dev,
struct map_info *map)
{
struct device_node *dp = dev->dev.of_node;
@ -215,7 +215,7 @@ static void __devinit of_free_probes(const char **probes)
}
#endif
static int __devinit of_flash_probe(struct of_device *dev,
static int __devinit of_flash_probe(struct platform_device *dev,
const struct of_device_id *match)
{
#ifdef CONFIG_MTD_PARTITIONS

View file

@ -48,7 +48,7 @@ struct map_info uflash_map_templ = {
.bankwidth = UFLASH_BUSWIDTH,
};
int uflash_devinit(struct of_device *op, struct device_node *dp)
int uflash_devinit(struct platform_device *op, struct device_node *dp)
{
struct uflash_dev *up;
@ -108,7 +108,7 @@ int uflash_devinit(struct of_device *op, struct device_node *dp)
return 0;
}
static int __devinit uflash_probe(struct of_device *op, const struct of_device_id *match)
static int __devinit uflash_probe(struct platform_device *op, const struct of_device_id *match)
{
struct device_node *dp = op->dev.of_node;
@ -121,7 +121,7 @@ static int __devinit uflash_probe(struct of_device *op, const struct of_device_i
return uflash_devinit(op, dp);
}
static int __devexit uflash_remove(struct of_device *op)
static int __devexit uflash_remove(struct platform_device *op)
{
struct uflash_dev *up = dev_get_drvdata(&op->dev);

View file

@ -958,7 +958,7 @@ static int __devinit fsl_elbc_ctrl_init(struct fsl_elbc_ctrl *ctrl)
return 0;
}
static int fsl_elbc_ctrl_remove(struct of_device *ofdev)
static int fsl_elbc_ctrl_remove(struct platform_device *ofdev)
{
struct fsl_elbc_ctrl *ctrl = dev_get_drvdata(&ofdev->dev);
int i;
@ -1013,7 +1013,7 @@ static irqreturn_t fsl_elbc_ctrl_irq(int irqno, void *data)
* in the chip probe function.
*/
static int __devinit fsl_elbc_ctrl_probe(struct of_device *ofdev,
static int __devinit fsl_elbc_ctrl_probe(struct platform_device *ofdev,
const struct of_device_id *match)
{
struct device_node *child;

View file

@ -217,7 +217,7 @@ err:
return ret;
}
static int __devinit fun_probe(struct of_device *ofdev,
static int __devinit fun_probe(struct platform_device *ofdev,
const struct of_device_id *ofid)
{
struct fsl_upm_nand *fun;
@ -335,7 +335,7 @@ err1:
return ret;
}
static int __devexit fun_remove(struct of_device *ofdev)
static int __devexit fun_remove(struct platform_device *ofdev)
{
struct fsl_upm_nand *fun = dev_get_drvdata(&ofdev->dev);
int i;

View file

@ -647,7 +647,7 @@ static void mpc5121_nfc_free(struct device *dev, struct mtd_info *mtd)
iounmap(prv->csreg);
}
static int __devinit mpc5121_nfc_probe(struct of_device *op,
static int __devinit mpc5121_nfc_probe(struct platform_device *op,
const struct of_device_id *match)
{
struct device_node *rootnode, *dn = op->dev.of_node;
@ -869,7 +869,7 @@ error:
return retval;
}
static int __devexit mpc5121_nfc_remove(struct of_device *op)
static int __devexit mpc5121_nfc_remove(struct platform_device *op)
{
struct device *dev = &op->dev;
struct mtd_info *mtd = dev_get_drvdata(dev);

View file

@ -35,7 +35,7 @@
struct ndfc_controller {
struct of_device *ofdev;
struct platform_device *ofdev;
void __iomem *ndfcbase;
struct mtd_info mtd;
struct nand_chip chip;
@ -225,7 +225,7 @@ err:
return ret;
}
static int __devinit ndfc_probe(struct of_device *ofdev,
static int __devinit ndfc_probe(struct platform_device *ofdev,
const struct of_device_id *match)
{
struct ndfc_controller *ndfc = &ndfc_ctrl;
@ -277,7 +277,7 @@ static int __devinit ndfc_probe(struct of_device *ofdev,
return 0;
}
static int __devexit ndfc_remove(struct of_device *ofdev)
static int __devexit ndfc_remove(struct platform_device *ofdev)
{
struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);

View file

@ -89,7 +89,7 @@ int pasemi_device_ready(struct mtd_info *mtd)
return !!(inl(lpcctl) & LBICTRL_LPCCTL_NR);
}
static int __devinit pasemi_nand_probe(struct of_device *ofdev,
static int __devinit pasemi_nand_probe(struct platform_device *ofdev,
const struct of_device_id *match)
{
struct pci_dev *pdev;
@ -185,7 +185,7 @@ static int __devinit pasemi_nand_probe(struct of_device *ofdev,
return err;
}
static int __devexit pasemi_nand_remove(struct of_device *ofdev)
static int __devexit pasemi_nand_remove(struct platform_device *ofdev)
{
struct nand_chip *chip;

View file

@ -162,7 +162,7 @@ static const char *part_probes[] = { "cmdlinepart", NULL };
/*
* Probe for the NAND device.
*/
static int __devinit socrates_nand_probe(struct of_device *ofdev,
static int __devinit socrates_nand_probe(struct platform_device *ofdev,
const struct of_device_id *ofid)
{
struct socrates_nand_host *host;
@ -276,7 +276,7 @@ out:
/*
* Remove a NAND device.
*/
static int __devexit socrates_nand_remove(struct of_device *ofdev)
static int __devexit socrates_nand_remove(struct platform_device *ofdev)
{
struct socrates_nand_host *host = dev_get_drvdata(&ofdev->dev);
struct mtd_info *mtd = &host->mtd;