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

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