History log of /drivers/hwmon/pmbus/ucd9000.c
Revision Date Author Comments
dd285ad7373bf5d21cceacb3b7a5eb8b72d37085 22-Feb-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (pmbus) Simplify remove functions

Since devm_kzalloc() is now used to allocate driver memory, the client
driver remove function has no purpose other than to call pmbus_do_remove().
This means we can get rid of it by redefining pmbus_do_remove() to use the
same prototype, and pointing to it directly.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
8b313ca7f1b98263ce22519b25a9c2a362eeb898 22-Feb-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc

Marginally less code and eliminate the possibility of memory leaks.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
f0967eea80ec2a19a4fe1ad27e3ff1b22c79a3c7 20-Jan-2012 Axel Lin <axel.lin@gmail.com> hwmon: convert drivers/hwmon/* to use module_i2c_driver()

This patch converts the drivers in drivers/hwmon/* to use the
module_i2c_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Steve Glendinning <steve.glendinning@smsc.com>
Cc: Riku Voipio <riku.voipio@iki.fi>
Cc: Guillaume Ligneul <guillaume.ligneul@gmail.com>
Cc: David George <david.george@ska.ac.za>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
da8e48ab483e1f54c1099bed91bfd2c302bc7ddf 30-Jul-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (pmbus) Always call _pmbus_read_byte in core driver

Always call _pmbus_read_byte() instead of pmbus_read_byte() in PMBus core
driver. With this change, device specific read functions can be implemented for
all registers.

Since the device specific read_byte function is now always called, we need to be
more careful with page validations. Only fail if the passed page number is larger
than 0, since -1 means "current page".

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
179144a0d4128e7588b3d613a14807402f5e7c37 01-Sep-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors

EINVAL was over-used in the code. Replace it with more appropriate errors.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
866cf12a0eab65f94e40608bdd21ca8dea4d0ac2 26-Aug-2011 Guenter Roeck <guenter.roeck@ericsson.com> 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>
f020b007d5dd24597f5e985a6309bcb8393797ed 31-Aug-2011 Jean Delvare <khali@linux-fr.org> hwmon: (ucd9000/ucd9200) Optimize array walk

Rewrite the loop walking the id array during probe. The new code is
better adapted to a null-terminated array, and is also clearer and
more efficient than the original.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Axel Lin <axel.lin@gmail.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
9d2ecfb768bd2f8b41816a23b0f1dda026fef41d 12-Jul-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (pmbus) Move PMBus drivers to drivers/hwmon/pmbus

Since the number of PMBus drivers is getting large, move them into
directory drivers/hwmon/pmbus to improve readability and scalability.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>