Skip to content

Commit b0946f5

Browse files
Nikolai-Lymodlin
authored andcommitted
Define PIPE_NOT_CONFIGURED constant and update pipe_id assignments for clarity
1 parent e6ff1f5 commit b0946f5

2 files changed

Lines changed: 6 additions & 1489 deletions

File tree

kernel/realsense/d4xx.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ enum ds5_mux_pad {
185185

186186
#define CSI2_MAX_VIRTUAL_CHANNELS 4
187187

188+
#define PIPE_NOT_CONFIGURED -1
189+
188190
#define DFU_WAIT_RET_LEN 6
189191

190192
#define DS5_START_POLL_TIME 10
@@ -1757,7 +1759,7 @@ static int ds5_configure(struct ds5 *state)
17571759
data_type2 = (state->is_imu || is_calib) ? 0x00 : md_fmt;
17581760

17591761
vc_id = state->g_ctx.dst_vc;
1760-
if (-1 == sensor->pipe_id ||
1762+
if (PIPE_NOT_CONFIGURED == sensor->pipe_id ||
17611763
sensor->pipe_data_type1 != data_type1 ||
17621764
sensor->pipe_data_type2 != data_type2 ||
17631765
sensor->pipe_vc_id != vc_id) {
@@ -2277,7 +2279,7 @@ static int ds5_hw_reset_with_recovery(struct ds5 *state)
22772279
int release_ret = max9296_release_pipe(state->dser_dev, sensor->pipe_id);
22782280
dev_warn(&state->client->dev, "release pipe %d (%d)\n",
22792281
sensor->pipe_id, release_ret);
2280-
sensor->pipe_id = -1;
2282+
sensor->pipe_id = PIPE_NOT_CONFIGURED;
22812283
}
22822284
}
22832285
mutex_unlock(&serdes_lock__);
@@ -3973,7 +3975,7 @@ static int ds5_sensor_init(struct i2c_client *c, struct ds5 *state,
39733975
struct d4xx_pdata *dpdata = c->dev.platform_data;
39743976
char suffix = dpdata->suffix;
39753977
#endif
3976-
sensor->pipe_id = -1;
3978+
sensor->pipe_id = PIPE_NOT_CONFIGURED;
39773979
v4l2_i2c_subdev_init(sd, c, ops);
39783980
// See tegracam_v4l2.c tegracam_v4l2subdev_register()
39793981
// Set owner to NULL so we can unload the driver module
@@ -4605,7 +4607,7 @@ static int ds5_mux_s_stream(struct v4l2_subdev *sd, int on)
46054607
mutex_lock(&serdes_lock__);
46064608
if (state->dser_ops->release_pipe(state->dser_dev, sensor->pipe_id) < 0)
46074609
dev_warn(&state->client->dev, "release pipe failed\n");
4608-
sensor->pipe_id = -1;
4610+
sensor->pipe_id = PIPE_NOT_CONFIGURED;
46094611
mutex_unlock(&serdes_lock__);
46104612
}
46114613
#endif

0 commit comments

Comments
 (0)