Browse Source

refactor(app): replace `driver_api` with `api`

See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html
PR: #467
xmkb
innovaker 4 years ago committed by Pete Johanson
parent
commit
33c959d031
  1. 6
      app/include/drivers/behavior.h
  2. 6
      app/include/drivers/ext_power.h

6
app/include/drivers/behavior.h

@ -49,7 +49,7 @@ __syscall int behavior_keymap_binding_pressed(struct zmk_behavior_binding *bindi @@ -49,7 +49,7 @@ __syscall int behavior_keymap_binding_pressed(struct zmk_behavior_binding *bindi
static inline int z_impl_behavior_keymap_binding_pressed(struct zmk_behavior_binding *binding,
struct zmk_behavior_binding_event event) {
struct device *dev = device_get_binding(binding->behavior_dev);
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api;
if (api->binding_pressed == NULL) {
return -ENOTSUP;
@ -72,7 +72,7 @@ __syscall int behavior_keymap_binding_released(struct zmk_behavior_binding *bind @@ -72,7 +72,7 @@ __syscall int behavior_keymap_binding_released(struct zmk_behavior_binding *bind
static inline int z_impl_behavior_keymap_binding_released(struct zmk_behavior_binding *binding,
struct zmk_behavior_binding_event event) {
struct device *dev = device_get_binding(binding->behavior_dev);
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api;
if (api->binding_released == NULL) {
return -ENOTSUP;
@ -98,7 +98,7 @@ static inline int @@ -98,7 +98,7 @@ static inline int
z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding,
struct device *sensor, int64_t timestamp) {
struct device *dev = device_get_binding(binding->behavior_dev);
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->driver_api;
const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api;
if (api->sensor_binding_triggered == NULL) {
return -ENOTSUP;

6
app/include/drivers/ext_power.h

@ -45,7 +45,7 @@ __subsystem struct ext_power_api { @@ -45,7 +45,7 @@ __subsystem struct ext_power_api {
__syscall int ext_power_enable(struct device *dev);
static inline int z_impl_ext_power_enable(struct device *dev) {
const struct ext_power_api *api = (const struct ext_power_api *)dev->driver_api;
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
if (api->enable == NULL) {
return -ENOTSUP;
@ -64,7 +64,7 @@ static inline int z_impl_ext_power_enable(struct device *dev) { @@ -64,7 +64,7 @@ static inline int z_impl_ext_power_enable(struct device *dev) {
__syscall int ext_power_disable(struct device *dev);
static inline int z_impl_ext_power_disable(struct device *dev) {
const struct ext_power_api *api = (const struct ext_power_api *)dev->driver_api;
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
if (api->disable == NULL) {
return -ENOTSUP;
@ -84,7 +84,7 @@ static inline int z_impl_ext_power_disable(struct device *dev) { @@ -84,7 +84,7 @@ static inline int z_impl_ext_power_disable(struct device *dev) {
__syscall int ext_power_get(struct device *dev);
static inline int z_impl_ext_power_get(struct device *dev) {
const struct ext_power_api *api = (const struct ext_power_api *)dev->driver_api;
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
if (api->get == NULL) {
return -ENOTSUP;

Loading…
Cancel
Save