lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 2/5] spi: omap2-mcspi: make it behave as a module
    Date
    From: Felipe Balbi <balbi@ti.com>

    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>
    ---
    drivers/spi/spi-omap2-mcspi.c | 9 +++++----
    1 files changed, 5 insertions(+), 4 deletions(-)

    diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
    index 7785091..26dd79f 100644
    --- a/drivers/spi/spi-omap2-mcspi.c
    +++ b/drivers/spi/spi-omap2-mcspi.c
    @@ -1098,7 +1098,7 @@ static const struct of_device_id omap_mcspi_of_match[] = {
    };
    MODULE_DEVICE_TABLE(of, omap_mcspi_of_match);

    -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;
    @@ -1245,7 +1245,7 @@ free_master:
    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;
    @@ -1320,13 +1320,14 @@ static struct platform_driver omap2_mcspi_driver = {
    .pm = &omap2_mcspi_pm_ops,
    .of_match_table = omap_mcspi_of_match,
    },
    - .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);

    --
    1.7.1


    \
     
     \ /
      Last update: 2012-03-26 15:49    [W:5.990 / U:0.528 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site