lkml.org 
[lkml]   [2009]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [spi-devel-general] [PATCH] drivers/misc: add driver for TexasInstruments DAC7512
Date
From
On Wednesday, October 07, 2009 1:01 PM, Daniel Mack wrote:
> This is actually too trivial to publish, but to export the function of
> that chip to the userspace, a module like this is needed.
>
> Signed-off-by: Daniel Mack <daniel@caiaq.de>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: spi-devel-general@lists.sourceforge.net
> ---

[snip]

> +static ssize_t dac7512_store_val(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct spi_device *spi = to_spi_device(dev);
> + unsigned char tmp[2];
> + unsigned long val;
> +
> + if (strict_strtoul(buf, 10, &val) < 0)
> + return -EINVAL;
> +
> + tmp[0] = val >> 8;
> + tmp[1] = val & 0xff;
> + spi_write(spi, tmp, sizeof(tmp));
> + return count;
> +}
> +
> +static DEVICE_ATTR(value, S_IWUSR | S_IRUGO,
> + NULL, dac7512_store_val);

You have declared the "value" device attribute with mode S_IWUSR | S_IRUGO
but have not provided a show callback.

Regards,
Hartley


\
 
 \ /
  Last update: 2009-10-12 18:39    [W:0.054 / U:26.648 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site