summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ltc2992.c
AgeCommit message (Collapse)Author
2021-05-10hwmon: (ltc2992) Put fwnode in error case during ->probe()Andy Shevchenko
In each iteration fwnode_for_each_available_child_node() bumps a reference counting of a loop variable followed by dropping in on a next iteration, Since in error case the loop is broken, we have to drop a reference count by ourselves. Do it for port_fwnode in error case during ->probe(). Fixes: b0bd407e94b0 ("hwmon: (ltc2992) Add support") Cc: Alexandru Tachici <alexandru.tachici@analog.com> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210510100136.3303142-1-andy.shevchenko@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-12-11hwmon: (ltc2992) Fix less than zero comparisons with an unsigned integerColin Ian King
There are several occurrances of a less than zero error check on a u32 unsigned integer. These will never be true. Fix this by making reg_value a plain int. Addresses-Coverity: ("Unsigned comparison against zero") Fixes: e126370240e0 ("hwmon: (ltc2992) Add support") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20201207142410.168987-1-colin.king@canonical.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-12-11hwmon: (ltc2992) Add support for GPIOs.Alexandru Tachici
LTC2992 has 4 open-drain GPIOS. This patch exports to user space the 4 GPIOs using the GPIO driver Linux API. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2020-12-11hwmon: (ltc2992) Add supportAlexandru Tachici
LTC2992 is a rail-to-rail system monitor that measures current, voltage, and power of two supplies. Two ADCs simultaneously measure each supply’s current. A third ADC monitors the input voltages and four auxiliary external voltages. Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>