Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715741

[PATCH 4/4] rtc: rv3029c2: constify i2c_device_id

Path csiph.com!goblin3!goblin.stu.neva.ru!news.mb-net.net!open-news-network.org!aioe.org!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 4/4] rtc: rv3029c2: constify i2c_device_id
Date Sat, 19 Aug 2017 21:10:02 +0200
Message-ID <ughia-5br-9@gated-at.bofh.it> (permalink)
References <ughia-5br-5@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w52l2WajLtsCGYR5tyvrt8Rfuqux+xZEWhxycUlDIO0=; b=izQqrxRESRxbiYbtFdtowIVz1QhoJ5gntz3yEBqdR/e+H6mdlC1JsDeyfHuF4+LZl9 eCg+ZbkW6cKIItxoUVdGspLYWYux8kx0MU+MFhxTM01sEu65jKE66th+sRNMDoZ1kvBo Zs1r8Zemyza4/123qq7m0a4Wo9lDnSOvR5LNvN47F0QkuVRWNeywvmd7MEpkRvHpYtsp 2k57wTqP7ZgwXtrjZedcY9hJBt4WAYgNor4UP1J/kblgwarRQEMVG9/H6IMUfSYoL2AJ KG3tZt+8H0pRnf/JgOx44qaWMu9GDRxZOB5J2Kah3fAOALbhp0NtfWGAFDOx5xSHDj+8 mz+Q==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w52l2WajLtsCGYR5tyvrt8Rfuqux+xZEWhxycUlDIO0=; b=ZA49Tq5P+W2xkLE0CbRsiezaqyPtPry3Ov5fvvCsysTx+dgzTpLjaSQ4Dsn7sEyzsE lZqpt5ZVt9c5EeJxvIQ389O5s79Izv838Tw9BjfLd9rVsGbVbs8r2d5JNmoH7fn32Lw0 94GBMGUsibQRJOcVqr4Fpo0rhHN5OL3cRfWIIXeqJ15VRk+DSnz3rLkP26/M+gmqZNcR fo/Jhk5hK/eYZ3WRzXYlb+DPxMmMBDPGFi0a2SQbJHSKyrz2fqIEignst1e+73dLf02O KH/uArYAeUK5rcu5HTCBe4TEKt2WOr4XNMY/5vQb+141rnj8WrIjgpIZ7laJSF8DHbfy Dg1Q==
X-Gm-Message-State AHYfb5gei/D8CDRWHLaG3jMTF4M6e+rY8GYsS7YoVIuNFV6WuxVlPyAF PKT4WYltFqdXEQ==
X-Received by 10.99.106.65 with SMTP id f62mr11049468pgc.32.1503169697755; Sat, 19 Aug 2017 12:08:17 -0700 (PDT)
X-Mailer git-send-email 2.7.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 24
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org
X-Original-Date Sun, 20 Aug 2017 00:37:58 +0530
X-Original-Message-ID <1503169678-18078-5-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-References <1503169678-18078-1-git-send-email-arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1715741

Show key headers only | View raw


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-rv3029c2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c
index 85fa1da..aa09771 100644
--- a/drivers/rtc/rtc-rv3029c2.c
+++ b/drivers/rtc/rtc-rv3029c2.c
@@ -868,7 +868,7 @@ static int rv3029_i2c_probe(struct i2c_client *client,
 	return rv3029_probe(&client->dev, regmap, client->irq, client->name);
 }
 
-static struct i2c_device_id rv3029_id[] = {
+static const struct i2c_device_id rv3029_id[] = {
 	{ "rv3029", 0 },
 	{ "rv3029c2", 0 },
 	{ }
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] constify rtc i2c_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 21:10 +0200
  [PATCH 2/4] rtc: em3027: constify i2c_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 21:10 +0200
  [PATCH 4/4] rtc: rv3029c2: constify i2c_device_id Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-19 21:10 +0200
  Re: [PATCH 0/4] constify rtc i2c_device_id Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-08-24 11:10 +0200

csiph-web