lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bd0f97a0711011051o6d52f635i76c3a63b478ac817@mail.gmail.com>
Date:	Thu, 1 Nov 2007 13:51:55 -0400
From:	"Mike Frysinger" <vapier.adi@...il.com>
To:	"Bryan Wu" <bryan.wu@...log.com>
Cc:	khali@...ux-fr.org, i2c@...sensors.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] Blackfin I2C/TWI driver: add missing pin mux operation

On 10/30/07, Bryan Wu <bryan.wu@...log.com> wrote:
> --- a/drivers/i2c/busses/i2c-bfin-twi.c
> +++ b/drivers/i2c/busses/i2c-bfin-twi.c
> +static int setup_pin_mux(int action, struct bfin_twi_iface *iface)
> +{
> +
> +       u16 pin_req[2][3] = {
> +               {P_TWI0_SCL, P_TWI0_SDA, 0},
> +               {P_TWI1_SCL, P_TWI1_SDA, 0},
> +       };

might be better to have this in the boards file ... consider the
scenario on the BF54x where the user wants to use I2C0 and not I2C1 or
vice versa so that they can use the set of pins for something else ...
this would prevent such a setup

> +       if (action) {
> +               if (peripheral_request_list(pin_req[iface->bus_num], DRV_NAME))
> +                       return -EFAULT;
> +       } else {
> +               peripheral_free_list(pin_req[iface->bus_num]);
> +       }
> +
> +       return 0;
> +}

EFAULT is incorrect i think ... want to pass back the actual value
from peripheral_request_list()

> --- a/drivers/i2c/busses/i2c-bfin-twi.c
> +++ b/drivers/i2c/busses/i2c-bfin-twi.c
> +static int setup_pin_mux(int action, struct bfin_twi_iface *iface)
> +{
> +
> +       u16 pin_req[2][3] = {
> +               {P_TWI0_SCL, P_TWI0_SDA, 0},
> +               {P_TWI1_SCL, P_TWI1_SDA, 0},
> +       };

might be better to have this in the boards file ... consider the
scenario on the BF54x where the user wants to use I2C0 and not I2C1 or
vice versa so that they can use the set of pins for something else ...
this would prevent such a setup

       if (action)
               return peripheral_request_list(pin_req[iface->bus_num],
DRV_NAME);
       else
               peripheral_free_list(pin_req[iface->bus_num]);

       return 0;
-mike
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