base-files: define yes/no as valid boolean options
[openwrt/staging/lynxis/omap.git] / target / linux / mvebu / patches-3.10 / 0155-mtd-nand-pxa3xx-Use-info-use_dma-to-release-DMA-reso.patch
1 From 4c6bade4cf80d77decc5ea89fbaadff8b008f5e9 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Mon, 25 Nov 2013 12:35:28 -0300
4 Subject: [PATCH 155/203] mtd: nand: pxa3xx: Use info->use_dma to release DMA
5 resources
6
7 After the driver allocates all DMA resources, it sets "info->use_dma".
8 Therefore, we need to check that variable to decide which resources
9 needs to be freed, instead of the global use_dma variable.
10
11 Without this change, when the device probe fails, the driver will try
12 to release unallocated DMA resources, with nasty results.
13
14 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
15 ---
16 drivers/mtd/nand/pxa3xx_nand.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19 --- a/drivers/mtd/nand/pxa3xx_nand.c
20 +++ b/drivers/mtd/nand/pxa3xx_nand.c
21 @@ -1288,7 +1288,7 @@ static int pxa3xx_nand_init_buff(struct
22 static void pxa3xx_nand_free_buff(struct pxa3xx_nand_info *info)
23 {
24 struct platform_device *pdev = info->pdev;
25 - if (use_dma) {
26 + if (info->use_dma) {
27 pxa_free_dma(info->data_dma_ch);
28 dma_free_coherent(&pdev->dev, info->buf_size,
29 info->data_buff, info->data_buff_phys);