Commit 18d306d1 authored by Grant Likely's avatar Grant Likely

dt/spi: Eliminate users of of_platform_{,un}register_driver

Get rid of users of of_platform_driver in drivers/spi.  The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent e5263a51
...@@ -507,8 +507,7 @@ static int __devexit mpc512x_psc_spi_do_remove(struct device *dev) ...@@ -507,8 +507,7 @@ static int __devexit mpc512x_psc_spi_do_remove(struct device *dev)
return 0; return 0;
} }
static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op, static int __devinit mpc512x_psc_spi_of_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
const u32 *regaddr_p; const u32 *regaddr_p;
u64 regaddr64, size64; u64 regaddr64, size64;
...@@ -551,7 +550,7 @@ static struct of_device_id mpc512x_psc_spi_of_match[] = { ...@@ -551,7 +550,7 @@ static struct of_device_id mpc512x_psc_spi_of_match[] = {
MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match); MODULE_DEVICE_TABLE(of, mpc512x_psc_spi_of_match);
static struct of_platform_driver mpc512x_psc_spi_of_driver = { static struct platform_driver mpc512x_psc_spi_of_driver = {
.probe = mpc512x_psc_spi_of_probe, .probe = mpc512x_psc_spi_of_probe,
.remove = __devexit_p(mpc512x_psc_spi_of_remove), .remove = __devexit_p(mpc512x_psc_spi_of_remove),
.driver = { .driver = {
...@@ -563,13 +562,13 @@ static struct of_platform_driver mpc512x_psc_spi_of_driver = { ...@@ -563,13 +562,13 @@ static struct of_platform_driver mpc512x_psc_spi_of_driver = {
static int __init mpc512x_psc_spi_init(void) static int __init mpc512x_psc_spi_init(void)
{ {
return of_register_platform_driver(&mpc512x_psc_spi_of_driver); return platform_driver_register(&mpc512x_psc_spi_of_driver);
} }
module_init(mpc512x_psc_spi_init); module_init(mpc512x_psc_spi_init);
static void __exit mpc512x_psc_spi_exit(void) static void __exit mpc512x_psc_spi_exit(void)
{ {
of_unregister_platform_driver(&mpc512x_psc_spi_of_driver); platform_driver_unregister(&mpc512x_psc_spi_of_driver);
} }
module_exit(mpc512x_psc_spi_exit); module_exit(mpc512x_psc_spi_exit);
......
...@@ -450,8 +450,7 @@ static int __devinit mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, ...@@ -450,8 +450,7 @@ static int __devinit mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
return ret; return ret;
} }
static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op, static int __devinit mpc52xx_psc_spi_of_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
const u32 *regaddr_p; const u32 *regaddr_p;
u64 regaddr64, size64; u64 regaddr64, size64;
...@@ -503,7 +502,7 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = { ...@@ -503,7 +502,7 @@ static const struct of_device_id mpc52xx_psc_spi_of_match[] = {
MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
static struct of_platform_driver mpc52xx_psc_spi_of_driver = { static struct platform_driver mpc52xx_psc_spi_of_driver = {
.probe = mpc52xx_psc_spi_of_probe, .probe = mpc52xx_psc_spi_of_probe,
.remove = __devexit_p(mpc52xx_psc_spi_of_remove), .remove = __devexit_p(mpc52xx_psc_spi_of_remove),
.driver = { .driver = {
...@@ -515,13 +514,13 @@ static struct of_platform_driver mpc52xx_psc_spi_of_driver = { ...@@ -515,13 +514,13 @@ static struct of_platform_driver mpc52xx_psc_spi_of_driver = {
static int __init mpc52xx_psc_spi_init(void) static int __init mpc52xx_psc_spi_init(void)
{ {
return of_register_platform_driver(&mpc52xx_psc_spi_of_driver); return platform_driver_register(&mpc52xx_psc_spi_of_driver);
} }
module_init(mpc52xx_psc_spi_init); module_init(mpc52xx_psc_spi_init);
static void __exit mpc52xx_psc_spi_exit(void) static void __exit mpc52xx_psc_spi_exit(void)
{ {
of_unregister_platform_driver(&mpc52xx_psc_spi_of_driver); platform_driver_unregister(&mpc52xx_psc_spi_of_driver);
} }
module_exit(mpc52xx_psc_spi_exit); module_exit(mpc52xx_psc_spi_exit);
......
...@@ -390,8 +390,7 @@ static int mpc52xx_spi_transfer(struct spi_device *spi, struct spi_message *m) ...@@ -390,8 +390,7 @@ static int mpc52xx_spi_transfer(struct spi_device *spi, struct spi_message *m)
/* /*
* OF Platform Bus Binding * OF Platform Bus Binding
*/ */
static int __devinit mpc52xx_spi_probe(struct platform_device *op, static int __devinit mpc52xx_spi_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
struct spi_master *master; struct spi_master *master;
struct mpc52xx_spi *ms; struct mpc52xx_spi *ms;
...@@ -556,7 +555,7 @@ static const struct of_device_id mpc52xx_spi_match[] __devinitconst = { ...@@ -556,7 +555,7 @@ static const struct of_device_id mpc52xx_spi_match[] __devinitconst = {
}; };
MODULE_DEVICE_TABLE(of, mpc52xx_spi_match); MODULE_DEVICE_TABLE(of, mpc52xx_spi_match);
static struct of_platform_driver mpc52xx_spi_of_driver = { static struct platform_driver mpc52xx_spi_of_driver = {
.driver = { .driver = {
.name = "mpc52xx-spi", .name = "mpc52xx-spi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -568,13 +567,13 @@ static struct of_platform_driver mpc52xx_spi_of_driver = { ...@@ -568,13 +567,13 @@ static struct of_platform_driver mpc52xx_spi_of_driver = {
static int __init mpc52xx_spi_init(void) static int __init mpc52xx_spi_init(void)
{ {
return of_register_platform_driver(&mpc52xx_spi_of_driver); return platform_driver_register(&mpc52xx_spi_of_driver);
} }
module_init(mpc52xx_spi_init); module_init(mpc52xx_spi_init);
static void __exit mpc52xx_spi_exit(void) static void __exit mpc52xx_spi_exit(void)
{ {
of_unregister_platform_driver(&mpc52xx_spi_of_driver); platform_driver_unregister(&mpc52xx_spi_of_driver);
} }
module_exit(mpc52xx_spi_exit); module_exit(mpc52xx_spi_exit);
...@@ -685,8 +685,7 @@ static int of_fsl_espi_get_chipselects(struct device *dev) ...@@ -685,8 +685,7 @@ static int of_fsl_espi_get_chipselects(struct device *dev)
return 0; return 0;
} }
static int __devinit of_fsl_espi_probe(struct platform_device *ofdev, static int __devinit of_fsl_espi_probe(struct platform_device *ofdev)
const struct of_device_id *ofid)
{ {
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node; struct device_node *np = ofdev->dev.of_node;
...@@ -695,7 +694,7 @@ static int __devinit of_fsl_espi_probe(struct platform_device *ofdev, ...@@ -695,7 +694,7 @@ static int __devinit of_fsl_espi_probe(struct platform_device *ofdev,
struct resource irq; struct resource irq;
int ret = -ENOMEM; int ret = -ENOMEM;
ret = of_mpc8xxx_spi_probe(ofdev, ofid); ret = of_mpc8xxx_spi_probe(ofdev);
if (ret) if (ret)
return ret; return ret;
...@@ -736,7 +735,7 @@ static const struct of_device_id of_fsl_espi_match[] = { ...@@ -736,7 +735,7 @@ static const struct of_device_id of_fsl_espi_match[] = {
}; };
MODULE_DEVICE_TABLE(of, of_fsl_espi_match); MODULE_DEVICE_TABLE(of, of_fsl_espi_match);
static struct of_platform_driver fsl_espi_driver = { static struct platform_driver fsl_espi_driver = {
.driver = { .driver = {
.name = "fsl_espi", .name = "fsl_espi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -748,13 +747,13 @@ static struct of_platform_driver fsl_espi_driver = { ...@@ -748,13 +747,13 @@ static struct of_platform_driver fsl_espi_driver = {
static int __init fsl_espi_init(void) static int __init fsl_espi_init(void)
{ {
return of_register_platform_driver(&fsl_espi_driver); return platform_driver_register(&fsl_espi_driver);
} }
module_init(fsl_espi_init); module_init(fsl_espi_init);
static void __exit fsl_espi_exit(void) static void __exit fsl_espi_exit(void)
{ {
of_unregister_platform_driver(&fsl_espi_driver); platform_driver_unregister(&fsl_espi_driver);
} }
module_exit(fsl_espi_exit); module_exit(fsl_espi_exit);
......
...@@ -189,8 +189,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev) ...@@ -189,8 +189,7 @@ int __devexit mpc8xxx_spi_remove(struct device *dev)
return 0; return 0;
} }
int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev, int __devinit of_mpc8xxx_spi_probe(struct platform_device *ofdev)
const struct of_device_id *ofid)
{ {
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node; struct device_node *np = ofdev->dev.of_node;
......
...@@ -118,7 +118,6 @@ extern const char *mpc8xxx_spi_strmode(unsigned int flags); ...@@ -118,7 +118,6 @@ extern const char *mpc8xxx_spi_strmode(unsigned int flags);
extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
unsigned int irq); unsigned int irq);
extern int mpc8xxx_spi_remove(struct device *dev); extern int mpc8xxx_spi_remove(struct device *dev);
extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev, extern int of_mpc8xxx_spi_probe(struct platform_device *ofdev);
const struct of_device_id *ofid);
#endif /* __SPI_FSL_LIB_H__ */ #endif /* __SPI_FSL_LIB_H__ */
...@@ -1042,8 +1042,7 @@ static int of_fsl_spi_free_chipselects(struct device *dev) ...@@ -1042,8 +1042,7 @@ static int of_fsl_spi_free_chipselects(struct device *dev)
return 0; return 0;
} }
static int __devinit of_fsl_spi_probe(struct platform_device *ofdev, static int __devinit of_fsl_spi_probe(struct platform_device *ofdev)
const struct of_device_id *ofid)
{ {
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node; struct device_node *np = ofdev->dev.of_node;
...@@ -1052,7 +1051,7 @@ static int __devinit of_fsl_spi_probe(struct platform_device *ofdev, ...@@ -1052,7 +1051,7 @@ static int __devinit of_fsl_spi_probe(struct platform_device *ofdev,
struct resource irq; struct resource irq;
int ret = -ENOMEM; int ret = -ENOMEM;
ret = of_mpc8xxx_spi_probe(ofdev, ofid); ret = of_mpc8xxx_spi_probe(ofdev);
if (ret) if (ret)
return ret; return ret;
...@@ -1100,7 +1099,7 @@ static const struct of_device_id of_fsl_spi_match[] = { ...@@ -1100,7 +1099,7 @@ static const struct of_device_id of_fsl_spi_match[] = {
}; };
MODULE_DEVICE_TABLE(of, of_fsl_spi_match); MODULE_DEVICE_TABLE(of, of_fsl_spi_match);
static struct of_platform_driver of_fsl_spi_driver = { static struct platform_driver of_fsl_spi_driver = {
.driver = { .driver = {
.name = "fsl_spi", .name = "fsl_spi",
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -1177,13 +1176,13 @@ static void __exit legacy_driver_unregister(void) {} ...@@ -1177,13 +1176,13 @@ static void __exit legacy_driver_unregister(void) {}
static int __init fsl_spi_init(void) static int __init fsl_spi_init(void)
{ {
legacy_driver_register(); legacy_driver_register();
return of_register_platform_driver(&of_fsl_spi_driver); return platform_driver_register(&of_fsl_spi_driver);
} }
module_init(fsl_spi_init); module_init(fsl_spi_init);
static void __exit fsl_spi_exit(void) static void __exit fsl_spi_exit(void)
{ {
of_unregister_platform_driver(&of_fsl_spi_driver); platform_driver_unregister(&of_fsl_spi_driver);
legacy_driver_unregister(); legacy_driver_unregister();
} }
module_exit(fsl_spi_exit); module_exit(fsl_spi_exit);
......
...@@ -390,8 +390,7 @@ static void free_gpios(struct ppc4xx_spi *hw) ...@@ -390,8 +390,7 @@ static void free_gpios(struct ppc4xx_spi *hw)
/* /*
* platform_device layer stuff... * platform_device layer stuff...
*/ */
static int __init spi_ppc4xx_of_probe(struct platform_device *op, static int __init spi_ppc4xx_of_probe(struct platform_device *op)
const struct of_device_id *match)
{ {
struct ppc4xx_spi *hw; struct ppc4xx_spi *hw;
struct spi_master *master; struct spi_master *master;
...@@ -586,7 +585,7 @@ static const struct of_device_id spi_ppc4xx_of_match[] = { ...@@ -586,7 +585,7 @@ static const struct of_device_id spi_ppc4xx_of_match[] = {
MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match); MODULE_DEVICE_TABLE(of, spi_ppc4xx_of_match);
static struct of_platform_driver spi_ppc4xx_of_driver = { static struct platform_driver spi_ppc4xx_of_driver = {
.probe = spi_ppc4xx_of_probe, .probe = spi_ppc4xx_of_probe,
.remove = __exit_p(spi_ppc4xx_of_remove), .remove = __exit_p(spi_ppc4xx_of_remove),
.driver = { .driver = {
...@@ -598,13 +597,13 @@ static struct of_platform_driver spi_ppc4xx_of_driver = { ...@@ -598,13 +597,13 @@ static struct of_platform_driver spi_ppc4xx_of_driver = {
static int __init spi_ppc4xx_init(void) static int __init spi_ppc4xx_init(void)
{ {
return of_register_platform_driver(&spi_ppc4xx_of_driver); return platform_driver_register(&spi_ppc4xx_of_driver);
} }
module_init(spi_ppc4xx_init); module_init(spi_ppc4xx_init);
static void __exit spi_ppc4xx_exit(void) static void __exit spi_ppc4xx_exit(void)
{ {
of_unregister_platform_driver(&spi_ppc4xx_of_driver); platform_driver_unregister(&spi_ppc4xx_of_driver);
} }
module_exit(spi_ppc4xx_exit); module_exit(spi_ppc4xx_exit);
......
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