Using the endpoint define values makes it more clear that the argument to
mux_control_try_select() must be valid state integers, and not something
that looks like a boolean.

The endpoint value is kept, as it will be used in a following patch that
changes behavior slightly based on which endpoint is selected.

Cc: [email protected]
Signed-off-by: Esben Haabendal <[email protected]>
---
 drivers/gpu/drm/bridge/nwl-dsi.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c
index 3c9ae93c4f67..39be58cf5bd2 100644
--- a/drivers/gpu/drm/bridge/nwl-dsi.c
+++ b/drivers/gpu/drm/bridge/nwl-dsi.c
@@ -110,6 +110,8 @@ struct nwl_dsi {
        int error;
 
        struct nwl_dsi_transfer *xfer;
+
+       unsigned int endpoint;
 };
 
 static const struct regmap_config nwl_dsi_regmap_config = {
@@ -1088,13 +1090,12 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi)
 static int nwl_dsi_select_input(struct nwl_dsi *dsi)
 {
        struct device_node *remote;
-       u32 use_dcss = 1;
        int ret;
 
        remote = of_graph_get_remote_node(dsi->dev->of_node, 0,
                                          NWL_DSI_ENDPOINT_LCDIF);
        if (remote) {
-               use_dcss = 0;
+               dsi->endpoint = NWL_DSI_ENDPOINT_LCDIF;
        } else {
                remote = of_graph_get_remote_node(dsi->dev->of_node, 0,
                                                  NWL_DSI_ENDPOINT_DCSS);
@@ -1103,11 +1104,12 @@ static int nwl_dsi_select_input(struct nwl_dsi *dsi)
                                      "No valid input endpoint found\n");
                        return -EINVAL;
                }
+               dsi->endpoint = NWL_DSI_ENDPOINT_DCSS;
        }
 
        DRM_DEV_INFO(dsi->dev, "Using %s as input source\n",
-                    (use_dcss) ? "DCSS" : "LCDIF");
-       ret = mux_control_try_select(dsi->mux, use_dcss);
+                    (dsi->endpoint == NWL_DSI_ENDPOINT_DCSS) ? "DCSS" : 
"LCDIF");
+       ret = mux_control_try_select(dsi->mux, dsi->endpoint);
        if (ret < 0)
                DRM_DEV_ERROR(dsi->dev, "Failed to select input: %d\n", ret);
 

-- 
2.55.0

Reply via email to