public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: sonic zhang <sonic.adi@gmail.com>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: [PATCH] IIO: struct iio_dev_attr should be defined as static.
Date: Fri, 2 Apr 2010 10:55:48 +0800	[thread overview]
Message-ID: <1270176948.3847.1.camel@eight.analog.com> (raw)


Otherwise link errors "multiple definition of `iio_dev_attr_mode'"
are reported when compile multiple different iio drivers with the
same attribute name.

Signed-off-by: Sonic Zhang <sonic.adi@gmail.com>
---
 drivers/staging/iio/sysfs.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/sysfs.h b/drivers/staging/iio/sysfs.h
index e501e13..39d207e 100644
--- a/drivers/staging/iio/sysfs.h
+++ b/drivers/staging/iio/sysfs.h
@@ -95,16 +95,16 @@ struct iio_const_attr {
 			.val2 = _val2 }
 
 #define IIO_DEVICE_ATTR(_name, _mode, _show, _store, _addr)	\
-	struct iio_dev_attr iio_dev_attr_##_name		\
+	static struct iio_dev_attr iio_dev_attr_##_name		\
 	= IIO_ATTR(_name, _mode, _show, _store, _addr)
 
 
 #define IIO_DEVICE_ATTR_2(_name, _mode, _show, _store, _addr, _val2)	\
-	struct iio_dev_attr iio_dev_attr_##_name			\
+	static struct iio_dev_attr iio_dev_attr_##_name			\
 	= IIO_ATTR_2(_name, _mode, _show, _store, _addr, _val2)
 
 #define IIO_CONST_ATTR(_name, _string)					\
-	struct iio_const_attr iio_const_attr_##_name			\
+	static struct iio_const_attr iio_const_attr_##_name			\
 	= { .string = _string,						\
 	    .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
 
-- 
1.6.0




             reply	other threads:[~2010-04-02  2:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  2:55 sonic zhang [this message]
2010-04-06  3:21 ` [PATCH] IIO: struct iio_dev_attr should be defined as static Sonic Zhang
2010-04-06 11:30 ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270176948.3847.1.camel@eight.analog.com \
    --to=sonic.adi@gmail.com \
    --cc=jic23@cam.ac.uk \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox