Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: at91-pio4: fix "Prefer 'unsigned int' to bare use of 'unsigned'"

Fix "Prefer 'unsigned int' to bare use of 'unsigned'" checkpatch.pl
warning.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Link: https://lore.kernel.org/r/1611747945-29960-4-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Claudiu Beznea and committed by
Linus Walleij
b4435b42 c709135e

+57 -53
+57 -53
drivers/pinctrl/pinctrl-at91-pio4.c
··· 80 80 * @slew_rate_support: slew rate support 81 81 */ 82 82 struct atmel_pioctrl_data { 83 - unsigned nbanks; 84 - unsigned last_bank_count; 83 + unsigned int nbanks; 84 + unsigned int last_bank_count; 85 85 unsigned int slew_rate_support; 86 86 }; 87 87 ··· 91 91 }; 92 92 93 93 struct atmel_pin { 94 - unsigned pin_id; 95 - unsigned mux; 96 - unsigned ioset; 97 - unsigned bank; 98 - unsigned line; 94 + unsigned int pin_id; 95 + unsigned int mux; 96 + unsigned int ioset; 97 + unsigned int bank; 98 + unsigned int line; 99 99 const char *device; 100 100 }; 101 101 ··· 125 125 struct atmel_pioctrl { 126 126 void __iomem *reg_base; 127 127 struct clk *clk; 128 - unsigned nbanks; 128 + unsigned int nbanks; 129 129 struct pinctrl_dev *pinctrl_dev; 130 130 struct atmel_group *groups; 131 131 const char * const *group_names; 132 132 struct atmel_pin **pins; 133 - unsigned npins; 133 + unsigned int npins; 134 134 struct gpio_chip *gpio_chip; 135 135 struct irq_domain *irq_domain; 136 136 int *irqs; 137 - unsigned *pm_wakeup_sources; 137 + unsigned int *pm_wakeup_sources; 138 138 struct { 139 139 u32 imr; 140 140 u32 odsr; ··· 177 177 */ 178 178 } 179 179 180 - static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned type) 180 + static int atmel_gpio_irq_set_type(struct irq_data *d, unsigned int type) 181 181 { 182 182 struct atmel_pioctrl *atmel_pioctrl = irq_data_get_irq_chip_data(d); 183 183 struct atmel_pin *pin = atmel_pioctrl->pins[d->hwirq]; 184 - unsigned reg; 184 + unsigned int reg; 185 185 186 186 atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR, 187 187 BIT(pin->line)); ··· 268 268 .irq_set_wake = atmel_gpio_irq_set_wake, 269 269 }; 270 270 271 - static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 271 + static int atmel_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) 272 272 { 273 273 struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 274 274 ··· 316 316 chained_irq_exit(chip, desc); 317 317 } 318 318 319 - static int atmel_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 319 + static int atmel_gpio_direction_input(struct gpio_chip *chip, 320 + unsigned int offset) 320 321 { 321 322 struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 322 323 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 323 - unsigned reg; 324 + unsigned int reg; 324 325 325 326 atmel_gpio_write(atmel_pioctrl, pin->bank, ATMEL_PIO_MSKR, 326 327 BIT(pin->line)); ··· 332 331 return 0; 333 332 } 334 333 335 - static int atmel_gpio_get(struct gpio_chip *chip, unsigned offset) 334 + static int atmel_gpio_get(struct gpio_chip *chip, unsigned int offset) 336 335 { 337 336 struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 338 337 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 339 - unsigned reg; 338 + unsigned int reg; 340 339 341 340 reg = atmel_gpio_read(atmel_pioctrl, pin->bank, ATMEL_PIO_PDSR); 342 341 ··· 370 369 return 0; 371 370 } 372 371 373 - static int atmel_gpio_direction_output(struct gpio_chip *chip, unsigned offset, 372 + static int atmel_gpio_direction_output(struct gpio_chip *chip, 373 + unsigned int offset, 374 374 int value) 375 375 { 376 376 struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 377 377 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; 378 - unsigned reg; 378 + unsigned int reg; 379 379 380 380 atmel_gpio_write(atmel_pioctrl, pin->bank, 381 381 value ? ATMEL_PIO_SODR : ATMEL_PIO_CODR, ··· 391 389 return 0; 392 390 } 393 391 394 - static void atmel_gpio_set(struct gpio_chip *chip, unsigned offset, int val) 392 + static void atmel_gpio_set(struct gpio_chip *chip, unsigned int offset, int val) 395 393 { 396 394 struct atmel_pioctrl *atmel_pioctrl = gpiochip_get_data(chip); 397 395 struct atmel_pin *pin = atmel_pioctrl->pins[offset]; ··· 447 445 448 446 /* --- PINCTRL --- */ 449 447 static unsigned int atmel_pin_config_read(struct pinctrl_dev *pctldev, 450 - unsigned pin_id) 448 + unsigned int pin_id) 451 449 { 452 450 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 453 - unsigned bank = atmel_pioctrl->pins[pin_id]->bank; 454 - unsigned line = atmel_pioctrl->pins[pin_id]->line; 451 + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank; 452 + unsigned int line = atmel_pioctrl->pins[pin_id]->line; 455 453 void __iomem *addr = atmel_pioctrl->reg_base 456 454 + bank * ATMEL_PIO_BANK_OFFSET; 457 455 ··· 463 461 } 464 462 465 463 static void atmel_pin_config_write(struct pinctrl_dev *pctldev, 466 - unsigned pin_id, u32 conf) 464 + unsigned int pin_id, u32 conf) 467 465 { 468 466 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 469 - unsigned bank = atmel_pioctrl->pins[pin_id]->bank; 470 - unsigned line = atmel_pioctrl->pins[pin_id]->line; 467 + unsigned int bank = atmel_pioctrl->pins[pin_id]->bank; 468 + unsigned int line = atmel_pioctrl->pins[pin_id]->line; 471 469 void __iomem *addr = atmel_pioctrl->reg_base 472 470 + bank * ATMEL_PIO_BANK_OFFSET; 473 471 ··· 485 483 } 486 484 487 485 static const char *atmel_pctl_get_group_name(struct pinctrl_dev *pctldev, 488 - unsigned selector) 486 + unsigned int selector) 489 487 { 490 488 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 491 489 ··· 493 491 } 494 492 495 493 static int atmel_pctl_get_group_pins(struct pinctrl_dev *pctldev, 496 - unsigned selector, const unsigned **pins, 497 - unsigned *num_pins) 494 + unsigned int selector, 495 + const unsigned int **pins, 496 + unsigned int *num_pins) 498 497 { 499 498 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 500 499 501 - *pins = (unsigned *)&atmel_pioctrl->groups[selector].pin; 500 + *pins = (unsigned int *)&atmel_pioctrl->groups[selector].pin; 502 501 *num_pins = 1; 503 502 504 503 return 0; 505 504 } 506 505 507 506 static struct atmel_group * 508 - atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned pin) 507 + atmel_pctl_find_group_by_pin(struct pinctrl_dev *pctldev, unsigned int pin) 509 508 { 510 509 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 511 510 int i; ··· 527 524 const char **func_name) 528 525 { 529 526 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 530 - unsigned pin_id, func_id; 527 + unsigned int pin_id, func_id; 531 528 struct atmel_group *grp; 532 529 533 530 pin_id = ATMEL_GET_PIN_NO(pinfunc); ··· 557 554 static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev, 558 555 struct device_node *np, 559 556 struct pinctrl_map **map, 560 - unsigned *reserved_maps, 561 - unsigned *num_maps) 557 + unsigned int *reserved_maps, 558 + unsigned int *num_maps) 562 559 { 563 - unsigned num_pins, num_configs, reserve; 560 + unsigned int num_pins, num_configs, reserve; 564 561 unsigned long *configs; 565 562 struct property *pins; 566 563 u32 pinfunc; ··· 631 628 static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, 632 629 struct device_node *np_config, 633 630 struct pinctrl_map **map, 634 - unsigned *num_maps) 631 + unsigned int *num_maps) 635 632 { 636 633 struct device_node *np; 637 - unsigned reserved_maps; 634 + unsigned int reserved_maps; 638 635 int ret; 639 636 640 637 *map = NULL; ··· 682 679 } 683 680 684 681 static const char *atmel_pmx_get_function_name(struct pinctrl_dev *pctldev, 685 - unsigned selector) 682 + unsigned int selector) 686 683 { 687 684 return atmel_functions[selector]; 688 685 } 689 686 690 687 static int atmel_pmx_get_function_groups(struct pinctrl_dev *pctldev, 691 - unsigned selector, 688 + unsigned int selector, 692 689 const char * const **groups, 693 690 unsigned * const num_groups) 694 691 { ··· 701 698 } 702 699 703 700 static int atmel_pmx_set_mux(struct pinctrl_dev *pctldev, 704 - unsigned function, 705 - unsigned group) 701 + unsigned int function, 702 + unsigned int group) 706 703 { 707 704 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 708 - unsigned pin; 705 + unsigned int pin; 709 706 u32 conf; 710 707 711 708 dev_dbg(pctldev->dev, "enable function %s group %s\n", ··· 729 726 }; 730 727 731 728 static int atmel_conf_pin_config_group_get(struct pinctrl_dev *pctldev, 732 - unsigned group, 729 + unsigned int group, 733 730 unsigned long *config) 734 731 { 735 732 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 736 - unsigned param = pinconf_to_config_param(*config), arg = 0; 733 + unsigned int param = pinconf_to_config_param(*config), arg = 0; 737 734 struct atmel_group *grp = atmel_pioctrl->groups + group; 738 - unsigned pin_id = grp->pin; 735 + unsigned int pin_id = grp->pin; 739 736 u32 res; 740 737 741 738 res = atmel_pin_config_read(pctldev, pin_id); ··· 789 786 } 790 787 791 788 static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev, 792 - unsigned group, 789 + unsigned int group, 793 790 unsigned long *configs, 794 - unsigned num_configs) 791 + unsigned int num_configs) 795 792 { 796 793 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 797 794 struct atmel_group *grp = atmel_pioctrl->groups + group; 798 - unsigned bank, pin, pin_id = grp->pin; 795 + unsigned int bank, pin, pin_id = grp->pin; 799 796 u32 mask, conf = 0; 800 797 int i; 801 798 802 799 conf = atmel_pin_config_read(pctldev, pin_id); 803 800 804 801 for (i = 0; i < num_configs; i++) { 805 - unsigned param = pinconf_to_config_param(configs[i]); 806 - unsigned arg = pinconf_to_config_argument(configs[i]); 802 + unsigned int param = pinconf_to_config_param(configs[i]); 803 + unsigned int arg = pinconf_to_config_argument(configs[i]); 807 804 808 805 dev_dbg(pctldev->dev, "%s: pin=%u, config=0x%lx\n", 809 806 __func__, pin_id, configs[i]); ··· 903 900 } 904 901 905 902 static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev, 906 - struct seq_file *s, unsigned pin_id) 903 + struct seq_file *s, 904 + unsigned int pin_id) 907 905 { 908 906 struct atmel_pioctrl *atmel_pioctrl = pinctrl_dev_get_drvdata(pctldev); 909 907 u32 conf; ··· 1112 1108 return -ENOMEM; 1113 1109 for (i = 0 ; i < atmel_pioctrl->npins; i++) { 1114 1110 struct atmel_group *group = atmel_pioctrl->groups + i; 1115 - unsigned bank = ATMEL_PIO_BANK(i); 1116 - unsigned line = ATMEL_PIO_LINE(i); 1111 + unsigned int bank = ATMEL_PIO_BANK(i); 1112 + unsigned int line = ATMEL_PIO_LINE(i); 1117 1113 1118 1114 atmel_pioctrl->pins[i] = devm_kzalloc(dev, 1119 1115 sizeof(**atmel_pioctrl->pins), GFP_KERNEL);