Skip to content

Commit 6ae753f

Browse files
faxe1008carlescufi
authored andcommitted
drivers: stepper: Fix missing _driver_api suffix
The gen_kobject_list.py script expects the __subystem declaration to end with _driver_api. Adjust the stepper api and existing driver implementation accordingly. Signed-off-by: Fabian Blatz <[email protected]>
1 parent 59685b5 commit 6ae753f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

drivers/stepper/gpio_stepper_controller.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static int gpio_stepper_motor_controller_init(const struct device *dev)
322322
.control_pins = gpio_stepper_motor_control_pins_##child};
323323

324324
#define GPIO_STEPPER_API_DEFINE(child) \
325-
static const struct stepper_api gpio_stepper_api_##child = { \
325+
static const struct stepper_driver_api gpio_stepper_api_##child = { \
326326
.enable = gpio_stepper_enable, \
327327
.move = gpio_stepper_move, \
328328
.is_moving = gpio_stepper_is_moving, \

include/zephyr/drivers/stepper.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ typedef int (*stepper_enable_constant_velocity_mode_t)(const struct device *dev,
168168
/**
169169
* @brief Stepper Motor Controller API
170170
*/
171-
__subsystem struct stepper_api {
171+
__subsystem struct stepper_driver_api {
172172
stepper_enable_t enable;
173173
stepper_move_t move;
174174
stepper_set_max_velocity_t set_max_velocity;
@@ -198,7 +198,7 @@ __syscall int stepper_enable(const struct device *dev, const bool enable);
198198

199199
static inline int z_impl_stepper_enable(const struct device *dev, const bool enable)
200200
{
201-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
201+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
202202

203203
return api->enable(dev, enable);
204204
}
@@ -222,7 +222,7 @@ __syscall int stepper_move(const struct device *dev, int32_t micro_steps,
222222
static inline int z_impl_stepper_move(const struct device *dev, const int32_t micro_steps,
223223
struct k_poll_signal *async)
224224
{
225-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
225+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
226226

227227
return api->move(dev, micro_steps, async);
228228
}
@@ -248,7 +248,7 @@ __syscall int stepper_set_max_velocity(const struct device *dev, uint32_t micro_
248248
static inline int z_impl_stepper_set_max_velocity(const struct device *dev,
249249
const uint32_t micro_steps_per_second)
250250
{
251-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
251+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
252252

253253
return api->set_max_velocity(dev, micro_steps_per_second);
254254
}
@@ -270,7 +270,7 @@ __syscall int stepper_set_micro_step_res(const struct device *dev,
270270
static inline int z_impl_stepper_set_micro_step_res(const struct device *dev,
271271
enum micro_step_resolution resolution)
272272
{
273-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
273+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
274274

275275
if (api->set_micro_step_res == NULL) {
276276
return -ENOSYS;
@@ -294,7 +294,7 @@ __syscall int stepper_get_micro_step_res(const struct device *dev,
294294
static inline int z_impl_stepper_get_micro_step_res(const struct device *dev,
295295
enum micro_step_resolution *resolution)
296296
{
297-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
297+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
298298

299299
if (api->get_micro_step_res == NULL) {
300300
return -ENOSYS;
@@ -316,7 +316,7 @@ __syscall int stepper_set_actual_position(const struct device *dev, int32_t valu
316316

317317
static inline int z_impl_stepper_set_actual_position(const struct device *dev, const int32_t value)
318318
{
319-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
319+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
320320

321321
if (api->set_actual_position == NULL) {
322322
return -ENOSYS;
@@ -338,7 +338,7 @@ __syscall int stepper_get_actual_position(const struct device *dev, int32_t *val
338338

339339
static inline int z_impl_stepper_get_actual_position(const struct device *dev, int32_t *value)
340340
{
341-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
341+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
342342

343343
if (api->get_actual_position == NULL) {
344344
return -ENOSYS;
@@ -366,7 +366,7 @@ __syscall int stepper_set_target_position(const struct device *dev, int32_t valu
366366
static inline int z_impl_stepper_set_target_position(const struct device *dev, const int32_t value,
367367
struct k_poll_signal *async)
368368
{
369-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
369+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
370370

371371
if (api->set_target_position == NULL) {
372372
return -ENOSYS;
@@ -388,7 +388,7 @@ __syscall int stepper_is_moving(const struct device *dev, bool *is_moving);
388388

389389
static inline int z_impl_stepper_is_moving(const struct device *dev, bool *is_moving)
390390
{
391-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
391+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
392392

393393
if (api->is_moving == NULL) {
394394
return -ENOSYS;
@@ -421,7 +421,7 @@ __syscall int stepper_enable_constant_velocity_mode(const struct device *dev,
421421
static inline int z_impl_stepper_enable_constant_velocity_mode(
422422
const struct device *dev, const enum stepper_direction direction, const uint32_t value)
423423
{
424-
const struct stepper_api *api = (const struct stepper_api *)dev->api;
424+
const struct stepper_driver_api *api = (const struct stepper_driver_api *)dev->api;
425425

426426
if (api->enable_constant_velocity_mode == NULL) {
427427
return -ENOSYS;

0 commit comments

Comments
 (0)