Skip to content

Commit

Permalink
spi: omap2-mcspi: make it behave as a module
Browse files Browse the repository at this point in the history
move probe away from __init section and use
platform_driver_register() instead of
platform_driver_probe().

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
  • Loading branch information
Felipe Balbi authored and Shubhrajyoti D committed Mar 19, 2012
1 parent c16fa4f commit 7d6b6d8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ static int omap_mcspi_runtime_resume(struct device *dev)
}


static int __init omap2_mcspi_probe(struct platform_device *pdev)
static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
{
struct spi_master *master;
struct omap2_mcspi_platform_config *pdata = pdev->dev.platform_data;
Expand Down Expand Up @@ -1212,7 +1212,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
return status;
}

static int __exit omap2_mcspi_remove(struct platform_device *pdev)
static int __devexit omap2_mcspi_remove(struct platform_device *pdev)
{
struct spi_master *master;
struct omap2_mcspi *mcspi;
Expand Down Expand Up @@ -1287,13 +1287,14 @@ static struct platform_driver omap2_mcspi_driver = {
.owner = THIS_MODULE,
.pm = &omap2_mcspi_pm_ops
},
.remove = __exit_p(omap2_mcspi_remove),
.probe = omap2_mcspi_probe,
.remove = __devexit_p(omap2_mcspi_remove),
};


static int __init omap2_mcspi_init(void)
{
return platform_driver_probe(&omap2_mcspi_driver, omap2_mcspi_probe);
return platform_driver_register(&omap2_mcspi_driver);
}
subsys_initcall(omap2_mcspi_init);

Expand Down

0 comments on commit 7d6b6d8

Please sign in to comment.