diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-12-05 17:49:56 +0900 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-12-14 13:34:20 +0100 |
commit | 958ef111cca5e70994b806127ff15258d446ed25 (patch) | |
tree | 2b374e3fc0ca53744e962c8e0a31ee33b8a0660b /drivers | |
parent | c0313b966a0942fba934d34c7a76f444641d0b6e (diff) | |
download | linux-stable-958ef111cca5e70994b806127ff15258d446ed25.tar.gz linux-stable-958ef111cca5e70994b806127ff15258d446ed25.tar.bz2 linux-stable-958ef111cca5e70994b806127ff15258d446ed25.zip |
mtd: nand: cafe: clean up DMA address setup
Use macros from <linux/kernel.h> to make the code readable.
The compiler warning will be kept suppressed.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/cafe_nand.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c index a438b7114053..567ff972d5fc 100644 --- a/drivers/mtd/nand/cafe_nand.c +++ b/drivers/mtd/nand/cafe_nand.c @@ -729,12 +729,8 @@ static int cafe_nand_probe(struct pci_dev *pdev, } /* Set up DMA address */ - cafe_writel(cafe, cafe->dmaaddr & 0xffffffff, NAND_DMA_ADDR0); - if (sizeof(cafe->dmaaddr) > 4) - /* Shift in two parts to shut the compiler up */ - cafe_writel(cafe, (cafe->dmaaddr >> 16) >> 16, NAND_DMA_ADDR1); - else - cafe_writel(cafe, 0, NAND_DMA_ADDR1); + cafe_writel(cafe, lower_32_bits(cafe->dmaaddr), NAND_DMA_ADDR0); + cafe_writel(cafe, upper_32_bits(cafe->dmaaddr), NAND_DMA_ADDR1); cafe_dev_dbg(&cafe->pdev->dev, "Set DMA address to %x (virt %p)\n", cafe_readl(cafe, NAND_DMA_ADDR0), cafe->dmabuf); |