mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen-Yu Tsai <wens@csie.org>
To: Lee Jones <lee.jones@linaro.org>
Cc: Chen-Yu Tsai <wens@csie.org>, Hans de Goede <hdegoede@redhat.com>,
	linux-kernel@vger.kernel.org,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] mfd: axp20x: Const-ify struct mfd_cell and struct resource
Date: Thu, 29 Mar 2018 12:31:13 +0800	[thread overview]
Message-ID: <20180329043115.7132-2-wens@csie.org> (raw)
In-Reply-To: <20180329043115.7132-1-wens@csie.org>

The axp20x driver has lots of mfd_cell and resource structs.
These can all be const-ified.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/mfd/axp20x.c       | 44 ++++++++++++++++++++++----------------------
 include/linux/mfd/axp20x.h |  2 +-
 2 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c
index aaf2acbef701..14be0f658d74 100644
--- a/drivers/mfd/axp20x.c
+++ b/drivers/mfd/axp20x.c
@@ -169,18 +169,18 @@ static const struct regmap_access_table axp806_volatile_table = {
 	.n_yes_ranges	= ARRAY_SIZE(axp806_volatile_ranges),
 };
 
-static struct resource axp152_pek_resources[] = {
+static const struct resource axp152_pek_resources[] = {
 	DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_RIS_EDGE, "PEK_DBR"),
 	DEFINE_RES_IRQ_NAMED(AXP152_IRQ_PEK_FAL_EDGE, "PEK_DBF"),
 };
 
-static struct resource axp20x_ac_power_supply_resources[] = {
+static const struct resource axp20x_ac_power_supply_resources[] = {
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_PLUGIN, "ACIN_PLUGIN"),
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_REMOVAL, "ACIN_REMOVAL"),
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_ACIN_OVER_V, "ACIN_OVER_V"),
 };
 
