The null pointer check on regmap that checks for a dev_get_regmap failure
is currently returning -ENOENT if the regmap succeeded. Fix this by adding
in the missing ! operator.
Fixes: 4860158b45b4 ("regulator: Add support for QCOM PMIC VBUS booster")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Dereference after null check")
Link: https://lore.kernel.org/r/20200702115659.38208-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
}
regmap = dev_get_regmap(dev->parent, NULL);
- if (regmap) {
+ if (!regmap) {
dev_err(dev, "Failed to get regmap\n");
return -ENOENT;
}