From: Grant Likely Date: Mon, 28 Feb 2011 08:36:21 +0000 (-0700) Subject: Merge commit 'v2.6.38-rc6' into devicetree/next X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=38a5d6736e7f714cc56d58692001e66dcbb98799;p=linux-beck.git Merge commit 'v2.6.38-rc6' into devicetree/next Conflicts: drivers/spi/pxa2xx_spi_pci.c --- 38a5d6736e7f714cc56d58692001e66dcbb98799 diff --cc drivers/spi/pxa2xx_spi_pci.c index b6589bb3a6c3,19752b09e155..378e504f89eb --- a/drivers/spi/pxa2xx_spi_pci.c +++ b/drivers/spi/pxa2xx_spi_pci.c @@@ -84,25 -75,24 +75,22 @@@ static int __devinit ce4100_spi_probe(s return ret; } + pdev = platform_device_alloc("pxa2xx-spi", dev->devfn); spi_info = kzalloc(sizeof(*spi_info), GFP_KERNEL); - if (!spi_info) { + if (!pdev || !spi_info ) { ret = -ENOMEM; - goto err_kz; + goto err_nomem; } - ssp = &spi_info->ssp; - pdev = &spi_info->spi_pdev; - spi_pdata = &spi_info->spi_pdata; + memset(&spi_pdata, 0, sizeof(spi_pdata)); + spi_pdata.num_chipselect = dev->devfn; - pdev->name = "pxa2xx-spi"; - pdev->id = dev->devfn; - pdev->dev.parent = &dev->dev; - pdev->dev.platform_data = &spi_info->spi_pdata; + ret = platform_device_add_data(pdev, &spi_pdata, sizeof(spi_pdata)); + if (ret) + goto err_nomem; + pdev->dev.parent = &dev->dev; -#ifdef CONFIG_OF pdev->dev.of_node = dev->dev.of_node; - pdev->dev.release = plat_dev_release; - - spi_pdata->num_chipselect = dev->devfn; - -#endif + ssp = &spi_info->ssp; ssp->phys_base = pci_resource_start(dev, 0); ssp->mmio_base = ioremap(phys_beg, phys_len); if (!ssp->mmio_base) {