[PATCH linux dev-4.7 11/12] mtd: spi-nor: aspeed: use property "aspeed, fmc-has-dma"

Cédric Le Goater clg at kaod.org
Fri Oct 14 23:38:03 AEDT 2016


Signed-off-by: Cédric Le Goater <clg at kaod.org>
---
 drivers/mtd/spi-nor/aspeed-smc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/spi-nor/aspeed-smc.c b/drivers/mtd/spi-nor/aspeed-smc.c
index 104d14422560..ae2d9bc643c3 100644
--- a/drivers/mtd/spi-nor/aspeed-smc.c
+++ b/drivers/mtd/spi-nor/aspeed-smc.c
@@ -156,7 +156,6 @@ struct aspeed_smc_info {
 	u32 maxsize;		/* maximum size of 1 chip window */
 	u8 nce;			/* number of chip enables */
 	u8 maxwidth;		/* max width of spi bus */
-	bool hasdma;		/* has dma engine */
 	bool hastype;		/* flash type field exists in cfg reg */
 	u8 we0;			/* shift for write enable bit for ce 0 */
 	u8 ctl0;		/* offset in regs of ctl for ce 0 */
@@ -168,7 +167,6 @@ static struct aspeed_smc_info fmc_2400_info = {
 	.maxsize = 64 * 1024 * 1024,
 	.nce = 5,
 	.maxwidth = 4,
-	.hasdma = true,
 	.hastype = true,
 	.we0 = 16,
 	.ctl0 = 0x10,
@@ -180,7 +178,6 @@ static struct aspeed_smc_info smc_2400_info = {
 	.maxsize = 64 * 1024 * 1024,
 	.nce = 1,
 	.maxwidth = 2,
-	.hasdma = false,
 	.hastype = false,
 	.we0 = 0,
 	.ctl0 = 0x04,
@@ -192,7 +189,6 @@ static struct aspeed_smc_info fmc_2500_info = {
 	.maxsize = 256 * 1024 * 1024,
 	.nce = 3,
 	.maxwidth = 2,
-	.hasdma = true,
 	.hastype = true,
 	.we0 = 16,
 	.ctl0 = 0x10,
@@ -204,7 +200,6 @@ static struct aspeed_smc_info smc_2500_info = {
 	.maxsize = 128 * 1024 * 1024,
 	.nce = 2,
 	.maxwidth = 2,
-	.hasdma = false,
 	.hastype = false,
 	.we0 = 16,
 	.ctl0 = 0x10,
@@ -703,7 +698,8 @@ static int aspeed_smc_probe(struct platform_device *pdev)
 	init_completion(&controller->dma_done);
 
 	controller->has_dma = false;
-	if (info->hasdma)
+	if (of_get_property(controller->dev->of_node, "aspeed,fmc-has-dma",
+			    NULL))
 		controller->has_dma = !aspeed_smc_config_irq(controller, pdev);
 
 	if (controller->has_dma)
-- 
2.7.4



More information about the openbmc mailing list