drivers: rkflash: Fixes compiler warnings

drivers/rkflash/nandc.c:393:31: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
error, forbidden warning:nandc.c:393
                        } while ((fl_reg.V6.tr_rdy == 0));
                                  ~~~~~~~~~~~~~~~~~^~~~
drivers/rkflash/nandc.c:393:31: note: remove extraneous parentheses around the comparison to silence this warning
                        } while ((fl_reg.V6.tr_rdy == 0));
                                 ~                 ^   ~
drivers/rkflash/nandc.c:393:31: note: use '=' to turn this equality comparison into an assignment
                        } while ((fl_reg.V6.tr_rdy == 0));

Change-Id: Ib4c422216c61191b924163fedfe1b83f1fd297df
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2023-03-21 15:41:17 +08:00
committed by Tao Huang
parent 57061ad7b6
commit 69059cd5f5
4 changed files with 355 additions and 1653 deletions

View File

@@ -360,7 +360,7 @@ static void nandc_xfer_done(void)
stat_reg.d32 = nandc_readl(NANDC_MTRANS_STAT);
usleep_range(20, 30);
} while (stat_reg.V6.mtrans_cnt < fl_reg.V6.page_num ||
fl_reg.V6.tr_rdy == 0);
!fl_reg.V6.tr_rdy);
if (master.mapped) {
rknandc_dma_unmap_single(
@@ -376,7 +376,7 @@ static void nandc_xfer_done(void)
do {
fl_reg.d32 = nandc_readl(NANDC_FLCTL);
usleep_range(20, 30);
} while (fl_reg.V6.tr_rdy == 0);
} while (!fl_reg.V6.tr_rdy);
if (master.mapped) {
rknandc_dma_unmap_single(
(unsigned long)(master.page_phy),
@@ -390,7 +390,7 @@ static void nandc_xfer_done(void)
} else {
do {
fl_reg.d32 = nandc_readl(NANDC_FLCTL);
} while ((fl_reg.V6.tr_rdy == 0));
} while ((!fl_reg.V6.tr_rdy));
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,7 @@ struct flash_boot_ops {
int (*discard)(u32 sec, u32 n_sec);
};
#ifdef CONFIG_RK_NANDC_NAND
#if IS_REACHABLE(CONFIG_RK_NANDC_NAND)
extern const struct flash_boot_ops nandc_nand_ops;
#endif

View File

@@ -4,6 +4,7 @@
#include <linux/kernel.h>
#include "sfc_nand.h"
#include "rkflash_api.h"
#include "rk_sftl.h"
@@ -17,10 +18,10 @@ static int snand_init(void __iomem *reg_addr)
ret = sfc_nand_init();
if (ret == 0) {
sfnand_dev = sfc_nand_get_private_dev();
#if defined(CONFIG_RK_SFTL)
#if IS_REACHABLE(CONFIG_RK_SFTL)
sfc_nand_ftl_ops_init();
ret = sftl_init();
#elif !defined(CONFIG_RK_SFC_NAND_MTD)
#elif !IS_REACHABLE(CONFIG_RK_SFC_NAND_MTD)
#error "When CONFIG_RK_SFC_NAND_MTD is not used, CONFIG_RK_SFTL is required!"
#endif
}