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]
Date:	Mon, 28 Jan 2013 11:38:50 -0800
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI

On 01/27/13 06:12, Mark Brown wrote:
> diff --git a/drivers/base/regmap/regmap-spi.c b/drivers/base/regmap/regmap-spi.c
> index ffa46a9..bb19592 100644
> --- a/drivers/base/regmap/regmap-spi.c
> +++ b/drivers/base/regmap/regmap-spi.c
> @@ -15,6 +15,21 @@
>  #include <linux/init.h>
>  #include <linux/module.h>
>  
> +#include "internal.h"
> +
> +struct regmap_async_spi {
> +	struct regmap_async core;
> +	struct spi_message m;
> +	struct spi_transfer t[2];
> +};
> +
> +static void regmap_spi_complete(void *data)
> +{
> +	struct regmap_async_spi *async = data;
> +
> +	regmap_async_complete_cb(&async->core, async->m.status);
> +}
> +
>  static int regmap_spi_write(void *context, const void *data, size_t count)
>  {
>  	struct device *dev = context;
> @@ -40,6 +55,30 @@ static int regmap_spi_gather_write(void *context,
>  	return spi_sync(spi, &m);
>  }
>  
> +static int regmap_spi_async_write(void *context,
> +				  const void *reg, size_t reg_len,
> +				  const void *val, size_t val_len,
> +				  struct regmap_async *a)
> +{
> +	struct regmap_async_spi *async = (void *)a;

Can you use container_of() here?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
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