In palmas_smps_val and palmas_ldo_val hex is an unsigned variable being
assigned the return value from a function that returns int. Change hex
to be an int so that the following test for an error as a negative value
will work as expected.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
static int palmas_smps_val(struct udevice *dev, int op, int *uV)
{
- unsigned int hex, adr;
- int ret;
+ unsigned int adr;
+ int hex, ret;
bool range;
struct dm_regulator_uclass_plat *uc_pdata;
static int palmas_ldo_val(struct udevice *dev, int op, int *uV)
{
- unsigned int hex, adr;
- int ret;
+ unsigned int adr;
+ int hex, ret;
struct dm_regulator_uclass_plat *uc_pdata;