[PATCH] pinctrl/at91: Fix pin_to_mask

Mark Roszko mark.roszko at gmail.com
Fri Apr 11 10:53:00 PDT 2014


The member struct pin inside the at91_pmx_pin structs is already the
bank pin number, it was documented at the top of the driver.

/**
   * struct at91_pmx_pin - describes an At91 pin mux
   * @bank: the bank of the pin
   * @pin: the pin number in the @bank
   * @mux: the mux mode : gpio or periph_x of the pin i.e. alternate function.
   * @conf: the configuration of the pin: PULL_UP, MULTIDRIVE etc...
   */

if the pmx_pin->pin member wasn't already a bank number, then other
logic would break such as if (pin->pin >= MAX_NB_GPIO_PER_BANK) in
pin_check_config. In fact pmx_enable calls pin_check_config and should
catch an error.



More information about the linux-arm-kernel mailing list