mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
regulator: tps65219: use IS_ERR() to detect an error pointer
Fix pointer comparison to integer warning from gcc & sparse:
GCC:
../drivers/regulator/tps65219-regulator.c:370:26: warning: ordered comparison of pointer with integer zero [-Wextra]
370 | if (rdev < 0) {
| ^
sparse warning:
drivers/regulator/tps65219-regulator.c:370:26: sparse: error: incompatible types for operation (<):
drivers/regulator/tps65219-regulator.c:370:26: sparse: struct regulator_dev *[assigned] rdev
drivers/regulator/tps65219-regulator.c:370:26: sparse: int
Fixes: c12ac5fc3e ("regulator: drivers: Add TI TPS65219 PMIC regulators support")
Signed-off-by: Randy Dunlap <[email protected]>
Cc: Jerome Neanne <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
Cc: Liam Girdwood <[email protected]>
Cc: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
1 parent
84c13763f2
commit
2bbba115c3
1 file changed
+1
-1
@@ -367,7 +367,7 @@ static int tps65219_regulator_probe(struct platform_device *pdev)
|
||||
irq_data[i].type = irq_type;
|
||||
|
||||
tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev);
|
||||
if (rdev < 0) {
|
||||
if (IS_ERR(rdev)) {
|
||||
dev_err(tps->dev, "Failed to get rdev for %s\n",
|
||||
irq_type->regulator_name);
|
||||
return -EINVAL;
|
||||
|
||||
Reference in new issue
Block a user