Skip to content

Commit

Permalink
mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
Browse files Browse the repository at this point in the history
The of_device_id match data is now marked as const and
must not be modified. This changes the dw_mmc to mark
all pointers passing the dw_mci_drv_data or dw_mci_dma_ops
structures as const, and also marks the static definitions
as const.

drivers/mmc/host/dw_mmc-exynos.c: In function 'dw_mci_exynos_probe':
drivers/mmc/host/dw_mmc-exynos.c:234:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Thomas Abraham <thomas.abraham@linaro.org>
Cc: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Arnd Bergmann authored and Chris Ball committed Nov 7, 2012
1 parent 517cb9f commit 8e2b36e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions drivers/mmc/host/dw_mmc-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static unsigned long exynos5250_dwmmc_caps[4] = {
MMC_CAP_CMD23,
};

static struct dw_mci_drv_data exynos5250_drv_data = {
static const struct dw_mci_drv_data exynos5250_drv_data = {
.caps = exynos5250_dwmmc_caps,
.init = dw_mci_exynos_priv_init,
.setup_clock = dw_mci_exynos_setup_clock,
Expand All @@ -220,14 +220,14 @@ static struct dw_mci_drv_data exynos5250_drv_data = {

static const struct of_device_id dw_mci_exynos_match[] = {
{ .compatible = "samsung,exynos5250-dw-mshc",
.data = (void *)&exynos5250_drv_data, },
.data = &exynos5250_drv_data, },
{},
};
MODULE_DEVICE_TABLE(of, dw_mci_exynos_match);

int dw_mci_exynos_probe(struct platform_device *pdev)
{
struct dw_mci_drv_data *drv_data;
const struct dw_mci_drv_data *drv_data;
const struct of_device_id *match;

match = of_match_node(dw_mci_exynos_match, pdev->dev.of_node);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/host/dw_mmc-pltfm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "dw_mmc.h"

int dw_mci_pltfm_register(struct platform_device *pdev,
struct dw_mci_drv_data *drv_data)
const struct dw_mci_drv_data *drv_data)
{
struct dw_mci *host;
struct resource *regs;
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/host/dw_mmc-pltfm.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define _DW_MMC_PLTFM_H_

extern int dw_mci_pltfm_register(struct platform_device *pdev,
struct dw_mci_drv_data *drv_data);
const struct dw_mci_drv_data *drv_data);
extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev);
extern const struct dev_pm_ops dw_mci_pltfm_pmops;

Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)
return 0;
}

static struct dw_mci_dma_ops dw_mci_idmac_ops = {
static const struct dw_mci_dma_ops dw_mci_idmac_ops = {
.init = dw_mci_idmac_init,
.start = dw_mci_idmac_start_dma,
.stop = dw_mci_idmac_stop_dma,
Expand Down
4 changes: 2 additions & 2 deletions include/linux/mmc/dw_mmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ struct dw_mci {

dma_addr_t sg_dma;
void *sg_cpu;
struct dw_mci_dma_ops *dma_ops;
const struct dw_mci_dma_ops *dma_ops;
#ifdef CONFIG_MMC_DW_IDMAC
unsigned int ring_size;
#else
Expand All @@ -162,7 +162,7 @@ struct dw_mci {
u16 data_offset;
struct device *dev;
struct dw_mci_board *pdata;
struct dw_mci_drv_data *drv_data;
const struct dw_mci_drv_data *drv_data;
void *priv;
struct clk *biu_clk;
struct clk *ciu_clk;
Expand Down

0 comments on commit 8e2b36e

Please sign in to comment.