From: jic23@kernel.org
To: linux-iio@vger.kernel.org
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
Subject: [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev *.
Date: Thu, 21 May 2020 18:53:22 +0100 [thread overview]
Message-ID: <20200521175322.247947-1-jic23@kernel.org> (raw)
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
As this just calls dev_get_drvdata underneath which is happy with
a const struct device * we should change and avoid potentially
casting away a const in order to then put it back again.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
---
include/linux/iio/iio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index a1be82e74c93..e846a0a7001e 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -669,7 +669,7 @@ static inline void iio_device_set_drvdata(struct iio_dev *indio_dev, void *data)
*
* Returns the data previously set with iio_device_set_drvdata()
*/
-static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
+static inline void *iio_device_get_drvdata(const struct iio_dev *indio_dev)
{
return dev_get_drvdata(&indio_dev->dev);
}
--
2.26.2
next reply other threads:[~2020-05-21 17:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 17:53 jic23 [this message]
[not found] ` <SA0PR12MB44290C81C03F7DAEE315DBFBC48B0@SA0PR12MB4429.namprd12.prod.outlook.com>
2020-06-06 14:24 ` [PATCH] iio: make iio_device_get_drvdata take a const struct iio_dev * Jonathan Cameron
2020-06-08 9:43 ` Jean-Baptiste Maneyrol
2020-06-14 11:33 ` 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=20200521175322.247947-1-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=JManeyrol@invensense.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=linux-iio@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;
as well as URLs for NNTP newsgroup(s).