From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com
Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org
Subject: [PATCH 2/4] rtc: em3027: constify i2c_device_id
Date: Sun, 20 Aug 2017 00:37:56 +0530 [thread overview]
Message-ID: <1503169678-18078-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1503169678-18078-1-git-send-email-arvind.yadav.cs@gmail.com>
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by <linux/i2c.h> work with
const i2c_device_id. So mark the non-const structs as const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/rtc/rtc-em3027.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-em3027.c b/drivers/rtc/rtc-em3027.c
index 4f4930a..b0ef8cf 100644
--- a/drivers/rtc/rtc-em3027.c
+++ b/drivers/rtc/rtc-em3027.c
@@ -132,7 +132,7 @@ static int em3027_probe(struct i2c_client *client,
return 0;
}
-static struct i2c_device_id em3027_id[] = {
+static const struct i2c_device_id em3027_id[] = {
{ "em3027", 0 },
{ }
};
--
2.7.4
next prev parent reply other threads:[~2017-08-19 19:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-19 19:07 [PATCH 0/4] constify rtc i2c_device_id Arvind Yadav
2017-08-19 19:07 ` [PATCH 1/4] rtc: ds1672: constify i2c_device_id Arvind Yadav
2017-08-19 19:07 ` Arvind Yadav [this message]
2017-08-19 19:07 ` [PATCH 3/4] rtc: max6900: " Arvind Yadav
2017-08-19 19:07 ` [PATCH 4/4] rtc: rv3029c2: " Arvind Yadav
2017-08-24 9:01 ` [PATCH 0/4] constify rtc i2c_device_id Alexandre Belloni
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=1503169678-18078-3-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@free-electrons.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@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