]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (pmbus) Don't return errors from driver remove functions
authorGuenter Roeck <guenter.roeck@ericsson.com>
Fri, 26 Aug 2011 15:12:38 +0000 (08:12 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Fri, 23 Sep 2011 17:39:55 +0000 (10:39 -0700)
commit5a6fbd0c2964732601b384048bc25f89649183e7
tree4ff6334edea8d350daea3041b7e1dbe7470c1fd8
parent0c96f5db8e08cf468d56e6cd1ae0a4bce6872969
hwmon: (pmbus) Don't return errors from driver remove functions

Driver remove functions have an error return value, but rarely return an error
in practice. If a driver does return an error from its remove function, the
driver won't be unloaded and is expected to stay alive.

pmbus_do_remove() is defined as returning an int, but always returns 0 (no
error). Calling code passes that return value on to high level driver
remove functions, but does not evaluate it and removes driver data even if
pmbus_do_remove() returned an error (which it in practice never does). Even if
this code could never cause a real problem, it is nevertheless conceptually
wrong.

To reduce confusion and simplify the code, change pmbus_do_remove() to be a void
function, and have PMBus client drivers always return zero in their driver
remove functions.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/pmbus/adm1275.c
drivers/hwmon/pmbus/lm25066.c
drivers/hwmon/pmbus/max16064.c
drivers/hwmon/pmbus/max34440.c
drivers/hwmon/pmbus/max8688.c
drivers/hwmon/pmbus/pmbus.c
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c
drivers/hwmon/pmbus/ucd9000.c
drivers/hwmon/pmbus/ucd9200.c