Skip to content

Commit e02e532

Browse files
ndrs-pstkartben
authored andcommitted
drivers: sensor: shell_stream: align struct shell * name to sh
Aligned the `struct shell *` argument name from `shell_ptr` to `sh` for consistency with other drivers' usage of `sh`, and to match the `shell_cmd_handler` argument name. Signed-off-by: Pisit Sawangvonganan <[email protected]>
1 parent 66955c8 commit e02e532

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

drivers/sensor/sensor_shell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct sensor_shell_processing_context {
1919

2020
extern struct rtio sensor_read_rtio;
2121

22-
int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[]);
22+
int cmd_sensor_stream(const struct shell *sh, size_t argc, char *argv[]);
2323

2424
void sensor_shell_processing_callback(int result, uint8_t *buf, uint32_t buf_len, void *userdata);
2525

drivers/sensor/sensor_shell_stream.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ static void sensor_shell_processing_entry_point(void *a, void *b, void *c)
3838
K_THREAD_DEFINE(sensor_shell_processing_tid, CONFIG_SENSOR_SHELL_THREAD_STACK_SIZE,
3939
sensor_shell_processing_entry_point, NULL, NULL, NULL, 0, 0, 0);
4040

41-
int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[])
41+
int cmd_sensor_stream(const struct shell *sh, size_t argc, char *argv[])
4242
{
4343
static struct rtio_sqe *current_streaming_handle;
4444
static struct sensor_shell_processing_context ctx;
4545
const struct device *dev = device_get_binding(argv[1]);
4646

4747
if (argc != 5 && argc != 3) {
48-
shell_error(shell_ptr, "Wrong number of arguments (%zu)", argc);
48+
shell_error(sh, "Wrong number of arguments (%zu)", argc);
4949
return -EINVAL;
5050
}
5151

5252
if (dev == NULL) {
53-
shell_error(shell_ptr, "Device unknown (%s)", argv[1]);
53+
shell_error(sh, "Device unknown (%s)", argv[1]);
5454
return -ENODEV;
5555
}
5656

5757
if (current_streaming_handle != NULL) {
58-
shell_info(shell_ptr, "Disabling existing stream");
58+
shell_info(sh, "Disabling existing stream");
5959
rtio_sqe_cancel(current_streaming_handle);
6060
}
6161

@@ -64,7 +64,7 @@ int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[])
6464
}
6565

6666
if (strcmp("on", argv[2]) != 0) {
67-
shell_error(shell_ptr, "Unknown streaming operation (%s)", argv[2]);
67+
shell_error(sh, "Unknown streaming operation (%s)", argv[2]);
6868
return -EINVAL;
6969
}
7070

@@ -91,7 +91,7 @@ int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[])
9191
} else if (strcmp("tap", argv[3]) == 0) {
9292
iodev_sensor_shell_trigger.trigger = SENSOR_TRIG_TAP;
9393
} else {
94-
shell_error(shell_ptr, "Invalid trigger (%s)", argv[3]);
94+
shell_error(sh, "Invalid trigger (%s)", argv[3]);
9595
return -EINVAL;
9696
}
9797

@@ -102,23 +102,23 @@ int cmd_sensor_stream(const struct shell *shell_ptr, size_t argc, char *argv[])
102102
} else if (strcmp("nop", argv[4]) == 0) {
103103
iodev_sensor_shell_trigger.opt = SENSOR_STREAM_DATA_NOP;
104104
} else {
105-
shell_error(shell_ptr, "Unknown trigger op (%s)", argv[4]);
105+
shell_error(sh, "Unknown trigger op (%s)", argv[4]);
106106
return -EINVAL;
107107
}
108108

109-
shell_print(shell_ptr, "Enabling stream...");
109+
shell_print(sh, "Enabling stream...");
110110
iodev_sensor_shell_stream_config.sensor = dev;
111111

112112
iodev_sensor_shell_stream_config.count = 1;
113113

114114
ctx.dev = dev;
115-
ctx.sh = shell_ptr;
115+
ctx.sh = sh;
116116

117117
int rc = sensor_stream(&iodev_sensor_shell_stream, &sensor_read_rtio, &ctx,
118118
&current_streaming_handle);
119119

120120
if (rc != 0) {
121-
shell_error(shell_ptr, "Failed to start stream");
121+
shell_error(sh, "Failed to start stream");
122122
}
123123
return rc;
124124
}

0 commit comments

Comments
 (0)