Skip to content

Commit 3bd9352

Browse files
gmarullcarlescufi
authored andcommitted
drivers: regulator: npm1100: regulator device may be unused
Since nPM1100 may be configured statically in some circuits, BUCK node may note be defined, so neither API ops or init call are used in the code. Add __unused attribute to account for such case. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent f0c12db commit 3bd9352

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/regulator/regulator_npm1100.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <zephyr/drivers/gpio.h>
1111
#include <zephyr/drivers/regulator.h>
1212
#include <zephyr/dt-bindings/regulator/npm1100.h>
13+
#include <zephyr/toolchain.h>
1314

1415
struct regulator_npm1100_pconfig {
1516
struct gpio_dt_spec iset;
@@ -57,7 +58,7 @@ static int regulator_npm1100_get_mode(const struct device *dev,
5758
return 0;
5859
}
5960

60-
static int regulator_npm1100_init(const struct device *dev)
61+
static __unused int regulator_npm1100_init(const struct device *dev)
6162
{
6263
const struct regulator_npm1100_config *config = dev->config;
6364
int ret;
@@ -100,7 +101,7 @@ static int regulator_npm1100_common_init(const struct device *dev)
100101
return 0;
101102
}
102103

103-
static const struct regulator_driver_api api = {
104+
static const __unused struct regulator_driver_api api = {
104105
.set_mode = regulator_npm1100_set_mode,
105106
.get_mode = regulator_npm1100_get_mode,
106107
};

0 commit comments

Comments
 (0)