Skip to content

Commit

Permalink
pinctrl: bcm: bcm6362: fix warning
Browse files Browse the repository at this point in the history
The current implementation of bcm6362_set_gpio() produces the following
warning on x86_64:
drivers/pinctrl/bcm/pinctrl-bcm6362.c: In function 'bcm6362_set_gpio':
drivers/pinctrl/bcm/pinctrl-bcm6362.c:503:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  503 |        (uint32_t) desc->drv_data, 0);
      |        ^

Modify the code to make it similar to bcm63268_set_gpio() in order to fix
the warning.

Fixes: 705791e ("pinctrl: add a pincontrol driver for BCM6362")
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
Noltari authored and linusw committed Mar 31, 2021
1 parent 762bee3 commit 1978d88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/bcm/pinctrl-bcm6362.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,11 @@ static int bcm6362_pinctrl_get_groups(struct pinctrl_dev *pctldev,
static void bcm6362_set_gpio(struct bcm63xx_pinctrl *pc, unsigned pin)
{
const struct pinctrl_pin_desc *desc = &bcm6362_pins[pin];
unsigned int basemode = (uintptr_t)desc->drv_data;
unsigned int mask = bcm63xx_bank_pin(pin);

if (desc->drv_data)
regmap_update_bits(pc->regs, BCM6362_BASEMODE_REG,
(uint32_t) desc->drv_data, 0);
if (basemode)
regmap_update_bits(pc->regs, BCM6362_BASEMODE_REG, basemode, 0);

if (pin < BCM63XX_BANK_GPIOS) {
/* base mode 0 => gpio 1 => mux function */
Expand Down

0 comments on commit 1978d88

Please sign in to comment.