]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mtd: mchp48l640: Use str_enable_disable() in mchp48l640_write_prepare()
authorZhang Heng <zhangheng@kylinos.cn>
Thu, 13 Mar 2025 09:57:56 +0000 (17:57 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 18 Mar 2025 16:18:51 +0000 (17:18 +0100)
Remove hard-coded strings by using the str_enable_disable() helper
function.

Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/devices/mchp48l640.c

index 7584d0ba93969d79ba3d9c7a97bc63bd0e5ef327..4af9208f96906c6a73b0bd8beb30a2be6a145fc9 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 #include <linux/of.h>
+#include <linux/string_choices.h>
 
 struct mchp48_caps {
        unsigned int size;
@@ -128,11 +129,11 @@ static int mchp48l640_write_prepare(struct mchp48l640_flash *flash, bool enable)
        mutex_unlock(&flash->lock);
 
        if (ret)
-               dev_err(&flash->spi->dev, "write %sable failed ret: %d",
-                       (enable ? "en" : "dis"), ret);
+               dev_err(&flash->spi->dev, "write %s failed ret: %d",
+                       str_enable_disable(enable), ret);
 
-       dev_dbg(&flash->spi->dev, "write %sable success ret: %d",
-               (enable ? "en" : "dis"), ret);
+       dev_dbg(&flash->spi->dev, "write %s success ret: %d",
+               str_enable_disable(enable), ret);
        if (enable)
                return mchp48l640_waitforbit(flash, MCHP48L640_STATUS_WEL, true);