<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2"><div>About 04/17/2019 09:18AM in some timezone, Cédric Le Goater wrote:</div><div><br></div><div>>Subject: [PATCH dev-5.0 2/4] mtd: spi-nor: aspeed: clarify 4BYTE</div>>address mode mask<br>><br><div><br></div><div>Missing change log here.<br></div><div><br></div><div>>Signed-off-by: Cédric Le Goater <<a href="mailto:clg@kaod.org" target="_blank">clg@kaod.org</a>></div>>---<br>> drivers/mtd/spi-nor/aspeed-smc.c | 10 +++++++++-<br>> 1 file changed, 9 insertions(+), 1 deletion(-)<br>><br>>diff --git a/drivers/mtd/spi-nor/aspeed-smc.c<br>>b/drivers/mtd/spi-nor/aspeed-smc.c<br>>index ee3059b27c07..1437732fdea1 100644<br>>--- a/drivers/mtd/spi-nor/aspeed-smc.c<br>>+++ b/drivers/mtd/spi-nor/aspeed-smc.c<br>>@@ -884,7 +884,15 @@ static const uint32_t aspeed_smc_hclk_divs[] = {<br>> <br>> static u32 aspeed_smc_default_read(struct aspeed_smc_chip *chip)<br>> {<br>>- return (chip->ctl_val[smc_read] & 0x2000) |<br>>+ /*<br>>+ * Keep the 4Byte address mode on the AST2400 SPI controller.<br>>+ * Other controllers set the 4Byte mode in the CE Control<br>>+ * Register<br>>+ */<br>>+ u32 ctl_mask = chip->controller->info == &spi_2400_info ?<br>>+ CONTROL_IO_ADDRESS_4B : 0;<br><div>>+</div><div><br></div><div>I dislike this patch because it violates the data driven model of the types.</div><div><br></div><div>Either a dupicate method should be created or at least a member of the</div><div>type structure should be used instead of a compare to a specific instance.<br></div><div><br></div>>+ return (chip->ctl_val[smc_read] & ctl_mask) |<br>> (0x00 << 28) | /* Single bit */<br>> (0x00 << 24) | /* CE# max */<br>> (0x03 << 16) | /* use normal reads */<br>>-- <br>>2.20.1<br>><br>></font><BR>