From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out-188.synserver.de ([212.40.185.188]:1044 "EHLO smtp-out-188.synserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932430AbbJNPND (ORCPT ); Wed, 14 Oct 2015 11:13:03 -0400 Message-ID: <561E70FC.4010206@metafoo.de> Date: Wed, 14 Oct 2015 17:13:00 +0200 From: Lars-Peter Clausen MIME-Version: 1.0 To: Daniel Baluta CC: Jonathan Cameron , Hartmut Knaack , Peter Meerwald , Octavian Purdila , "linux-iio@vger.kernel.org" Subject: Re: [PATCH v2 3/6] iio: Add support for indicating fixed watermarks References: <1444752327-2629-1-git-send-email-lars@metafoo.de> <1444752327-2629-4-git-send-email-lars@metafoo.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 10/14/2015 04:04 PM, Daniel Baluta wrote: > On Tue, Oct 13, 2015 at 7:05 PM, Lars-Peter Clausen wrote: >> For buffers which have a fixed wake-up watermark the watermark attribute >> should be read-only. Add a new FIXED_WATERMARK flag to the >> struct iio_buffer_access_funcs, which can be set by a buffer >> implementation. >> >> Signed-off-by: Lars-Peter Clausen >> --- >> drivers/iio/industrialio-buffer.c | 5 +++++ >> include/linux/iio/buffer.h | 8 ++++++++ >> 2 files changed, 13 insertions(+) >> >> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c >> index 5f2c8c8..98a6447 100644 >> --- a/drivers/iio/industrialio-buffer.c >> +++ b/drivers/iio/industrialio-buffer.c >> @@ -998,6 +998,8 @@ static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, >> iio_buffer_show_enable, iio_buffer_store_enable); >> static DEVICE_ATTR(watermark, S_IRUGO | S_IWUSR, >> iio_buffer_show_watermark, iio_buffer_store_watermark); >> +static struct device_attribute dev_attr_watermark_ro = __ATTR(watermark, >> + S_IRUGO, iio_buffer_show_watermark, NULL); > > I think we can use DEVICE_ATTR_RO here. The problem is that this will generate a variable with the name dev_attr_watermark, which we already have for the rw version. So there would be a name conflict. Thanks for the review, - Lars