Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: core: remove some dead code

Originally queue_delayed_work() used to negative error codes or 0 and 1
on success depending if the work was queued or not. It caused a lot of
bugs where people treated all non-zero returns as failures so we changed
it to return bool instead in d4283e937861 ('workqueue: make queueing
functions return bool'). Now it never returns failure.

Checking for negative values causes a static checker warning since it is
impossible based on the bool type.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
70dc6daf 83080a14

+3 -8
+3 -8
drivers/regulator/core.c
··· 2368 2368 int regulator_disable_deferred(struct regulator *regulator, int ms) 2369 2369 { 2370 2370 struct regulator_dev *rdev = regulator->rdev; 2371 - int ret; 2372 2371 2373 2372 if (regulator->always_on) 2374 2373 return 0; ··· 2379 2380 rdev->deferred_disables++; 2380 2381 mutex_unlock(&rdev->mutex); 2381 2382 2382 - ret = queue_delayed_work(system_power_efficient_wq, 2383 - &rdev->disable_work, 2384 - msecs_to_jiffies(ms)); 2385 - if (ret < 0) 2386 - return ret; 2387 - else 2388 - return 0; 2383 + queue_delayed_work(system_power_efficient_wq, &rdev->disable_work, 2384 + msecs_to_jiffies(ms)); 2385 + return 0; 2389 2386 } 2390 2387 EXPORT_SYMBOL_GPL(regulator_disable_deferred); 2391 2388