All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
@ 2023-04-05  6:04 ` Tudor Ambarus
  0 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2023-04-05  6:04 UTC (permalink / raw)
  To: tkuw584924, Takahiro.Kuwano, pratyush, michael
  Cc: bacem.daassi, miquel.raynal, richard, linux-mtd, linux-kernel,
	Tudor Ambarus

The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
Rename the method accordingly, s/set/get.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/spansion.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index ffeede78700d..c937f0ac61de 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -302,8 +302,7 @@ static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
 }
 
 /**
- * cypress_nor_set_page_size() - Set page size which corresponds to the flash
- *                               configuration.
+ * cypress_nor_get_page_size() - Get flash page size configuration.
  * @nor:	pointer to a 'struct spi_nor'
  *
  * The BFPT table advertises a 512B or 256B page size depending on part but the
@@ -312,7 +311,7 @@ static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
  *
  * Return: 0 on success, -errno otherwise.
  */
-static int cypress_nor_set_page_size(struct spi_nor *nor)
+static int cypress_nor_get_page_size(struct spi_nor *nor)
 {
 	struct spi_mem_op op =
 		CYPRESS_NOR_RD_ANY_REG_OP(nor->params->addr_mode_nbytes,
@@ -368,7 +367,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
 	if (nor->bouncebuf[0])
 		return -ENODEV;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s25fs256t_post_sfdp_fixup(struct spi_nor *nor)
@@ -407,7 +406,7 @@ s25hx_t_post_bfpt_fixup(struct spi_nor *nor,
 	/* Replace Quad Enable with volatile version */
 	nor->params->quad_enable = cypress_nor_quad_enable_volatile;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s25hx_t_post_sfdp_fixup(struct spi_nor *nor)
@@ -502,7 +501,7 @@ static int s28hx_t_post_bfpt_fixup(struct spi_nor *nor,
 	if (ret)
 		return ret;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s28hx_t_late_init(struct spi_nor *nor)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
@ 2023-04-05  6:04 ` Tudor Ambarus
  0 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2023-04-05  6:04 UTC (permalink / raw)
  To: tkuw584924, Takahiro.Kuwano, pratyush, michael
  Cc: bacem.daassi, miquel.raynal, richard, linux-mtd, linux-kernel,
	Tudor Ambarus

The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
Rename the method accordingly, s/set/get.

Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 drivers/mtd/spi-nor/spansion.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/spi-nor/spansion.c b/drivers/mtd/spi-nor/spansion.c
index ffeede78700d..c937f0ac61de 100644
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -302,8 +302,7 @@ static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
 }
 
 /**
- * cypress_nor_set_page_size() - Set page size which corresponds to the flash
- *                               configuration.
+ * cypress_nor_get_page_size() - Get flash page size configuration.
  * @nor:	pointer to a 'struct spi_nor'
  *
  * The BFPT table advertises a 512B or 256B page size depending on part but the
@@ -312,7 +311,7 @@ static int cypress_nor_set_addr_mode_nbytes(struct spi_nor *nor)
  *
  * Return: 0 on success, -errno otherwise.
  */
