Skip to content

Commit

Permalink
mfd: lp8788: Constify static struct resource
Browse files Browse the repository at this point in the history
Constify a couple of static struct resource. The only usage of the
structs is to assign their address to the resources field in the
mfd_cell struct. This allows the compiler to put them in read-only
memory. Done with the help of Coccinelle.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Rikard Falkeborn authored and Lee Jones committed Nov 19, 2020
1 parent f977284 commit 5a1acf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mfd/lp8788.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
.num_resources = num_resource, \
}

static struct resource chg_irqs[] = {
static const struct resource chg_irqs[] = {
/* Charger Interrupts */
{
.start = LP8788_INT_CHG_INPUT_STATE,
Expand All @@ -58,7 +58,7 @@ static struct resource chg_irqs[] = {
},
};

static struct resource rtc_irqs[] = {
static const struct resource rtc_irqs[] = {
{
.start = LP8788_INT_RTC_ALARM1,
.end = LP8788_INT_RTC_ALARM2,
Expand Down

0 comments on commit 5a1acf2

Please sign in to comment.