File tree Expand file tree Collapse file tree 2 files changed +30
-22
lines changed
Expand file tree Collapse file tree 2 files changed +30
-22
lines changed Original file line number Diff line number Diff line change @@ -574,18 +574,22 @@ static int lpc32xx_dma_setup(struct lpc32xx_nand_host *host)
574574 struct mtd_info * mtd = nand_to_mtd (& host -> nand_chip );
575575 dma_cap_mask_t mask ;
576576
577- if (!host -> pdata || !host -> pdata -> dma_filter ) {
578- dev_err (mtd -> dev .parent , "no DMA platform data\n" );
579- return - ENOENT ;
580- }
581-
582- dma_cap_zero (mask );
583- dma_cap_set (DMA_SLAVE , mask );
584- host -> dma_chan = dma_request_channel (mask , host -> pdata -> dma_filter ,
585- "nand-mlc" );
577+ host -> dma_chan = dma_request_chan (mtd -> dev .parent , "rx-tx" );
586578 if (!host -> dma_chan ) {
587- dev_err (mtd -> dev .parent , "Failed to request DMA channel\n" );
588- return - EBUSY ;
579+ /* fallback to request using platform data */
580+ if (!host -> pdata || !host -> pdata -> dma_filter ) {
581+ dev_err (mtd -> dev .parent , "no DMA platform data\n" );
582+ return - ENOENT ;
583+ }
584+
585+ dma_cap_zero (mask );
586+ dma_cap_set (DMA_SLAVE , mask );
587+ host -> dma_chan = dma_request_channel (mask , host -> pdata -> dma_filter , "nand-mlc" );
588+
589+ if (!host -> dma_chan ) {
590+ dev_err (mtd -> dev .parent , "Failed to request DMA channel\n" );
591+ return - EBUSY ;
592+ }
589593 }
590594
591595 /*
Original file line number Diff line number Diff line change @@ -721,18 +721,22 @@ static int lpc32xx_nand_dma_setup(struct lpc32xx_nand_host *host)
721721 struct mtd_info * mtd = nand_to_mtd (& host -> nand_chip );
722722 dma_cap_mask_t mask ;
723723
724- if (!host -> pdata || !host -> pdata -> dma_filter ) {
725- dev_err (mtd -> dev .parent , "no DMA platform data\n" );
726- return - ENOENT ;
727- }
728-
729- dma_cap_zero (mask );
730- dma_cap_set (DMA_SLAVE , mask );
731- host -> dma_chan = dma_request_channel (mask , host -> pdata -> dma_filter ,
732- "nand-slc" );
724+ host -> dma_chan = dma_request_chan (mtd -> dev .parent , "rx-tx" );
733725 if (!host -> dma_chan ) {
734- dev_err (mtd -> dev .parent , "Failed to request DMA channel\n" );
735- return - EBUSY ;
726+ /* fallback to request using platform data */
727+ if (!host -> pdata || !host -> pdata -> dma_filter ) {
728+ dev_err (mtd -> dev .parent , "no DMA platform data\n" );
729+ return - ENOENT ;
730+ }
731+
732+ dma_cap_zero (mask );
733+ dma_cap_set (DMA_SLAVE , mask );
734+ host -> dma_chan = dma_request_channel (mask , host -> pdata -> dma_filter , "nand-slc" );
735+
736+ if (!host -> dma_chan ) {
737+ dev_err (mtd -> dev .parent , "Failed to request DMA channel\n" );
738+ return - EBUSY ;
739+ }
736740 }
737741
738742 return 0 ;
You can’t perform that action at this time.
0 commit comments