-static int cypress_nor_set_page_size(struct spi_nor *nor)
+static int cypress_nor_get_page_size(struct spi_nor *nor)
 {
 	struct spi_mem_op op =
 		CYPRESS_NOR_RD_ANY_REG_OP(nor->params->addr_mode_nbytes,
@@ -368,7 +367,7 @@ s25fs256t_post_bfpt_fixup(struct spi_nor *nor,
 	if (nor->bouncebuf[0])
 		return -ENODEV;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s25fs256t_post_sfdp_fixup(struct spi_nor *nor)
@@ -407,7 +406,7 @@ s25hx_t_post_bfpt_fixup(struct spi_nor *nor,
 	/* Replace Quad Enable with volatile version */
 	nor->params->quad_enable = cypress_nor_quad_enable_volatile;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s25hx_t_post_sfdp_fixup(struct spi_nor *nor)
@@ -502,7 +501,7 @@ static int s28hx_t_post_bfpt_fixup(struct spi_nor *nor,
 	if (ret)
 		return ret;
 
-	return cypress_nor_set_page_size(nor);
+	return cypress_nor_get_page_size(nor);
 }
 
 static void s28hx_t_late_init(struct spi_nor *nor)
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
  2023-04-05  6:04 ` Tudor Ambarus
@ 2023-04-18  9:29   ` Michael Walle
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael Walle @ 2023-04-18  9:29 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: tkuw584924, Takahiro.Kuwano, pratyush, bacem.daassi,
	miquel.raynal, richard, linux-mtd, linux-kernel

Am 2023-04-05 08:04, schrieb Tudor Ambarus:
> The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
> Rename the method accordingly, s/set/get.

I'm not sure about this one. There is also a
cypress_nor_set_addr_mode_nbytes() which queries the flash and
set the params->addr_nbytes and params->addr_mode_nbytes.

cypress_nor_set_page_size() also queries the flash and set
params->page_size.

Secondly, if this function is called get_page_size() I'd assume it
doesn't modify anything. But thats not true.

-michael

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
@ 2023-04-18  9:29   ` Michael Walle
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Walle @ 2023-04-18  9:29 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: tkuw584924, Takahiro.Kuwano, pratyush, bacem.daassi,
	miquel.raynal, richard, linux-mtd, linux-kernel

Am 2023-04-05 08:04, schrieb Tudor Ambarus:
> The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
> Rename the method accordingly, s/set/get.

I'm not sure about this one. There is also a
cypress_nor_set_addr_mode_nbytes() which queries the flash and
set the params->addr_nbytes and params->addr_mode_nbytes.

cypress_nor_set_page_size() also queries the flash and set
params->page_size.

Secondly, if this function is called get_page_size() I'd assume it
doesn't modify anything. But thats not true.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
  2023-04-18  9:29   ` Michael Walle
@ 2023-04-18 10:25     ` Tudor Ambarus
  -1 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2023-04-18 10:25 UTC (permalink / raw)
  To: Michael Walle
  Cc: tkuw584924, Takahiro.Kuwano, pratyush, bacem.daassi,
	miquel.raynal, richard, linux-mtd, linux-kernel



On 4/18/23 10:29, Michael Walle wrote:
> Am 2023-04-05 08:04, schrieb Tudor Ambarus:
>> The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
>> Rename the method accordingly, s/set/get.
> 
> I'm not sure about this one. There is also a
> cypress_nor_set_addr_mode_nbytes() which queries the flash and
> set the params->addr_nbytes and params->addr_mode_nbytes.
> 
> cypress_nor_set_page_size() also queries the flash and set
> params->page_size.
> 
> Secondly, if this function is called get_page_size() I'd assume it
> doesn't modify anything. But thats not true.
> 

Indeed. Maybe I should have returned the page_size instead or don't
change the name at all. I applied this patch as part of
https://lore.kernel.org/linux-mtd/168093614108.51189.3153773628255664983.b4-ty@linaro.org/

Feel free to send a patch on top of latest spi-nor branch, otherwise
I'll handle it after the merge window.

Cheers,
ta.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size
@ 2023-04-18 10:25     ` Tudor Ambarus
  0 siblings, 0 replies; 6+ messages in thread
From: Tudor Ambarus @ 2023-04-18 10:25 UTC (permalink / raw)
  To: Michael Walle
  Cc: tkuw584924, Takahiro.Kuwano, pratyush, bacem.daassi,
	miquel.raynal, richard, linux-mtd, linux-kernel



On 4/18/23 10:29, Michael Walle wrote:
> Am 2023-04-05 08:04, schrieb Tudor Ambarus:
>> The method queries SPINOR_REG_CYPRESS_CFR3V to determine the page size.
>> Rename the method accordingly, s/set/get.
> 
> I'm not sure about this one. There is also a
> cypress_nor_set_addr_mode_nbytes() which queries the flash and
> set the params->addr_nbytes and params->addr_mode_nbytes.
> 
> cypress_nor_set_page_size() also queries the flash and set
> params->page_size.
> 
> Secondly, if this function is called get_page_size() I'd assume it
> doesn't modify anything. But thats not true.
> 

Indeed. Maybe I should have returned the page_size instead or don't
change the name at all. I applied this patch as part of
https://lore.kernel.org/linux-mtd/168093614108.51189.3153773628255664983.b4-ty@linaro.org/

Feel free to send a patch on top of latest spi-nor branch, otherwise
I'll handle it after the merge window.

Cheers,
ta.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-04-18 10:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05  6:04 [PATCH] mtd: spi-nor: spansion: Rename method to cypress_nor_get_page_size Tudor Ambarus
2023-04-05  6:04 ` Tudor Ambarus
2023-04-18  9:29 ` Michael Walle
2023-04-18  9:29   ` Michael Walle
2023-04-18 10:25   ` Tudor Ambarus
2023-04-18 10:25     ` Tudor Ambarus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.