From: arvind.yadav.cs@gmail.com (Arvind Yadav)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: constify gpio and pins.
Date: Sun, 9 Jul 2017 14:39:49 +0530 [thread overview]
Message-ID: <5db99a15fd0c11011e5514ebac7b8caed661ffb0.1499591373.git.arvind.yadav.cs@gmail.com> (raw)
gpios and pins are not supposed to change at runtime. All functions
working with gpios provided by <linux/gpio.h> work with const gpio.
Pins is working with 'mxc_iomux_setup_multiple_pins(
const unsigned int *pin_list, ...)'. So mark the non-const structs as
const.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
arch/arm/mach-imx/mach-mx31_3ds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c
index 68c3f07..c7edba3 100644
--- a/arch/arm/mach-imx/mach-mx31_3ds.c
+++ b/arch/arm/mach-imx/mach-mx31_3ds.c
@@ -41,7 +41,7 @@
#include "iomux-mx3.h"
#include "ulpi.h"
-static int mx31_3ds_pins[] = {
+static const int mx31_3ds_pins[] = {
/* UART1 */
MX31_PIN_CTS1__CTS1,
MX31_PIN_RTS1__RTS1,
@@ -180,7 +180,7 @@ static struct l4f00242t03_pdata mx31_3ds_l4f00242t03_pdata = {
#define MX31_3DS_GPIO_SDHC1_CD IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)
#define MX31_3DS_GPIO_SDHC1_BE IOMUX_TO_GPIO(MX31_PIN_GPIO3_0)
-static struct gpio mx31_3ds_sdhc1_gpios[] = {
+static const struct gpio mx31_3ds_sdhc1_gpios[] = {
{ MX31_3DS_GPIO_SDHC1_CD, GPIOF_IN, "sdhc1-card-detect" },
{ MX31_3DS_GPIO_SDHC1_BE, GPIOF_OUT_INIT_LOW, "sdhc1-bus-en" },
};
--
2.7.4
reply other threads:[~2017-07-09 9:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5db99a15fd0c11011e5514ebac7b8caed661ffb0.1499591373.git.arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).