200-gpio_mvebu_checkpatch_fixes.patch 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. Wrap some long lines.
  2. Prefer seq_puts() over seq_printf().
  3. space to tab conversions.
  4. Spelling error fix.
  5. Signed-off-by: Andrew Lunn <andrew@lunn.ch>
  6. ---
  7. drivers/gpio/gpio-mvebu.c | 77 ++++++++++++++++++++++++++---------------------
  8. 1 file changed, 42 insertions(+), 35 deletions(-)
  9. --- a/drivers/gpio/gpio-mvebu.c
  10. +++ b/drivers/gpio/gpio-mvebu.c
  11. @@ -59,7 +59,7 @@
  12. #define GPIO_LEVEL_MASK_OFF 0x001c
  13. /* The MV78200 has per-CPU registers for edge mask and level mask */
  14. -#define GPIO_EDGE_MASK_MV78200_OFF(cpu) ((cpu) ? 0x30 : 0x18)
  15. +#define GPIO_EDGE_MASK_MV78200_OFF(cpu) ((cpu) ? 0x30 : 0x18)
  16. #define GPIO_LEVEL_MASK_MV78200_OFF(cpu) ((cpu) ? 0x34 : 0x1C)
  17. /* The Armada XP has per-CPU registers for interrupt cause, interrupt
  18. @@ -69,11 +69,11 @@
  19. #define GPIO_EDGE_MASK_ARMADAXP_OFF(cpu) (0x10 + (cpu) * 0x4)
  20. #define GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu) (0x20 + (cpu) * 0x4)
  21. -#define MVEBU_GPIO_SOC_VARIANT_ORION 0x1
  22. -#define MVEBU_GPIO_SOC_VARIANT_MV78200 0x2
  23. +#define MVEBU_GPIO_SOC_VARIANT_ORION 0x1
  24. +#define MVEBU_GPIO_SOC_VARIANT_MV78200 0x2
  25. #define MVEBU_GPIO_SOC_VARIANT_ARMADAXP 0x3
  26. -#define MVEBU_MAX_GPIO_PER_BANK 32
  27. +#define MVEBU_MAX_GPIO_PER_BANK 32
  28. struct mvebu_gpio_chip {
  29. struct gpio_chip chip;
  30. @@ -82,9 +82,9 @@ struct mvebu_gpio_chip {
  31. void __iomem *percpu_membase;
  32. int irqbase;
  33. struct irq_domain *domain;
  34. - int soc_variant;
  35. + int soc_variant;
  36. - /* Used to preserve GPIO registers accross suspend/resume */
  37. + /* Used to preserve GPIO registers across suspend/resume */
  38. u32 out_reg;
  39. u32 io_conf_reg;
  40. u32 blink_en_reg;
  41. @@ -107,7 +107,8 @@ static inline void __iomem *mvebu_gpiore
  42. return mvchip->membase + GPIO_BLINK_EN_OFF;
  43. }
  44. -static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip)
  45. +static inline void __iomem *
  46. +mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip)
  47. {
  48. return mvchip->membase + GPIO_IO_CONF_OFF;
  49. }
  50. @@ -117,12 +118,14 @@ static inline void __iomem *mvebu_gpiore
  51. return mvchip->membase + GPIO_IN_POL_OFF;
  52. }
  53. -static inline void __iomem *mvebu_gpioreg_data_in(struct mvebu_gpio_chip *mvchip)
  54. +static inline void __iomem *
  55. +mvebu_gpioreg_data_in(struct mvebu_gpio_chip *mvchip)
  56. {
  57. return mvchip->membase + GPIO_DATA_IN_OFF;
  58. }
  59. -static inline void __iomem *mvebu_gpioreg_edge_cause(struct mvebu_gpio_chip *mvchip)
  60. +static inline void __iomem *
  61. +mvebu_gpioreg_edge_cause(struct mvebu_gpio_chip *mvchip)
  62. {
  63. int cpu;
  64. @@ -132,13 +135,15 @@ static inline void __iomem *mvebu_gpiore
  65. return mvchip->membase + GPIO_EDGE_CAUSE_OFF;
  66. case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
  67. cpu = smp_processor_id();
  68. - return mvchip->percpu_membase + GPIO_EDGE_CAUSE_ARMADAXP_OFF(cpu);
  69. + return mvchip->percpu_membase +
  70. + GPIO_EDGE_CAUSE_ARMADAXP_OFF(cpu);
  71. default:
  72. BUG();
  73. }
  74. }
  75. -static inline void __iomem *mvebu_gpioreg_edge_mask(struct mvebu_gpio_chip *mvchip)
  76. +static inline void __iomem *
  77. +mvebu_gpioreg_edge_mask(struct mvebu_gpio_chip *mvchip)
  78. {
  79. int cpu;
  80. @@ -150,7 +155,8 @@ static inline void __iomem *mvebu_gpiore
  81. return mvchip->membase + GPIO_EDGE_MASK_MV78200_OFF(cpu);
  82. case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
  83. cpu = smp_processor_id();
  84. - return mvchip->percpu_membase + GPIO_EDGE_MASK_ARMADAXP_OFF(cpu);
  85. + return mvchip->percpu_membase +
  86. + GPIO_EDGE_MASK_ARMADAXP_OFF(cpu);
  87. default:
  88. BUG();
  89. }
  90. @@ -168,7 +174,8 @@ static void __iomem *mvebu_gpioreg_level
  91. return mvchip->membase + GPIO_LEVEL_MASK_MV78200_OFF(cpu);
  92. case MVEBU_GPIO_SOC_VARIANT_ARMADAXP:
  93. cpu = smp_processor_id();
  94. - return mvchip->percpu_membase + GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu);
  95. + return mvchip->percpu_membase +
  96. + GPIO_LEVEL_MASK_ARMADAXP_OFF(cpu);
  97. default:
  98. BUG();
  99. }
  100. @@ -372,22 +379,22 @@ static void mvebu_gpio_level_irq_unmask(
  101. * value of the line or the opposite value.
  102. *
  103. * Level IRQ handlers: DATA_IN is used directly as cause register.
  104. - * Interrupt are masked by LEVEL_MASK registers.
  105. + * Interrupt are masked by LEVEL_MASK registers.
  106. * Edge IRQ handlers: Change in DATA_IN are latched in EDGE_CAUSE.
  107. - * Interrupt are masked by EDGE_MASK registers.
  108. + * Interrupt are masked by EDGE_MASK registers.
  109. * Both-edge handlers: Similar to regular Edge handlers, but also swaps
  110. - * the polarity to catch the next line transaction.
  111. - * This is a race condition that might not perfectly
  112. - * work on some use cases.
  113. + * the polarity to catch the next line transaction.
  114. + * This is a race condition that might not perfectly
  115. + * work on some use cases.
  116. *
  117. * Every eight GPIO lines are grouped (OR'ed) before going up to main
  118. * cause register.
  119. *
  120. - * EDGE cause mask
  121. - * data-in /--------| |-----| |----\
  122. - * -----| |----- ---- to main cause reg
  123. - * X \----------------| |----/
  124. - * polarity LEVEL mask
  125. + * EDGE cause mask
  126. + * data-in /--------| |-----| |----\
  127. + * -----| |----- ---- to main cause reg
  128. + * X \----------------| |----/
  129. + * polarity LEVEL mask
  130. *
  131. ****************************************************************************/
  132. @@ -402,9 +409,8 @@ static int mvebu_gpio_irq_set_type(struc
  133. pin = d->hwirq;
  134. u = readl_relaxed(mvebu_gpioreg_io_conf(mvchip)) & (1 << pin);
  135. - if (!u) {
  136. + if (!u)
  137. return -EINVAL;
  138. - }
  139. type &= IRQ_TYPE_SENSE_MASK;
  140. if (type == IRQ_TYPE_NONE)
  141. @@ -537,13 +543,13 @@ static void mvebu_gpio_dbg_show(struct s
  142. (data_in ^ in_pol) & msk ? "hi" : "lo",
  143. in_pol & msk ? "lo" : "hi");
  144. if (!((edg_msk | lvl_msk) & msk)) {
  145. - seq_printf(s, " disabled\n");
  146. + seq_puts(s, " disabled\n");
  147. continue;
  148. }
  149. if (edg_msk & msk)
  150. - seq_printf(s, " edge ");
  151. + seq_puts(s, " edge ");
  152. if (lvl_msk & msk)
  153. - seq_printf(s, " level");
  154. + seq_puts(s, " level");
  155. seq_printf(s, " (%s)\n", cause & msk ? "pending" : "clear ");
  156. }
  157. }
  158. @@ -554,15 +560,15 @@ static void mvebu_gpio_dbg_show(struct s
  159. static const struct of_device_id mvebu_gpio_of_match[] = {
  160. {
  161. .compatible = "marvell,orion-gpio",
  162. - .data = (void *) MVEBU_GPIO_SOC_VARIANT_ORION,
  163. + .data = (void *) MVEBU_GPIO_SOC_VARIANT_ORION,
  164. },
  165. {
  166. .compatible = "marvell,mv78200-gpio",
  167. - .data = (void *) MVEBU_GPIO_SOC_VARIANT_MV78200,
  168. + .data = (void *) MVEBU_GPIO_SOC_VARIANT_MV78200,
  169. },
  170. {
  171. .compatible = "marvell,armadaxp-gpio",
  172. - .data = (void *) MVEBU_GPIO_SOC_VARIANT_ARMADAXP,
  173. + .data = (void *) MVEBU_GPIO_SOC_VARIANT_ARMADAXP,
  174. },
  175. {
  176. /* sentinel */
  177. @@ -676,7 +682,8 @@ static int mvebu_gpio_probe(struct platf
  178. else
  179. soc_variant = MVEBU_GPIO_SOC_VARIANT_ORION;
  180. - mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip), GFP_KERNEL);
  181. + mvchip = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_gpio_chip),
  182. + GFP_KERNEL);
  183. if (!mvchip)
  184. return -ENOMEM;
  185. @@ -775,8 +782,8 @@ static int mvebu_gpio_probe(struct platf
  186. * interrupt handlers, with each handler dealing with 8 GPIO
  187. * pins. */
  188. for (i = 0; i < 4; i++) {
  189. - int irq;
  190. - irq = platform_get_irq(pdev, i);
  191. + int irq = platform_get_irq(pdev, i);
  192. +
  193. if (irq < 0)
  194. continue;
  195. irq_set_handler_data(irq, mvchip);
  196. @@ -835,7 +842,7 @@ static int mvebu_gpio_probe(struct platf
  197. static struct platform_driver mvebu_gpio_driver = {
  198. .driver = {
  199. - .name = "mvebu-gpio",
  200. + .name = "mvebu-gpio",
  201. .of_match_table = mvebu_gpio_of_match,
  202. },
  203. .probe = mvebu_gpio_probe,