Merge remote-tracking branches 'spi/topic/sh-msiof', 'spi/topic/slave', 'spi/topic...
[sfrench/cifs-2.6.git] / drivers / spi / spi-sh-msiof.c
index 0eb1e95834854fb658806b1aaefc19fb7bec69b3..fcd261f98b9fd92189f1eb9acd8aee7be484af82 100644 (file)
@@ -900,7 +900,7 @@ static int sh_msiof_transfer_one(struct spi_master *master,
                                break;
                        copy32 = copy_bswap32;
                } else if (bits <= 16) {
-                       if (l & 1)
+                       if (l & 3)
                                break;
                        copy32 = copy_wswap32;
                } else {
@@ -1021,6 +1021,8 @@ static const struct sh_msiof_chipdata rcar_gen3_data = {
 
 static const struct of_device_id sh_msiof_match[] = {
        { .compatible = "renesas,sh-mobile-msiof", .data = &sh_data },
+       { .compatible = "renesas,msiof-r8a7743",   .data = &rcar_gen2_data },
+       { .compatible = "renesas,msiof-r8a7745",   .data = &rcar_gen2_data },
        { .compatible = "renesas,msiof-r8a7790",   .data = &rcar_gen2_data },
        { .compatible = "renesas,msiof-r8a7791",   .data = &rcar_gen2_data },
        { .compatible = "renesas,msiof-r8a7792",   .data = &rcar_gen2_data },
@@ -1188,12 +1190,10 @@ free_tx_chan:
 static void sh_msiof_release_dma(struct sh_msiof_spi_priv *p)
 {
        struct spi_master *master = p->master;
-       struct device *dev;
 
        if (!master->dma_tx)
                return;
 
-       dev = &p->pdev->dev;
        dma_unmap_single(master->dma_rx->device->dev, p->rx_dma_addr,
                         PAGE_SIZE, DMA_FROM_DEVICE);
        dma_unmap_single(master->dma_tx->device->dev, p->tx_dma_addr,
@@ -1209,15 +1209,13 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
        struct resource *r;
        struct spi_master *master;
        const struct sh_msiof_chipdata *chipdata;
-       const struct of_device_id *of_id;
        struct sh_msiof_spi_info *info;
        struct sh_msiof_spi_priv *p;
        int i;
        int ret;
 
-       of_id = of_match_device(sh_msiof_match, &pdev->dev);
-       if (of_id) {
-               chipdata = of_id->data;
+       chipdata = of_device_get_match_data(&pdev->dev);
+       if (chipdata) {
                info = sh_msiof_spi_parse_dt(&pdev->dev);
        } else {
                chipdata = (const void *)pdev->id_entry->driver_data;