]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mtd: spi-nor: Rename spi_nor_spimem_check_op()
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 17 Mar 2026 17:17:22 +0000 (18:17 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 18 Mar 2026 17:08:18 +0000 (18:08 +0100)
This helper really is just a little helper for internal purposes, and is
I/O operation oriented, despite its name. It has already been misused
in commit 5008c3ec3f89 ("mtd: spi-nor: core: Check read CR support"), so
rename it to clarify its purpose: it is only useful for reads and page
programs.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/spi-nor/core.c

index 13201908a69f2eaaf17a3d0a47b7870a4c80fd0f..1eee519c01e5cadf26d397bc07d75057cd7a2432 100644 (file)
@@ -2345,15 +2345,15 @@ int spi_nor_hwcaps_pp2cmd(u32 hwcaps)
 }
 
 /**
- * spi_nor_spimem_check_op - check if the operation is supported
- *                           by controller
+ * spi_nor_spimem_check_read_pp_op - check if a read or a page program operation is
+ *                                   supported by controller
  *@nor:        pointer to a 'struct spi_nor'
  *@op:         pointer to op template to be checked
  *
  * Returns 0 if operation is supported, -EOPNOTSUPP otherwise.
  */
-static int spi_nor_spimem_check_op(struct spi_nor *nor,
-                                  struct spi_mem_op *op)
+static int spi_nor_spimem_check_read_pp_op(struct spi_nor *nor,
+                                          struct spi_mem_op *op)
 {
        /*
         * First test with 4 address bytes. The opcode itself might
@@ -2396,7 +2396,7 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor,
        if (spi_nor_protocol_is_dtr(nor->read_proto))
                op.dummy.nbytes *= 2;
 
-       return spi_nor_spimem_check_op(nor, &op);
+       return spi_nor_spimem_check_read_pp_op(nor, &op);
 }
 
 /**
@@ -2414,7 +2414,7 @@ static int spi_nor_spimem_check_pp(struct spi_nor *nor,
 
        spi_nor_spimem_setup_op(nor, &op, pp->proto);
 
-       return spi_nor_spimem_check_op(nor, &op);
+       return spi_nor_spimem_check_read_pp_op(nor, &op);
 }
 
 /**