Skip to content

Commit 7960747

Browse files
aunsbjergkartben
authored andcommitted
drivers: fuel_gauge: fix missing casts in api functions
The fuel_gauge_get_props and fuel_gauge_set_prop functions were missing casts for the device struct which causes compiler warnings when using the -fpermissive compiler flag. Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
1 parent 10bb71e commit 7960747

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/zephyr/drivers/fuel_gauge.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ static inline int z_impl_fuel_gauge_get_props(const struct device *dev,
294294
fuel_gauge_prop_t *props,
295295
union fuel_gauge_prop_val *vals, size_t len)
296296
{
297-
const struct fuel_gauge_driver_api *api = dev->api;
297+
const struct fuel_gauge_driver_api *api = (const struct fuel_gauge_driver_api *)dev->api;
298298

299299
for (size_t i = 0; i < len; i++) {
300300
int ret = api->get_property(dev, props[i], vals + i);
@@ -322,7 +322,7 @@ __syscall int fuel_gauge_set_prop(const struct device *dev, fuel_gauge_prop_t pr
322322
static inline int z_impl_fuel_gauge_set_prop(const struct device *dev, fuel_gauge_prop_t prop,
323323
union fuel_gauge_prop_val val)
324324
{
325-
const struct fuel_gauge_driver_api *api = dev->api;
325+
const struct fuel_gauge_driver_api *api = (const struct fuel_gauge_driver_api *)dev->api;
326326

327327
if (api->set_property == NULL) {
328328
return -ENOSYS;

0 commit comments

Comments
 (0)