aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/as370-hwmon.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-05-22hwmon: (as370-hwmon) Use HWMON_CHANNEL_INFO macroGuenter Roeck1-11/+1
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. @s@ identifier i,j,ty; @@ -struct hwmon_channel_info j = { - .type = ty, - .config = i, -}; @r@ initializer list elements; identifier s.i; @@ -u32 i[] = { - elements, - 0 -}; @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 coccinelle script. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: (as370-hwmon) fix devm_platform_ioremap_resource.cocci warningskbuild test robot1-3/+1
Use devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together. Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci Fixes: 658e687b4218 ("hwmon: Add Synaptics AS370 PVT sensor driver") CC: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Signed-off-by: kbuild test robot <lkp@intel.com> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr> Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Link: https://lore.kernel.org/r/alpine.DEB.2.21.1909030646180.3228@hadrien Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2019-09-03hwmon: Add Synaptics AS370 PVT sensor driverJisheng Zhang1-0/+147
Add a new driver for Synaptics AS370 PVT sensors. Currently, only temperature is supported. Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20190827113259.4fb64a17@xhacker.debian Signed-off-by: Guenter Roeck <linux@roeck-us.net>