summaryrefslogtreecommitdiff
path: root/drivers/hwmon/max6621.c
AgeCommit message (Collapse)Author
2019-04-15hwmon: (max6621) Fix build warningGuenter Roeck
The following build warning is seen if CONFIG_OF is disabled. drivers/hwmon/max6621.c:573:34: warning: ‘max6621_of_match’ defined but not used Mark max6621_of_match as __maybe_unused to fix the problem. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-04-15hwmon: (max6621) Use HWMON_CHANNEL_INFO macroGuenter Roeck
The HWMON_CHANNEL_INFO macro simplifies the code, reduces the likelihood of errors, and makes the code easier to read. The conversion was done automatically with coccinelle. The semantic patch used to make this change is as follows. @r@ initializer list elements; identifier i; @@ -u32 i[] = { - elements, - 0 -}; @s@ identifier r.i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @script:ocaml t@ ty << s.ty; elements << r.elements; shorter; elems; @@ shorter := make_ident (List.hd(List.rev (Str.split (Str.regexp "_") ty))); elems := make_ident (String.concat "," (List.map (fun x -> Printf.sprintf "\n\t\t\t %s" x) (Str.split (Str.regexp " , ") elements))) @@ identifier s.j,t.shorter; identifier t.elems; @@ - &j + HWMON_CHANNEL_INFO(shorter,elems) This patch does not introduce functional changes. Many thanks to Julia Lawall for providing the semantic patch. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-29hwmon: (max6621) Inverted if condition in max6621_read()Dan Carpenter
We intended to test for failure here but accidentally tested for success. It means that we don't set "*val" to true and it means that if i2c_smbus_write_byte() does fail then we return success. Fixes: e7895864b0d7 ("hwmon: (max6621) Add support for Maxim MAX6621 temperature sensor") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-10-29hwmon: (max6621) Add support for Maxim MAX6621 temperature sensorVadim Pasternak
MAX6621 is a PECI-to-I2C translator provides an efficient, low-cost solution for PECI-to-SMBus/I2C protocol conversion. It allows reading the temperature from the PECI-compliant host directly from up to four PECI-enabled CPUs. Signed-off-by: Vadim Pasternak <vadimp@mellanox.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>