linux-mips
[Top] [All Lists]

[PATCH 01/11 v2] MIPS: Alchemy: constify gpio_led

To: nsekhar@ti.com, khilman@kernel.org, linux@armlinux.org.uk, kaloz@openwrt.org, khalasa@piap.pl, aaro.koskinen@iki.fi, tony@atomide.com, jason@lakedaemon.net, andrew@lunn.ch, sebastian.hesselbarth@gmail.com, gregory.clement@free-electrons.com, daniel@zonque.org, haojian.zhuang@gmail.com, marek.vasut@gmail.com, slapin@ossfans.org, jic23@cam.ac.uk, kgene@kernel.org, krzk@kernel.org, ralf@linux-mips.org, ysato@users.sourceforge.jp, dalias@libc.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, linux-mips@linux-mips.org
Subject: [PATCH 01/11 v2] MIPS: Alchemy: constify gpio_led
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
Date: Tue, 26 Dec 2017 12:03:08 +0530
Cc: linux-kernel@vger.kernel.org
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=P39i4IZrOIWsCeSTY6owOcZRuwJ5VV1s4kcL9xZstOU=; b=l/bFr4i4xF7PCcWw01cy598nYV2jecbPWukbazJVmAlNPVQIlE7x0fyZeu6bsHB4PW DDp7XX1SiZ/bIv6ix8EppLFSpNANG63IM0HUT4kP2Xf9BU3Yct09G2ku6/3ZsAVStj0t 21BMVL4N4N9cXLEB/xIgDd8Wt/JFPL1yQO7xrU5bvS6PkhlklreX1gMz7HaTP3eA5/gG 7gnAJWgrs4vq/yVsurfHV+PPkeKzAHtiPjjbecyT/IJGxCTsz7aBE/ZwW8JflIgf3up8 IIQ8SPT6NFE1BDSlp8a0WGA1LwHRgLeai6NaFspNGKS3EUQv2NXvbI1cdReZ1Tg79a3p mUmQ==
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
gpio_led are not supposed to change at runtime.
struct gpio_led_platform_data working with const gpio_led
provided by <linux/leds.h>. So mark the non-const structs
as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
changes in v2:
              The GPIO LED driver can be built as a module, it can
              be loaded after the init sections have gone away.
              So removed '__initconst'.

 arch/mips/alchemy/board-gpr.c  | 2 +-
 arch/mips/alchemy/board-mtx1.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/alchemy/board-gpr.c b/arch/mips/alchemy/board-gpr.c
index 328d697..4e79dbd 100644
--- a/arch/mips/alchemy/board-gpr.c
+++ b/arch/mips/alchemy/board-gpr.c
@@ -190,7 +190,7 @@ static struct platform_device gpr_mtd_device = {
 /*
  * LEDs
  */
-static struct gpio_led gpr_gpio_leds[] = {
+static const struct gpio_led gpr_gpio_leds[] = {
        {       /* green */
                .name                   = "gpr:green",
                .gpio                   = 4,
diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c
index 85bb756..aab55aa 100644
--- a/arch/mips/alchemy/board-mtx1.c
+++ b/arch/mips/alchemy/board-mtx1.c
@@ -145,7 +145,7 @@ static struct platform_device mtx1_wdt = {
        .resource = mtx1_wdt_res,
 };
 
-static struct gpio_led default_leds[] = {
+static const struct gpio_led default_leds[] = {
        {
                .name   = "mtx1:green",
                .gpio = 211,
-- 
2.7.4


<Prev in Thread] Current Thread [Next in Thread>