]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: nand: brcmnand: replace manual string choices with standard helpers
authorYuesong Li <liyuesong@vivo.com>
Wed, 18 Jun 2025 12:49:47 +0000 (20:49 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Wed, 30 Jul 2025 09:27:30 +0000 (11:27 +0200)
Use kernel provided standard helper function to replace hard-coded
strings

Signed-off-by: Yuesong Li <liyuesong@vivo.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/brcmnand/brcmnand.c

index 62bdda3be92f79d0cd0ea146af3efe1f2b870a39..dc836b14102466a6d38f1f6066decf6c86367926 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/static_key.h>
 #include <linux/list.h>
 #include <linux/log2.h>
+#include <linux/string_choices.h>
 
 #include "brcmnand.h"
 
@@ -1462,7 +1463,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
                int ret;
 
                if (old_wp != wp) {
-                       dev_dbg(ctrl->dev, "WP %s\n", wp ? "on" : "off");
+                       dev_dbg(ctrl->dev, "WP %s\n", str_on_off(wp));
                        old_wp = wp;
                }
 
@@ -1492,7 +1493,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
                if (ret)
                        dev_err_ratelimited(&host->pdev->dev,
                                            "nand #WP expected %s\n",
-                                           wp ? "on" : "off");
+                                           str_on_off(wp));
        }
 }
 
@@ -1869,8 +1870,8 @@ static int brcmnand_edu_trans(struct brcmnand_host *host, u64 addr, u32 *buf,
        unsigned int trans = len >> FC_SHIFT;
        dma_addr_t pa;
 
-       dev_dbg(ctrl->dev, "EDU %s %p:%p\n", ((edu_cmd == EDU_CMD_READ) ?
-                                             "read" : "write"), buf, oob);
+       dev_dbg(ctrl->dev, "EDU %s %p:%p\n",
+               str_read_write(edu_cmd == EDU_CMD_READ), buf, oob);
 
        pa = dma_map_single(ctrl->dev, buf, len, dir);
        if (dma_mapping_error(ctrl->dev, pa)) {