staging: media: ipu3: use string_choices API instead of ternary operator

Use string_choices API instead of manually determining the output using
ternary operator to improve code readability and consistency.

This also fixes cocci warning.

Signed-off-by: Nai-Chen Cheng <bleach1827@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Nai-Chen Cheng
2025-08-04 01:49:55 +08:00
committed by Hans Verkuil
parent 0125d9e1b3
commit 955c993d27
2 changed files with 5 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include <linux/device.h>
#include <linux/iopoll.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include "ipu3.h"
#include "ipu3-css.h"
@@ -226,7 +227,7 @@ int imgu_css_set_powerup(struct device *dev, void __iomem *base,
state = readl(base + IMGU_REG_STATE);
dev_dbg(dev, "CSS pm_ctrl 0x%x state 0x%x (power %s)\n",
pm_ctrl, state, state & IMGU_STATE_POWER_DOWN ? "down" : "up");
pm_ctrl, state, str_down_up(state & IMGU_STATE_POWER_DOWN));
/* Power up CSS using wrapper */
if (state & IMGU_STATE_POWER_DOWN) {

View File

@@ -3,6 +3,7 @@
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/string_choices.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
@@ -287,7 +288,7 @@ static int imgu_link_setup(struct media_entity *entity,
WARN_ON(pad >= IMGU_NODE_NUM);
dev_dbg(&imgu->pci_dev->dev, "pipe %u pad %u is %s", pipe, pad,
flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled");
str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED));
imgu_pipe = &imgu->imgu_pipe[pipe];
imgu_pipe->nodes[pad].enabled = flags & MEDIA_LNK_FL_ENABLED;
@@ -302,7 +303,7 @@ static int imgu_link_setup(struct media_entity *entity,
__clear_bit(pipe, imgu->css.enabled_pipes);
dev_dbg(&imgu->pci_dev->dev, "pipe %u is %s", pipe,
flags & MEDIA_LNK_FL_ENABLED ? "enabled" : "disabled");
str_enabled_disabled(flags & MEDIA_LNK_FL_ENABLED));
return 0;
}