forked from kofal.net/zmk
refactor(app): replace struct device * with const struct device *
Replaced with RegExp: /(?<!const )(struct device \*)/g See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html PR: #467
This commit is contained in:
@@ -22,9 +22,9 @@ extern "C" {
|
||||
* (Internal use only.)
|
||||
*/
|
||||
|
||||
typedef int (*ext_power_enable_t)(struct device *dev);
|
||||
typedef int (*ext_power_disable_t)(struct device *dev);
|
||||
typedef int (*ext_power_get_t)(struct device *dev);
|
||||
typedef int (*ext_power_enable_t)(const struct device *dev);
|
||||
typedef int (*ext_power_disable_t)(const struct device *dev);
|
||||
typedef int (*ext_power_get_t)(const struct device *dev);
|
||||
|
||||
__subsystem struct ext_power_api {
|
||||
ext_power_enable_t enable;
|
||||
@@ -42,9 +42,9 @@ __subsystem struct ext_power_api {
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int ext_power_enable(struct device *dev);
|
||||
__syscall int ext_power_enable(const struct device *dev);
|
||||
|
||||
static inline int z_impl_ext_power_enable(struct device *dev) {
|
||||
static inline int z_impl_ext_power_enable(const struct device *dev) {
|
||||
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
|
||||
|
||||
if (api->enable == NULL) {
|
||||
@@ -61,9 +61,9 @@ static inline int z_impl_ext_power_enable(struct device *dev) {
|
||||
* @retval 0 If successful.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int ext_power_disable(struct device *dev);
|
||||
__syscall int ext_power_disable(const struct device *dev);
|
||||
|
||||
static inline int z_impl_ext_power_disable(struct device *dev) {
|
||||
static inline int z_impl_ext_power_disable(const struct device *dev) {
|
||||
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
|
||||
|
||||
if (api->disable == NULL) {
|
||||
@@ -81,9 +81,9 @@ static inline int z_impl_ext_power_disable(struct device *dev) {
|
||||
* @retval 1 if ext power is enabled.
|
||||
* @retval Negative errno code if failure.
|
||||
*/
|
||||
__syscall int ext_power_get(struct device *dev);
|
||||
__syscall int ext_power_get(const struct device *dev);
|
||||
|
||||
static inline int z_impl_ext_power_get(struct device *dev) {
|
||||
static inline int z_impl_ext_power_get(const struct device *dev) {
|
||||
const struct ext_power_api *api = (const struct ext_power_api *)dev->api;
|
||||
|
||||
if (api->get == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user