Skip to content

Commit

Permalink
dt: Eliminate of_platform_{,un}register_driver
Browse files Browse the repository at this point in the history
Final step to eliminate of_platform_bus_type.  They're all just
platform drivers now.

v2: fix type in pasemi_nand.c (thanks to Stephen Rothwell)

Signed-off-by: Grant Likely <[email protected]>
  • Loading branch information
glikely committed Feb 28, 2011
1 parent 793218d commit 1c48a5c
Show file tree
Hide file tree
Showing 27 changed files with 134 additions and 148 deletions.
8 changes: 4 additions & 4 deletions drivers/ata/pata_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ mpc52xx_ata_remove_one(struct device *dev)
/* ======================================================================== */

static int __devinit
mpc52xx_ata_probe(struct platform_device *op, const struct of_device_id *match)
mpc52xx_ata_probe(struct platform_device *op)
{
unsigned int ipb_freq;
struct resource res_mem;
Expand Down Expand Up @@ -883,7 +883,7 @@ static struct of_device_id mpc52xx_ata_of_match[] = {
};


static struct of_platform_driver mpc52xx_ata_of_platform_driver = {
static struct platform_driver mpc52xx_ata_of_platform_driver = {
.probe = mpc52xx_ata_probe,
.remove = mpc52xx_ata_remove,
#ifdef CONFIG_PM
Expand All @@ -906,13 +906,13 @@ static int __init
mpc52xx_ata_init(void)
{
printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n");
return of_register_platform_driver(&mpc52xx_ata_of_platform_driver);
return platform_driver_register(&mpc52xx_ata_of_platform_driver);
}

static void __exit
mpc52xx_ata_exit(void)
{
of_unregister_platform_driver(&mpc52xx_ata_of_platform_driver);
platform_driver_unregister(&mpc52xx_ata_of_platform_driver);
}

module_init(mpc52xx_ata_init);
Expand Down
9 changes: 4 additions & 5 deletions drivers/ata/pata_of_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include <linux/of_platform.h>
#include <linux/ata_platform.h>

static int __devinit pata_of_platform_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit pata_of_platform_probe(struct platform_device *ofdev)
{
int ret;
struct device_node *dn = ofdev->dev.of_node;
Expand Down Expand Up @@ -90,7 +89,7 @@ static struct of_device_id pata_of_platform_match[] = {
};
MODULE_DEVICE_TABLE(of, pata_of_platform_match);

static struct of_platform_driver pata_of_platform_driver = {
static struct platform_driver pata_of_platform_driver = {
.driver = {
.name = "pata_of_platform",
.owner = THIS_MODULE,
Expand All @@ -102,13 +101,13 @@ static struct of_platform_driver pata_of_platform_driver = {

static int __init pata_of_platform_init(void)
{
return of_register_platform_driver(&pata_of_platform_driver);
return platform_driver_register(&pata_of_platform_driver);
}
module_init(pata_of_platform_init);

static void __exit pata_of_platform_exit(void)
{
of_unregister_platform_driver(&pata_of_platform_driver);
platform_driver_unregister(&pata_of_platform_driver);
}
module_exit(pata_of_platform_exit);

Expand Down
9 changes: 4 additions & 5 deletions drivers/ata/sata_dwc_460ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,8 +1588,7 @@ static const struct ata_port_info sata_dwc_port_info[] = {
},
};

static int sata_dwc_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int sata_dwc_probe(struct platform_device *ofdev)
{
struct sata_dwc_device *hsdev;
u32 idr, versionr;
Expand Down Expand Up @@ -1727,7 +1726,7 @@ static const struct of_device_id sata_dwc_match[] = {
};
MODULE_DEVICE_TABLE(of, sata_dwc_match);

static struct of_platform_driver sata_dwc_driver = {
static struct platform_driver sata_dwc_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
Expand All @@ -1739,12 +1738,12 @@ static struct of_platform_driver sata_dwc_driver = {

static int __init sata_dwc_init(void)
{
return of_register_platform_driver(&sata_dwc_driver);
return platform_driver_register(&sata_dwc_driver);
}

static void __exit sata_dwc_exit(void)
{
of_unregister_platform_driver(&sata_dwc_driver);
platform_driver_unregister(&sata_dwc_driver);
}

module_init(sata_dwc_init);
Expand Down
9 changes: 4 additions & 5 deletions drivers/ata/sata_fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,8 +1293,7 @@ static const struct ata_port_info sata_fsl_port_info[] = {
},
};

static int sata_fsl_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int sata_fsl_probe(struct platform_device *ofdev)
{
int retval = -ENXIO;
void __iomem *hcr_base = NULL;
Expand Down Expand Up @@ -1423,7 +1422,7 @@ static struct of_device_id fsl_sata_match[] = {

MODULE_DEVICE_TABLE(of, fsl_sata_match);

static struct of_platform_driver fsl_sata_driver = {
static struct platform_driver fsl_sata_driver = {
.driver = {
.name = "fsl-sata",
.owner = THIS_MODULE,
Expand All @@ -1439,13 +1438,13 @@ static struct of_platform_driver fsl_sata_driver = {

static int __init sata_fsl_init(void)
{
of_register_platform_driver(&fsl_sata_driver);
platform_driver_register(&fsl_sata_driver);
return 0;
}

static void __exit sata_fsl_exit(void)
{
of_unregister_platform_driver(&fsl_sata_driver);
platform_driver_unregister(&fsl_sata_driver);
}

MODULE_LICENSE("GPL");
Expand Down
17 changes: 10 additions & 7 deletions drivers/atm/fore200e.c
Original file line number Diff line number Diff line change
Expand Up @@ -2643,14 +2643,17 @@ fore200e_init(struct fore200e* fore200e, struct device *parent)
}

#ifdef CONFIG_SBUS
static int __devinit fore200e_sba_probe(struct platform_device *op,
const struct of_device_id *match)
static int __devinit fore200e_sba_probe(struct platform_device *op)
{
const struct fore200e_bus *bus = match->data;
const struct fore200e_bus *bus;
struct fore200e *fore200e;
static int index = 0;
int err;

if (!op->dev.of_match)
return -EINVAL;
bus = op->dev.of_match->data;

fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
if (!fore200e)
return -ENOMEM;
Expand Down Expand Up @@ -2694,7 +2697,7 @@ static const struct of_device_id fore200e_sba_match[] = {
};
MODULE_DEVICE_TABLE(of, fore200e_sba_match);

static struct of_platform_driver fore200e_sba_driver = {
static struct platform_driver fore200e_sba_driver = {
.driver = {
.name = "fore_200e",
.owner = THIS_MODULE,
Expand Down Expand Up @@ -2795,7 +2798,7 @@ static int __init fore200e_module_init(void)
printk(FORE200E "FORE Systems 200E-series ATM driver - version " FORE200E_VERSION "\n");

#ifdef CONFIG_SBUS
err = of_register_platform_driver(&fore200e_sba_driver);
err = platform_driver_register(&fore200e_sba_driver);
if (err)
return err;
#endif
Expand All @@ -2806,7 +2809,7 @@ static int __init fore200e_module_init(void)

#ifdef CONFIG_SBUS
if (err)
of_unregister_platform_driver(&fore200e_sba_driver);
platform_driver_unregister(&fore200e_sba_driver);
#endif

return err;
Expand All @@ -2818,7 +2821,7 @@ static void __exit fore200e_module_cleanup(void)
pci_unregister_driver(&fore200e_pca_driver);
#endif
#ifdef CONFIG_SBUS
of_unregister_platform_driver(&fore200e_sba_driver);
platform_driver_unregister(&fore200e_sba_driver);
#endif
}

Expand Down
11 changes: 4 additions & 7 deletions drivers/block/xsysace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,16 +1195,13 @@ static struct platform_driver ace_platform_driver = {
*/

#if defined(CONFIG_OF)
static int __devinit
ace_of_probe(struct platform_device *op, const struct of_device_id *match)
static int __devinit ace_of_probe(struct platform_device *op)
{
struct resource res;
resource_size_t physaddr;
const u32 *id;
int irq, bus_width, rc;

dev_dbg(&op->dev, "ace_of_probe(%p, %p)\n", op, match);

/* device id */
id = of_get_property(op->dev.of_node, "port-number", NULL);

Expand Down Expand Up @@ -1245,7 +1242,7 @@ static const struct of_device_id ace_of_match[] __devinitconst = {
};
MODULE_DEVICE_TABLE(of, ace_of_match);

static struct of_platform_driver ace_of_driver = {
static struct platform_driver ace_of_driver = {
.probe = ace_of_probe,
.remove = __devexit_p(ace_of_remove),
.driver = {
Expand All @@ -1259,12 +1256,12 @@ static struct of_platform_driver ace_of_driver = {
static inline int __init ace_of_register(void)
{
pr_debug("xsysace: registering OF binding\n");
return of_register_platform_driver(&ace_of_driver);
return platform_driver_register(&ace_of_driver);
}

static inline void __exit ace_of_unregister(void)
{
of_unregister_platform_driver(&ace_of_driver);
platform_driver_unregister(&ace_of_driver);
}
#else /* CONFIG_OF */
/* CONFIG_OF not enabled; do nothing helpers */
Expand Down
9 changes: 4 additions & 5 deletions drivers/crypto/talitos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2402,8 +2402,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
return t_alg;
}

static int talitos_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int talitos_probe(struct platform_device *ofdev)
{
struct device *dev = &ofdev->dev;
struct device_node *np = ofdev->dev.of_node;
Expand Down Expand Up @@ -2580,7 +2579,7 @@ static const struct of_device_id talitos_match[] = {
};
MODULE_DEVICE_TABLE(of, talitos_match);

static struct of_platform_driver talitos_driver = {
static struct platform_driver talitos_driver = {
.driver = {
.name = "talitos",
.owner = THIS_MODULE,
Expand All @@ -2592,13 +2591,13 @@ static struct of_platform_driver talitos_driver = {

static int __init talitos_init(void)
{
return of_register_platform_driver(&talitos_driver);
return platform_driver_register(&talitos_driver);
}
module_init(talitos_init);

static void __exit talitos_exit(void)
{
of_unregister_platform_driver(&talitos_driver);
platform_driver_unregister(&talitos_driver);
}
module_exit(talitos_exit);

Expand Down
9 changes: 4 additions & 5 deletions drivers/i2c/busses/i2c-cpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,7 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
cpm_muram_free(cpm->i2c_addr);
}

static int __devinit cpm_i2c_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit cpm_i2c_probe(struct platform_device *ofdev)
{
int result, len;
struct cpm_i2c *cpm;
Expand Down Expand Up @@ -718,7 +717,7 @@ static const struct of_device_id cpm_i2c_match[] = {

MODULE_DEVICE_TABLE(of, cpm_i2c_match);

static struct of_platform_driver cpm_i2c_driver = {
static struct platform_driver cpm_i2c_driver = {
.probe = cpm_i2c_probe,
.remove = __devexit_p(cpm_i2c_remove),
.driver = {
Expand All @@ -730,12 +729,12 @@ static struct of_platform_driver cpm_i2c_driver = {

static int __init cpm_i2c_init(void)
{
return of_register_platform_driver(&cpm_i2c_driver);
return platform_driver_register(&cpm_i2c_driver);
}

static void __exit cpm_i2c_exit(void)
{
of_unregister_platform_driver(&cpm_i2c_driver);
platform_driver_unregister(&cpm_i2c_driver);
}

module_init(cpm_i2c_init);
Expand Down
9 changes: 4 additions & 5 deletions drivers/i2c/busses/i2c-ibm_iic.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,7 @@ static int __devinit iic_request_irq(struct platform_device *ofdev,
/*
* Register single IIC interface
*/
static int __devinit iic_probe(struct platform_device *ofdev,
const struct of_device_id *match)
static int __devinit iic_probe(struct platform_device *ofdev)
{
struct device_node *np = ofdev->dev.of_node;
struct ibm_iic_private *dev;
Expand Down Expand Up @@ -806,7 +805,7 @@ static const struct of_device_id ibm_iic_match[] = {
{}
};

static struct of_platform_driver ibm_iic_driver = {
static struct platform_driver ibm_iic_driver = {
.driver = {
.name = "ibm-iic",
.owner = THIS_MODULE,
Expand All @@ -818,12 +817,12 @@ static struct of_platform_driver ibm_iic_driver = {

static int __init iic_init(void)
{
return of_register_platform_driver(&ibm_iic_driver);
return platform_driver_register(&ibm_iic_driver);
}

static void __exit iic_exit(void)
{
of_unregister_platform_driver(&ibm_iic_driver);
platform_driver_unregister(&ibm_iic_driver);
}

module_init(iic_init);
Expand Down
Loading

0 comments on commit 1c48a5c

Please sign in to comment.