From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753276AbcHPIPi (ORCPT ); Tue, 16 Aug 2016 04:15:38 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33242 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbcHPIPe (ORCPT ); Tue, 16 Aug 2016 04:15:34 -0400 From: LABBE Corentin To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, LABBE Corentin Subject: [PATCH 1/2] mfd: mc13xxx: constify mc13xxx_variant Date: Tue, 16 Aug 2016 10:15:21 +0200 Message-Id: <1471335322-6814-1-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.7.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mc13xxx_variant structure is never modified, this patch set it as const. Signed-off-by: LABBE Corentin --- drivers/mfd/mc13xxx-core.c | 6 +++--- drivers/mfd/mc13xxx-i2c.c | 2 +- drivers/mfd/mc13xxx-spi.c | 2 +- drivers/mfd/mc13xxx.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c index d7f54e4..3a008e6 100644 --- a/drivers/mfd/mc13xxx-core.c +++ b/drivers/mfd/mc13xxx-core.c @@ -202,19 +202,19 @@ static void mc34708_print_revision(struct mc13xxx *mc13xxx, u32 revision) } /* These are only exported for mc13xxx-i2c and mc13xxx-spi */ -struct mc13xxx_variant mc13xxx_variant_mc13783 = { +const struct mc13xxx_variant mc13xxx_variant_mc13783 = { .name = "mc13783", .print_revision = mc13xxx_print_revision, }; EXPORT_SYMBOL_GPL(mc13xxx_variant_mc13783); -struct mc13xxx_variant mc13xxx_variant_mc13892 = { +const struct mc13xxx_variant mc13xxx_variant_mc13892 = { .name = "mc13892", .print_revision = mc13xxx_print_revision, }; EXPORT_SYMBOL_GPL(mc13xxx_variant_mc13892); -struct mc13xxx_variant mc13xxx_variant_mc34708 = { +const struct mc13xxx_variant mc13xxx_variant_mc34708 = { .name = "mc34708", .print_revision = mc34708_print_revision, }; diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c index 67e4c9a..3c00ccb 100644 --- a/drivers/mfd/mc13xxx-i2c.c +++ b/drivers/mfd/mc13xxx-i2c.c @@ -82,7 +82,7 @@ static int mc13xxx_i2c_probe(struct i2c_client *client, of_match_device(mc13xxx_dt_ids, &client->dev); mc13xxx->variant = of_id->data; } else { - mc13xxx->variant = (void *)id->driver_data; + mc13xxx->variant = (const struct mc13xxx_variant *)id->driver_data; } return mc13xxx_common_init(&client->dev); diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index cbc1e5e..6100025 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -162,7 +162,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi) } else { const struct spi_device_id *id_entry = spi_get_device_id(spi); - mc13xxx->variant = (void *)id_entry->driver_data; + mc13xxx->variant = (const struct mc13xxx_variant *)id_entry->driver_data; } return mc13xxx_common_init(&spi->dev); diff --git a/drivers/mfd/mc13xxx.h b/drivers/mfd/mc13xxx.h index 33677d1..6d7fce5 100644 --- a/drivers/mfd/mc13xxx.h +++ b/drivers/mfd/mc13xxx.h @@ -24,7 +24,7 @@ struct mc13xxx_variant { void (*print_revision)(struct mc13xxx *mc13xxx, u32 revision); }; -extern struct mc13xxx_variant +extern const struct mc13xxx_variant mc13xxx_variant_mc13783, mc13xxx_variant_mc13892, mc13xxx_variant_mc34708; -- 2.7.3