-static struct resource axp20x_pek_resources[] = {
+static const struct resource axp20x_pek_resources[] = {
 	{
 		.name	= "PEK_DBR",
 		.start	= AXP20X_IRQ_PEK_RIS_EDGE,
@@ -194,19 +194,19 @@ static struct resource axp20x_pek_resources[] = {
 	},
 };
 
-static struct resource axp20x_usb_power_supply_resources[] = {
+static const struct resource axp20x_usb_power_supply_resources[] = {
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"),
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"),
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_VALID, "VBUS_VALID"),
 	DEFINE_RES_IRQ_NAMED(AXP20X_IRQ_VBUS_NOT_VALID, "VBUS_NOT_VALID"),
 };
 
-static struct resource axp22x_usb_power_supply_resources[] = {
+static const struct resource axp22x_usb_power_supply_resources[] = {
 	DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_PLUGIN, "VBUS_PLUGIN"),
 	DEFINE_RES_IRQ_NAMED(AXP22X_IRQ_VBUS_REMOVAL, "VBUS_REMOVAL"),
 };
 
-static struct resource axp22x_pek_resources[] = {
+static const struct resource axp22x_pek_resources[] = {
 	{
 		.name   = "PEK_DBR",
 		.start  = AXP22X_IRQ_PEK_RIS_EDGE,
@@ -220,7 +220,7 @@ static struct resource axp22x_pek_resources[] = {
 	},
 };
 
-static struct resource axp288_power_button_resources[] = {
+static const struct resource axp288_power_button_resources[] = {
 	{
 		.name	= "PEK_DBR",
 		.start	= AXP288_IRQ_POKP,
@@ -235,7 +235,7 @@ static struct resource axp288_power_button_resources[] = {
 	},
 };
 
-static struct resource axp288_fuel_gauge_resources[] = {
+static const struct resource axp288_fuel_gauge_resources[] = {
 	{
 		.start = AXP288_IRQ_QWBTU,
 		.end   = AXP288_IRQ_QWBTU,
@@ -268,7 +268,7 @@ static struct resource axp288_fuel_gauge_resources[] = {
 	},
 };
 
-static struct resource axp803_pek_resources[] = {
+static const struct resource axp803_pek_resources[] = {
 	{
 		.name   = "PEK_DBR",
 		.start  = AXP803_IRQ_PEK_RIS_EDGE,
@@ -282,7 +282,7 @@ static struct resource axp803_pek_resources[] = {
 	},
 };
 
-static struct resource axp809_pek_resources[] = {
+static const struct resource axp809_pek_resources[] = {
 	{
 		.name   = "PEK_DBR",
 		.start  = AXP809_IRQ_PEK_RIS_EDGE,
@@ -648,7 +648,7 @@ static const struct regmap_irq_chip axp809_regmap_irq_chip = {
 	.num_regs		= 5,
 };
 
-static struct mfd_cell axp20x_cells[] = {
+static const struct mfd_cell axp20x_cells[] = {
 	{
 		.name		= "axp20x-gpio",
 		.of_compatible	= "x-powers,axp209-gpio",
@@ -677,7 +677,7 @@ static struct mfd_cell axp20x_cells[] = {
 	},
 };
 
-static struct mfd_cell axp221_cells[] = {
+static const struct mfd_cell axp221_cells[] = {
 	{
 		.name		= "axp221-pek",
 		.num_resources	= ARRAY_SIZE(axp22x_pek_resources),
@@ -703,7 +703,7 @@ static struct mfd_cell axp221_cells[] = {
 	},
 };
 
-static struct mfd_cell axp223_cells[] = {
+static const struct mfd_cell axp223_cells[] = {
 	{
 		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp22x_pek_resources),
@@ -729,7 +729,7 @@ static struct mfd_cell axp223_cells[] = {
 	},
 };
 
-static struct mfd_cell axp152_cells[] = {
+static const struct mfd_cell axp152_cells[] = {
 	{
 		.name			= "axp20x-pek",
 		.num_resources		= ARRAY_SIZE(axp152_pek_resources),
@@ -737,7 +737,7 @@ static struct mfd_cell axp152_cells[] = {
 	},
 };
 
-static struct resource axp288_adc_resources[] = {
+static const struct resource axp288_adc_resources[] = {
 	{
 		.name  = "GPADC",
 		.start = AXP288_IRQ_GPADC,
@@ -746,7 +746,7 @@ static struct resource axp288_adc_resources[] = {
 	},
 };
 
-static struct resource axp288_extcon_resources[] = {
+static const struct resource axp288_extcon_resources[] = {
 	{
 		.start = AXP288_IRQ_VBUS_FALL,
 		.end   = AXP288_IRQ_VBUS_FALL,
@@ -769,7 +769,7 @@ static struct resource axp288_extcon_resources[] = {
 	},
 };
 
-static struct resource axp288_charger_resources[] = {
+static const struct resource axp288_charger_resources[] = {
 	{
 		.start = AXP288_IRQ_OV,
 		.end   = AXP288_IRQ_OV,
@@ -817,7 +817,7 @@ static struct resource axp288_charger_resources[] = {
 	},
 };
 
-static struct mfd_cell axp288_cells[] = {
+static const struct mfd_cell axp288_cells[] = {
 	{
 		.name = "axp288_adc",
 		.num_resources = ARRAY_SIZE(axp288_adc_resources),
@@ -848,7 +848,7 @@ static struct mfd_cell axp288_cells[] = {
 	},
 };
 
-static struct mfd_cell axp803_cells[] = {
+static const struct mfd_cell axp803_cells[] = {
 	{
 		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
@@ -857,14 +857,14 @@ static struct mfd_cell axp803_cells[] = {
 	{	.name			= "axp20x-regulator" },
 };
 
-static struct mfd_cell axp806_cells[] = {
+static const struct mfd_cell axp806_cells[] = {
 	{
 		.id			= 2,
 		.name			= "axp20x-regulator",
 	},
 };
 
-static struct mfd_cell axp809_cells[] = {
+static const struct mfd_cell axp809_cells[] = {
 	{
 		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp809_pek_resources),
@@ -875,7 +875,7 @@ static struct mfd_cell axp809_cells[] = {
 	},
 };
 
-static struct mfd_cell axp813_cells[] = {
+static const struct mfd_cell axp813_cells[] = {
 	{
 		.name			= "axp221-pek",
 		.num_resources		= ARRAY_SIZE(axp803_pek_resources),
diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h
index 82bf7747b312..a2489363a998 100644
--- a/include/linux/mfd/axp20x.h
+++ b/include/linux/mfd/axp20x.h
@@ -642,7 +642,7 @@ struct axp20x_dev {
 	struct regmap_irq_chip_data	*regmap_irqc;
 	long				variant;
 	int                             nr_cells;
-	struct mfd_cell                 *cells;
+	const struct mfd_cell           *cells;
 	const struct regmap_config	*regmap_cfg;
 	const struct regmap_irq_chip	*regmap_irq_chip;
 };
-- 
2.16.3

  reply	other threads:[~2018-03-29  4:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29  4:31 [PATCH 0/3] mfd: axp20x: driver cleanup Chen-Yu Tsai
2018-03-29  4:31 ` Chen-Yu Tsai [this message]
2018-04-16  9:36   ` [PATCH 1/3] mfd: axp20x: Const-ify struct mfd_cell and struct resource Lee Jones
2018-03-29  4:31 ` [PATCH 2/3] mfd: axp20x: Use DEFINE_RES_IRQ to declare resources for mfd_cells Chen-Yu Tsai
2018-04-16  9:36   ` Lee Jones
2018-03-29  4:31 ` [PATCH 3/3] mfd: axp20x: Correct AXP806 POK interrupt prefix Chen-Yu Tsai
2018-04-16  9:36   ` Lee Jones

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=20180329043115.7132-2-wens@csie.org \
    --to=wens@csie.org \
    --cc=hdegoede@redhat.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@bootlin.com \
    /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

all inboxes | Powered by JetHome®