147-pinctrl-at91-pio4-fix-Prefer-unsigned-int-to-bare-us.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. From 99629d1ad7e4e03ac3324d36b703220555b65566 Mon Sep 17 00:00:00 2001
  2. From: Claudiu Beznea <[email protected]>
  3. Date: Wed, 27 Jan 2021 13:45:45 +0200
  4. Subject: [PATCH 147/247] pinctrl: at91-pio4: fix "Prefer 'unsigned int' to
  5. bare use of 'unsigned'"
  6. Fix "Prefer 'unsigned int' to bare use of 'unsigned'" checkpatch.pl
  7. warning.
  8. Signed-off-by: Claudiu Beznea <[email protected]>
  9. Acked-by: Ludovic Desroches <[email protected]>
  10. Link: https://lore.kernel.org/r/[email protected]
  11. Signed-off-by: Linus Walleij <[email protected]>
  12. ---
  13. drivers/pinctrl/pinctrl-at91-pio4.c | 110 ++++++++++++++--------------
  14. 1 file changed, 57 insertions(+), 53 deletions(-)
  15. --- a/drivers/pinctrl/pinctrl-at91-pio4.c
  16. +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
  17. @@ -80,8 +80,8 @@
  18. * @slew_rate_support: slew rate support
  19. */
  20. struct atmel_pioctrl_data {
  21. - unsigned nbanks;
  22. - unsigned last_bank_count;
  23. + unsigned int nbanks;
  24. + unsigned int last_bank_count;
  25. unsigned int slew_rate_support;
  26. };
  27. @@ -91,11 +91,11 @@ struct atmel_group {
  28. };
  29. struct atmel_pin {
  30. - unsigned pin_id;
  31. - unsigned mux;
  32. - unsigned ioset;
  33. - unsigned bank;
  34. - unsigned line;
  35. + unsigned int pin_id;
  36. + unsigned int mux;
  37. + unsigned int ioset;
  38. + unsigned int bank;
  39. + unsigned int line;
  40. const char *device;
  41. };
  42. @@ -125,16 +125,16 @@ struct atmel_pin {
  43. struct atmel_pioctrl {
  44. void __iomem *reg_base;
  45. struct clk *clk;
  46. - unsigned nbanks;
  47. + unsigned int nbanks;
  48. struct pinctrl_dev *pinctrl_dev;
  49. struct atmel_group *groups;
  50. const char * const *group_names;
  51. struct atmel_pin **pins;
  52. - unsigned npins;
  53. + unsigned int npins;
  54. struct gpio_chip *gpio_chip;
  55. struct irq_domain *irq_domain;
  56. int *irqs;
  57. - unsigned *pm_wakeup_sources;
  58. + unsigned int *pm_wakeup_sources;
  59. struct {
  60. u32 imr;
  61. u32 odsr;
  62. @@ -177,11 +177,11 @@ static void atmel_gpio_irq_ack(struct ir
  63. */
  64. }
  65. -static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned type)
  66. +static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned int type)
  67. {
  68. struct atmel_pioctrl *atmel_pioctrl = irq_data_get_irq_chip_data(d);
  69. struct atmel_pin *pin = atmel_pioctrl->pins[d->hwirq];
  70. - unsigned reg;
  71. + unsigned int reg;
  72. atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR,
  73. BIT(pin->line));
  74. @@ -268,7 +268,7 @@ static struct irq_chip atmel_gpio_irq_ch
  75. .irq_set_wake = atmel_gpio_irq_set_wake,
  76. };
  77. -static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
  78. +static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
  79. {
  80. struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
  81. @@ -316,11 +316,12 @@ static void atmel_gpio_irq_handler(struc
  82. chained_irq_exit(chip, desc);
  83. }
  84. -static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
  85. +static int atmel_gpio_direction_input(struct gpio_chip *chip,
  86. + unsigned int offset)
  87. {
  88. struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
  89. struct atmel_pin *pin = atmel_pioctrl->pins[offset];
  90. - unsigned reg;
  91. + unsigned int reg;
  92. atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR,
  93. BIT(pin->line));
  94. @@ -331,11 +332,11 @@ static int atmel_gpio_direction_input(st
  95. return 0;
  96. }
  97. -static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset)
  98. +static int atmel_gpio_get(struct gpio_chip *chip, unsigned int offset)
  99. {
  100. struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
  101. struct atmel_pin *pin = atmel_pioctrl->pins[offset];
  102. - unsigned reg;
  103. + unsigned int reg;
  104. reg = atmel_gpio_read(atmel_pioctrl, pin->bank, ATMEL_PIO_PDSR);
  105. @@ -369,12 +370,13 @@ static int atmel_gpio_get_multiple(struc
  106. return 0;
  107. }
  108. -static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset,
  109. +static int atmel_gpio_direction_output(struct gpio_chip *chip,
  110. + unsigned int offset,
  111. int value)
  112. {
  113. struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
  114. struct atmel_pin *pin = atmel_pioctrl->pins[offset];
  115. - unsigned reg;
  116. + unsigned int reg;
  117. atmel_gpio_write(atmel_pioctrl, pin->bank,
  118. value ? ATMEL_PIO_SODR : ATMEL_PIO_CODR,
  119. @@ -389,7 +391,7 @@ static int atmel_gpio_direction_output(s
  120. return 0;
  121. }
  122. -static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
  123. +static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val)
  124. {
  125. struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip);
  126. struct atmel_pin *pin = atmel_pioctrl->pins[offset];
  127. @@ -445,11 +447,11 @@ static struct gpio_chip atmel_gpio_chip
  128. /* --- PINCTRL --- */
  129. static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev,
  130. - unsigned pin_id)
  131. + unsigned int pin_id)
  132. {
  133. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  134. - unsigned bank = atmel_pioctrl->pins[pin_id]->bank;
  135. - unsigned line = atmel_pioctrl->pins[pin_id]->line;
  136. + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank;
  137. + unsigned int line = atmel_pioctrl->pins[pin_id]->line;
  138. void __iomem *addr = atmel_pioctrl->reg_base
  139. + bank * ATMEL_PIO_BANK_OFFSET;
  140. @@ -461,11 +463,11 @@ static unsigned int atmel_pin_config_rea
  141. }
  142. static void atmel_pin_config_write(struct pinctrl_dev *pctldev,
  143. - unsigned pin_id, u32 conf)
  144. + unsigned int pin_id, u32 conf)
  145. {
  146. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  147. - unsigned bank = atmel_pioctrl->pins[pin_id]->bank;
  148. - unsigned line = atmel_pioctrl->pins[pin_id]->line;
  149. + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank;
  150. + unsigned int line = atmel_pioctrl->pins[pin_id]->line;
  151. void __iomem *addr = atmel_pioctrl->reg_base
  152. + bank * ATMEL_PIO_BANK_OFFSET;
  153. @@ -483,7 +485,7 @@ static int atmel_pctl_get_groups_count(s
  154. }
  155. static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev,
  156. - unsigned selector)
  157. + unsigned int selector)
  158. {
  159. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  160. @@ -491,19 +493,20 @@ static const char *atmel_pctl_get_group_
  161. }
  162. static int atmel_pctl_get_group_pins(struct pinctrl_dev *pctldev,
  163. - unsigned selector, const unsigned **pins,
  164. - unsigned *num_pins)
  165. + unsigned int selector,
  166. + const unsigned int **pins,
  167. + unsigned int *num_pins)
  168. {
  169. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  170. - *pins = (unsigned *)&atmel_pioctrl->groups[selector].pin;
  171. + *pins = (unsigned int *)&atmel_pioctrl->groups[selector].pin;
  172. *num_pins = 1;
  173. return 0;
  174. }
  175. static struct atmel_group *
  176. -atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned pin)
  177. +atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned int pin)
  178. {
  179. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  180. int i;
  181. @@ -524,7 +527,7 @@ static int atmel_pctl_xlate_pinfunc(stru
  182. const char **func_name)
  183. {
  184. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  185. - unsigned pin_id, func_id;
  186. + unsigned int pin_id, func_id;
  187. struct atmel_group *grp;
  188. pin_id = ATMEL_GET_PIN_NO(pinfunc);
  189. @@ -554,10 +557,10 @@ static int atmel_pctl_xlate_pinfunc(stru
  190. static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
  191. struct device_node *np,
  192. struct pinctrl_map **map,
  193. - unsigned *reserved_maps,
  194. - unsigned *num_maps)
  195. + unsigned int *reserved_maps,
  196. + unsigned int *num_maps)
  197. {
  198. - unsigned num_pins, num_configs, reserve;
  199. + unsigned int num_pins, num_configs, reserve;
  200. unsigned long *configs;
  201. struct property *pins;
  202. u32 pinfunc;
  203. @@ -628,10 +631,10 @@ exit:
  204. static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
  205. struct device_node *np_config,
  206. struct pinctrl_map **map,
  207. - unsigned *num_maps)
  208. + unsigned int *num_maps)
  209. {
  210. struct device_node *np;
  211. - unsigned reserved_maps;
  212. + unsigned int reserved_maps;
  213. int ret;
  214. *map = NULL;
  215. @@ -679,13 +682,13 @@ static int atmel_pmx_get_functions_count
  216. }
  217. static const char *atmel_pmx_get_function_name(struct pinctrl_dev *pctldev,
  218. - unsigned selector)
  219. + unsigned int selector)
  220. {
  221. return atmel_functions[selector];
  222. }
  223. static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev,
  224. - unsigned selector,
  225. + unsigned int selector,
  226. const char * const **groups,
  227. unsigned * const num_groups)
  228. {
  229. @@ -698,11 +701,11 @@ static int atmel_pmx_get_function_groups
  230. }
  231. static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev,
  232. - unsigned function,
  233. - unsigned group)
  234. + unsigned int function,
  235. + unsigned int group)
  236. {
  237. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  238. - unsigned pin;
  239. + unsigned int pin;
  240. u32 conf;
  241. dev_dbg(pctldev->dev, "enable function %s group %s\n",
  242. @@ -726,13 +729,13 @@ static const struct pinmux_ops atmel_pmx
  243. };
  244. static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev,
  245. - unsigned group,
  246. + unsigned int group,
  247. unsigned long *config)
  248. {
  249. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  250. - unsigned param = pinconf_to_config_param(*config), arg = 0;
  251. + unsigned int param = pinconf_to_config_param(*config), arg = 0;
  252. struct atmel_group *grp = atmel_pioctrl->groups + group;
  253. - unsigned pin_id = grp->pin;
  254. + unsigned int pin_id = grp->pin;
  255. u32 res;
  256. res = atmel_pin_config_read(pctldev, pin_id);
  257. @@ -786,21 +789,21 @@ static int atmel_conf_pin_config_group_g
  258. }
  259. static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
  260. - unsigned group,
  261. + unsigned int group,
  262. unsigned long *configs,
  263. - unsigned num_configs)
  264. + unsigned int num_configs)
  265. {
  266. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  267. struct atmel_group *grp = atmel_pioctrl->groups + group;
  268. - unsigned bank, pin, pin_id = grp->pin;
  269. + unsigned int bank, pin, pin_id = grp->pin;
  270. u32 mask, conf = 0;
  271. int i;
  272. conf = atmel_pin_config_read(pctldev, pin_id);
  273. for (i = 0; i < num_configs; i++) {
  274. - unsigned param = pinconf_to_config_param(configs[i]);
  275. - unsigned arg = pinconf_to_config_argument(configs[i]);
  276. + unsigned int param = pinconf_to_config_param(configs[i]);
  277. + unsigned int arg = pinconf_to_config_argument(configs[i]);
  278. dev_dbg(pctldev->dev, "%s: pin=%u, config=0x%lx\n",
  279. __func__, pin_id, configs[i]);
  280. @@ -900,7 +903,8 @@ static int atmel_conf_pin_config_group_s
  281. }
  282. static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
  283. - struct seq_file *s, unsigned pin_id)
  284. + struct seq_file *s,
  285. + unsigned int pin_id)
  286. {
  287. struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev);
  288. u32 conf;
  289. @@ -1108,8 +1112,8 @@ static int atmel_pinctrl_probe(struct pl
  290. return -ENOMEM;
  291. for (i = 0 ; i < atmel_pioctrl->npins; i++) {
  292. struct atmel_group *group = atmel_pioctrl->groups + i;
  293. - unsigned bank = ATMEL_PIO_BANK(i);
  294. - unsigned line = ATMEL_PIO_LINE(i);
  295. + unsigned int bank = ATMEL_PIO_BANK(i);
  296. + unsigned int line = ATMEL_PIO_LINE(i);
  297. atmel_pioctrl->pins[i] = devm_kzalloc(dev,
  298. sizeof(**atmel_pioctrl->pins), GFP_KERNEL);