device_pm: correct nop documented behavior

The device_pm_control_nop function is documented to always return zero
regardless of operation.  However, when device_get_power_state() is
invoked with this control function it returns success leaving the
output parameter state unmodified, which may not be a valid device
state.

Document and implement that the nop control function returns -ENOTSUP
always.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-05-20 08:58:56 -05:00 committed by Carles Cufí
commit ae935dccdf
2 changed files with 2 additions and 2 deletions

View file

@ -387,7 +387,7 @@ void device_busy_clear(struct device *busy_dev);
* @param cb Unused
* @param unused_arg Unused
*
* @retval 0 Always returns 0
* @retval -ENOTSUP for all operations.
*/
int device_pm_control_nop(struct device *unused_device,
u32_t unused_ctrl_command,

View file

@ -124,7 +124,7 @@ int device_pm_control_nop(struct device *unused_device,
device_pm_cb cb,
void *unused_arg)
{
return 0;
return -ENOTSUP;
}
void device_list_get(struct device **device_list, int *device_count)