Skip to content

Commit 3081f26

Browse files
Zhang Hengmiquelraynal
authored andcommitted
mtd: mchp48l640: Use str_enable_disable() in mchp48l640_write_prepare()
Remove hard-coded strings by using the str_enable_disable() helper function. Signed-off-by: Zhang Heng <[email protected]> Reviewed-by: Heiko Schocher <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 9fe1617 commit 3081f26

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/mtd/devices/mchp48l640.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/spi/flash.h>
2424
#include <linux/spi/spi.h>
2525
#include <linux/of.h>
26+
#include <linux/string_choices.h>
2627

2728
struct mchp48_caps {
2829
unsigned int size;
@@ -128,11 +129,11 @@ static int mchp48l640_write_prepare(struct mchp48l640_flash *flash, bool enable)
128129
mutex_unlock(&flash->lock);
129130

130131
if (ret)
131-
dev_err(&flash->spi->dev, "write %sable failed ret: %d",
132-
(enable ? "en" : "dis"), ret);
132+
dev_err(&flash->spi->dev, "write %s failed ret: %d",
133+
str_enable_disable(enable), ret);
133134

134-
dev_dbg(&flash->spi->dev, "write %sable success ret: %d",
135-
(enable ? "en" : "dis"), ret);
135+
dev_dbg(&flash->spi->dev, "write %s success ret: %d",
136+
str_enable_disable(enable), ret);
136137
if (enable)
137138
return mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, true);
138139

0 commit comments

Comments
 (0)