Skip to content

Commit 258ef75

Browse files
Yuesong Limiquelraynal
authored andcommitted
mtd: nand: brcmnand: replace manual string choices with standard helpers
Use kernel provided standard helper function to replace hard-coded strings Signed-off-by: Yuesong Li <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent d0b3b7b commit 258ef75

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/mtd/nand/raw/brcmnand/brcmnand.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <linux/static_key.h>
3030
#include <linux/list.h>
3131
#include <linux/log2.h>
32+
#include <linux/string_choices.h>
3233

3334
#include "brcmnand.h"
3435

@@ -1462,7 +1463,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
14621463
int ret;
14631464

14641465
if (old_wp != wp) {
1465-
dev_dbg(ctrl->dev, "WP %s\n", wp ? "on" : "off");
1466+
dev_dbg(ctrl->dev, "WP %s\n", str_on_off(wp));
14661467
old_wp = wp;
14671468
}
14681469

@@ -1492,7 +1493,7 @@ static void brcmnand_wp(struct mtd_info *mtd, int wp)
14921493
if (ret)
14931494
dev_err_ratelimited(&host->pdev->dev,
14941495
"nand #WP expected %s\n",
1495-
wp ? "on" : "off");
1496+
str_on_off(wp));
14961497
}
14971498
}
14981499

@@ -1869,8 +1870,8 @@ static int brcmnand_edu_trans(struct brcmnand_host *host, u64 addr, u32 *buf,
18691870
unsigned int trans = len >> FC_SHIFT;
18701871
dma_addr_t pa;
18711872

1872-
dev_dbg(ctrl->dev, "EDU %s %p:%p\n", ((edu_cmd == EDU_CMD_READ) ?
1873-
"read" : "write"), buf, oob);
1873+
dev_dbg(ctrl->dev, "EDU %s %p:%p\n",
1874+
str_read_write(edu_cmd == EDU_CMD_READ), buf, oob);
18741875

18751876
pa = dma_map_single(ctrl->dev, buf, len, dir);
18761877
if (dma_mapping_error(ctrl->dev, pa)) {

0 commit comments

Comments
 (0)