From: Grant Likely Date: Tue, 10 Apr 2012 20:09:52 +0000 (-0600) Subject: Merge branch 'spi' of git://gitorious.org/linus-tree/linus-tree into spi/next X-Git-Tag: v3.5-rc1~95^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aae730dfe239f1a5122ba873b54dffc20a516775;p=profile%2Fivi%2Fkernel-x86-ivi.git Merge branch 'spi' of git://gitorious.org/linus-tree/linus-tree into spi/next --- aae730dfe239f1a5122ba873b54dffc20a516775 diff --cc drivers/spi/spi-omap2-mcspi.c index bb9274c,cb2c0e3..33f54cd --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@@ -1081,31 -1078,11 +1080,31 @@@ static int omap_mcspi_runtime_resume(st return 0; } +static struct omap2_mcspi_platform_config omap2_pdata = { + .regs_offset = 0, +}; + +static struct omap2_mcspi_platform_config omap4_pdata = { + .regs_offset = OMAP4_MCSPI_REG_OFFSET, +}; + +static const struct of_device_id omap_mcspi_of_match[] = { + { + .compatible = "ti,omap2-mcspi", + .data = &omap2_pdata, + }, + { + .compatible = "ti,omap4-mcspi", + .data = &omap4_pdata, + }, + { }, +}; +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 = pdev->dev.platform_data; + struct omap2_mcspi_platform_config *pdata; struct omap2_mcspi *mcspi; struct resource *r; int status = 0, i; @@@ -1163,16 -1123,11 +1162,11 @@@ goto free_master; } - r->start += pdata->regs_offset; - r->end += pdata->regs_offset; + r->start += regs_offset; + r->end += regs_offset; mcspi->phys = r->start; - if (!request_mem_region(r->start, resource_size(r), - dev_name(&pdev->dev))) { - status = -EBUSY; - goto free_master; - } - mcspi->base = ioremap(r->start, resource_size(r)); + mcspi->base = devm_request_and_ioremap(&pdev->dev, r); if (!mcspi->base) { dev_dbg(&pdev->dev, "can't ioremap MCSPI\n"); status = -ENOMEM; @@@ -1324,24 -1269,11 +1308,12 @@@ static struct platform_driver omap2_mcs .driver = { .name = "omap2_mcspi", .owner = THIS_MODULE, - .pm = &omap2_mcspi_pm_ops + .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); - } - subsys_initcall(omap2_mcspi_init); - - static void __exit omap2_mcspi_exit(void) - { - platform_driver_unregister(&omap2_mcspi_driver); - - } - module_exit(omap2_mcspi_exit); - + module_platform_driver(omap2_mcspi_driver); MODULE_LICENSE("GPL");