1. 16 Apr, 2019 40 commits
    • Guenter Roeck's avatar
      hwmon: (max6697) Fix build warning · f198a869
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/max6697.c:653:34: warning:
      	‘max6697_of_match’ defined but not used
      
      Mark max6697_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      f198a869
    • Guenter Roeck's avatar
      hwmon: (ina209) Fix build warning · 32c2d402
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/ina209.c:590:34: warning:
      	‘ina209_of_match’ defined but not used
      
      Mark ina209_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      32c2d402
    • Guenter Roeck's avatar
      hwmon: (lm75) Fix build warning · ffa83e78
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/lm75.c:446:34: warning:
      	‘lm75_of_match’ defined but not used
      
      Mark lm75_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      ffa83e78
    • Guenter Roeck's avatar
      hwmon: (w83773g) Fix build warning · acb614a3
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/w83773g.c:47:34: warning:
      	‘w83773_of_match’ defined but not used
      
      Mark w83773_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      acb614a3
    • Guenter Roeck's avatar
      hwmon: (ads7828) Fix build warning · 0337dd9b
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/ads7828.c:203:34: warning:
      	‘ads7828_of_match’ defined but not used
      
      Mark ads7828_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      0337dd9b
    • Guenter Roeck's avatar
      hwmon: (hih6130) Fix build warning · a62fe340
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/hih6130.c:255:34: warning:
      	‘hih6130_of_match’ defined but not used
      
      Mark hih6130_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      a62fe340
    • Guenter Roeck's avatar
      hwmon: (adt7475) Fix build warning · fe339dbf
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/adt7475.c:171:34: warning:
      	‘adt7475_of_match’ defined but not used
      
      Mark adt7475_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      fe339dbf
    • Guenter Roeck's avatar
      hwmon: (ads1015) Fix build warning · eb3cb6d5
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/ads1015.c:310:34: warning:
      	‘ads1015_of_match’ defined but not used
      
      Marking ads1015_of_match as __maybe_unused fixes the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      eb3cb6d5
    • Guenter Roeck's avatar
      hwmon: (tmp103) Fix build warning · 20894216
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/tmp103.c:173:34: warning:
      	‘tmp103_of_match’ defined but not used
      
      Marking tmp103_of_match as __maybe_unused fixes the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      20894216
    • Guenter Roeck's avatar
      hwmon: (tmp102) Fix build warning · 07af9a4a
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/tmp102.c:324:34: warning:
      	‘tmp102_of_match’ defined but not used
      
      Mark it as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      07af9a4a
    • Guenter Roeck's avatar
      hwmon: (ad7414) Fix build warning · 07182986
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/ad7414.c:218:34: warning:
      	‘ad7414_of_match’ defined but not used
      
      Marking ad7414_of_match as __mayybe_unused fixes the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      07182986
    • Guenter Roeck's avatar
      hwmon: (adc128d818) Fix build warning · 462d7e7e
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/adc128d818.c:524:34: warning:
      	‘adc128_of_match’ defined but not used
      
      Mark adc128_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      462d7e7e
    • Guenter Roeck's avatar
      hwmon: (lm90) Fix build warning · 787afaa3
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/lm90.c:239:34: warning:
      	‘lm90_of_match’ defined but not used
      
      Mark lm90_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      787afaa3
    • Guenter Roeck's avatar
      hwmon: (ltc4151) Fix build warning · a90cdd13
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/ltc4151.c:211:34: warning:
      	‘ltc4151_match’ defined but not used
      
      Mark ltc4151_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      a90cdd13
    • Guenter Roeck's avatar
      hwmon: (pmbus/ucd900) Fix build warning · 64e51162
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/pmbus/ucd9000.c:154:34: warning:
      	‘ucd9000_of_match’ defined but not used
      
      Mark ucd9000_of_match as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      64e51162
    • Guenter Roeck's avatar
      hwmon: (pmbus/tps53679) Fix build warning · e91cb17b
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is observed.
      
      drivers/hwmon/pmbus/tps53679.c:100:34: warning:
      	‘tps53679_of_match’ defined but not used
      
      Marking tps53679_of_match as __maybe_unused fixes the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      e91cb17b
    • Guenter Roeck's avatar
      hwmon: (pmbus/ucd9200): Mark ucd9200_of_match as maybe_unused · 9c6b0f75
      Guenter Roeck authored
      If CONFIG_OF is not enabled, the following build warning is
      observed.
      
      drivers/hwmon/pmbus/ucd9200.c:50:34: warning:
      	‘ucd9200_of_match’ defined but not used
      
      Mark it as __maybe_unused to fix the problem.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      9c6b0f75
    • Andrey Smirnov's avatar
      hwmon: (iio_hwmon) Simplify attr.name generation in iio_hwmon_probe() · cb202bb8
      Andrey Smirnov authored
      Since every call to devm_kasprintf() in the switch statement is mostly
      the same, we can move all of the shared code outside and capture
      differencies with two helper variables. No functional change intended.
      Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      cb202bb8
    • Guenter Roeck's avatar
      hwmon: (jz4740) Use devm_platform_ioremap_resource · 5aaa5873
      Guenter Roeck authored
      The new helper devm_platform_ioremap_resource() wraps
      platform_get_resource() and devm_ioremap_resource() together.
      Use it to simplify the code.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      5aaa5873
    • Guenter Roeck's avatar
      hwmon: (w83773g) Use HWMON_CHANNEL_INFO macro · 2f2defda
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      2f2defda
    • Guenter Roeck's avatar
      hwmon: (tmp108) Use HWMON_CHANNEL_INFO macro · 6cbd4926
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      6cbd4926
    • Guenter Roeck's avatar
      hwmon: (tmp102) Use HWMON_CHANNEL_INFO macro · 88078254
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      88078254
    • Guenter Roeck's avatar
      hwmon: (raspberrypi-hwmon) Use HWMON_CHANNEL_INFO macro · 0c42186e
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      0c42186e
    • Guenter Roeck's avatar
      hwmon: (npcm750-pwm-fan) Use HWMON_CHANNEL_INFO macro · dfeace08
      Guenter Roeck authored
      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.
      
      Cc: Avi Fishman <avifishman70@gmail.com>
      Cc: Tomer Maimon <tmaimon77@gmail.com>
      Cc: Patrick Venture <venture@google.com>
      Cc: Nancy Yuen <yuenn@google.com>
      Cc: Brendan Higgins <brendanhiggins@google.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      dfeace08
    • Guenter Roeck's avatar
      hwmon: (mlxreg-fan) Use HWMON_CHANNEL_INFO macro · 725dcf08
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      725dcf08
    • Guenter Roeck's avatar
      hwmon: (max6621) Use HWMON_CHANNEL_INFO macro · dcb00ee8
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      dcb00ee8
    • Guenter Roeck's avatar
      hwmon: (max31790) Use HWMON_CHANNEL_INFO macro · b605e671
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      b605e671
    • Guenter Roeck's avatar
      hwmon: (ltq-cputemp) Use HWMON_CHANNEL_INFO macro · f4a407f4
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      f4a407f4
    • Guenter Roeck's avatar
      hwmon: (ltc4245) Use HWMON_CHANNEL_INFO macro · 0ee508f0
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      0ee508f0
    • Guenter Roeck's avatar
      hwmon: (lm95245) Use HWMON_CHANNEL_INFO macro · 7aea0064
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      7aea0064
    • Guenter Roeck's avatar
      hwmon: (lm95241) Use HWMON_CHANNEL_INFO macro · f5011f9f
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      f5011f9f
    • Guenter Roeck's avatar
      hwmon: (lm90) Use HWMON_CHANNEL_INFO macro · a4d41e67
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      a4d41e67
    • Guenter Roeck's avatar
      hwmon: (lm75) Use HWMON_CHANNEL_INFO macro · e4f6fed1
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      e4f6fed1
    • Guenter Roeck's avatar
      hwmon: (jc42) Use HWMON_CHANNEL_INFO macro · 1eade10f
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      1eade10f
    • Guenter Roeck's avatar
      hwmon: (ina3221) Use HWMON_CHANNEL_INFO macro · 6f307b7c
      Guenter Roeck authored
      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.
      
      The patch was post-edited to retain comments.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      6f307b7c
    • Guenter Roeck's avatar
      hwmon: (adt7411) Use HWMON_CHANNEL_INFO macro · ff56121e
      Guenter Roeck authored
      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: default avatarGuenter Roeck <linux@roeck-us.net>
      ff56121e
    • Guenter Roeck's avatar
      hwmon: Documentation: Add usage example for HWMON_CHANNEL_INFO · 6bf2db46
      Guenter Roeck authored
      The new HWMON_CHANNEL_INFO macro simplifies the code, reduces the
      likelihood of errors, and makes the code easier to read. Add a usage
      example to help driver writers to actually use it.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      6bf2db46
    • Guenter Roeck's avatar
      hwmon: (nct7904) Use new HWMON_CHANNEL_INFO() macro · 4ec1d234
      Guenter Roeck authored
      The new macro simplifies the code, reduces the likelihood of errors,
      and makes the code easier to read.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      4ec1d234
    • Lucas Tanure's avatar
      hwmon: lochnagar: Add Lochnagar 2 hardware monitoring driver · 4cdb5621
      Lucas Tanure authored
      Lochnagar is an evaluation and development board for Cirrus
      Logic Smart CODEC and Amp devices. It allows the connection of
      most Cirrus Logic devices on mini-cards, as well as allowing
      connection of various application processor systems to provide a
      full evaluation platform.
      
      This driver adds support for the hardware monitoring features of
      the Lochnagar 2 to the hwmon API. Monitoring is provided for
      the board voltages, currents and temperature supported by the
      board controller chip.
      Signed-off-by: default avatarLucas Tanure <tanureal@opensource.cirrus.com>
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      4cdb5621
    • Charles Keepax's avatar
      hwmon: lochnagar: Add device tree binding document · 5ad4d7ca
      Charles Keepax authored
      Lochnagar is an evaluation and development board for Cirrus
      Logic Smart CODEC and Amp devices. It allows the connection of
      most Cirrus Logic devices on mini-cards, as well as allowing
      connection of various application processor systems to provide a
      full evaluation platform. This driver supports the board
      controller chip on the Lochnagar board.
      Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      5ad4d7ca