drivers: regulator: improve regulator_count_voltages specs
- Interface guarantees that voltage indices start from zero to regulator_count_voltages() - Function always return an unsigned number. If the device doesn't implement the API returned value is zero, as expected. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
9fc1ca7997
commit
9a73be82c4
2 changed files with 8 additions and 14 deletions
|
@ -263,12 +263,7 @@ static int regulator_set_voltage_mode(const struct device *dev,
|
|||
config->desc->vsel_mask, (uint8_t)idx);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Part of the extended regulator consumer API
|
||||
* Returns the number of supported voltages
|
||||
*/
|
||||
static int regulator_pca9420_count_voltages(const struct device *dev)
|
||||
static unsigned int regulator_pca9420_count_voltages(const struct device *dev)
|
||||
{
|
||||
const struct regulator_pca9420_config *config = dev->config;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue