summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/max31790.c
AgeCommit message (Collapse)AuthorFilesLines
2019-04-15hwmon: (max31790) Use HWMON_CHANNEL_INFO macroGuenter Roeck1-38/+20
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>
2019-02-18hwmon: (max31790) Replace S_<PERMS> with octal valuesGuenter Roeck1-3/+3
Replace S_<PERMS> with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-03-22hwmon: (max31790) Set correct PWM valueAlex Hemme1-1/+1
Traced fans not spinning to incorrect PWM value being written. The passed in value was written instead of the calulated value. Fixes: 54187ff9d766 ("hwmon: (max31790) Convert to use new hwmon registration API") Signed-off-by: Alex Hemme <ahemme@cisco.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-10-17hwmon: (max31790) potential ERR_PTR dereferenceDan Carpenter1-1/+3
We should only dereference "data" after we check if it is an error pointer. Fixes: 54187ff9d766 ('hwmon: (max31790) Convert to use new hwmon registration API') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-09-08hwmon: (max31790) Convert to use new hwmon registration APIGuenter Roeck1-297/+224
Simplify code and reduce code size by using the new hwmon registration API. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-10-14hwmon: (max31790) Fix dereference of ERR_PTRSudip Mukherjee1-4/+4
max31790_update_device() return the error code in ERR_PTR. We were checking if it has returned error or not but before checking we have dereferenced it. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2015-10-14hwmon: Driver for Maxim MAX31790Il Han1-0/+603
The driver supports the Maxim MAX31790. Signed-off-by: Il Han <corone.il.han@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>