mirror of
				git://git.openwrt.org/openwrt/openwrt.git
				synced 2025-11-03 22:44:27 -05:00 
			
		
		
		
	kernel: mtk-bmt: fix usage of _oob_read
_oob_read returns number of bitflips on success while
bbt_nand_read should return 0.
Fixes: 2d49e49b18 ("mediatek: bmt: use generic mtd api")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									5d409062a3
								
							
						
					
					
						commit
						f183ce35b8
					
				@ -95,8 +95,14 @@ bbt_nand_read(u32 page, unsigned char *dat, int dat_len,
 | 
			
		||||
		.datbuf = dat,
 | 
			
		||||
		.len = dat_len,
 | 
			
		||||
	};
 | 
			
		||||
	int ret;
 | 
			
		||||
 | 
			
		||||
	return bmtd._read_oob(bmtd.mtd, page << bmtd.pg_shift, &ops);
 | 
			
		||||
	ret = bmtd._read_oob(bmtd.mtd, page << bmtd.pg_shift, &ops);
 | 
			
		||||
	if (ret < 0)
 | 
			
		||||
		return ret;
 | 
			
		||||
	if (ret)
 | 
			
		||||
		pr_info("%s: %d bitflips\n", __func__, ret);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static inline int bbt_nand_erase(u16 block)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user