From 80023cb354725cd3319d81a8d7e6f88ad0253cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:49:35 +0200 Subject: spi/imx: make spi_imx_data.devtype_data member point to const data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/spi/spi-imx.c: In function spi_imx_probe: drivers/spi/spi-imx.c:814:24: warning: assignment discards const qualifier from pointer target type [enabled by default] Signed-off-by: Uwe Kleine-König diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index e834ff8..3bd9c69 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -97,7 +97,7 @@ struct spi_imx_data { const void *tx_buf; unsigned int txfifo; /* number of words pushed in tx FIFO */ - struct spi_imx_devtype_data *devtype_data; + const struct spi_imx_devtype_data *devtype_data; int chipselect[0]; }; -- cgit v0.10.2 From 83a01e729141bfad5e249b4a737105c525f53786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: spi/spi-omap2-mcspi: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/spi/spi-omap2-mcspi.c: In function 'omap2_mcspi_probe': drivers/spi/spi-omap2-mcspi.c:1118: warning: assignment discards qualifiers from pointer target type Signed-off-by: Uwe Kleine-König diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index bc47781..d80f81b 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -1116,7 +1116,7 @@ MODULE_DEVICE_TABLE(of, omap_mcspi_of_match); static int __devinit omap2_mcspi_probe(struct platform_device *pdev) { struct spi_master *master; - struct omap2_mcspi_platform_config *pdata; + const struct omap2_mcspi_platform_config *pdata; struct omap2_mcspi *mcspi; struct resource *r; int status = 0, i; -- cgit v0.10.2 From e83d17ea564b45f383f01b2d9e38b3cded7ae680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: serial/imx: make imx_port.devdata member point to const data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/tty/serial/imx.c: In function 'serial_imx_probe_dt': drivers/tty/serial/imx.c:1430:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Greg Kroah-Hartman Signed-off-by: Uwe Kleine-König diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index d5c689d6..20e9117 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -206,7 +206,7 @@ struct imx_port { unsigned short trcv_delay; /* transceiver delay */ struct clk *clk_ipg; struct clk *clk_per; - struct imx_uart_data *devdata; + const struct imx_uart_data *devdata; }; struct imx_port_ucrs { -- cgit v0.10.2 From 76d28e441ee967f49ec36f34664d54118c438ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: serial/mpc52xx_uart: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/tty/serial/mpc52xx_uart.c: In function 'mpc52xx_uart_of_enumerate': drivers/tty/serial/mpc52xx_uart.c:1440:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Greg Kroah-Hartman Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c index bedac0d..b131f2d 100644 --- a/drivers/tty/serial/mpc52xx_uart.c +++ b/drivers/tty/serial/mpc52xx_uart.c @@ -598,7 +598,7 @@ static struct psc_ops mpc512x_psc_ops = { }; #endif -static struct psc_ops *psc_ops; +static const struct psc_ops *psc_ops; /* ======================================================================== */ /* UART operations */ -- cgit v0.10.2 From e5b5d0209f0d01cdb11ab7f7af4ab9f48d0b3031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:54:06 +0200 Subject: ARM: cache-l2x0: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: arch/arm/mm/cache-l2x0.c: In function 'l2x0_of_init': arch/arm/mm/cache-l2x0.c:573:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] though. Signed-off-by: Uwe Kleine-König diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 2a8e380..577baf7 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -554,7 +554,7 @@ static const struct of_device_id l2x0_ids[] __initconst = { int __init l2x0_of_init(u32 aux_val, u32 aux_mask) { struct device_node *np; - struct l2x0_of_data *data; + const struct l2x0_of_data *data; struct resource res; np = of_find_matching_node(NULL, l2x0_ids); -- cgit v0.10.2 From c1411bfae63286fbe6e63a1ec558eb4eb812859c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: misc/atmel_tc: make atmel_tc.tcb_config member point to const data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/misc/atmel_tclib.c: In function 'tc_probe': drivers/misc/atmel_tclib.c:170: warning: assignment discards qualifiers from pointer target type Signed-off-by: Uwe Kleine-König Acked-by: Nicolas Ferre diff --git a/include/linux/atmel_tc.h b/include/linux/atmel_tc.h index 1d14b1dc..89a931b 100644 --- a/include/linux/atmel_tc.h +++ b/include/linux/atmel_tc.h @@ -63,7 +63,7 @@ struct atmel_tc { struct platform_device *pdev; struct resource *iomem; void __iomem *regs; - struct atmel_tcb_config *tcb_config; + const struct atmel_tcb_config *tcb_config; int irq[3]; struct clk *clk[3]; struct list_head node; -- cgit v0.10.2 From f6817a2c2ebaaaed95b96cd0f04559ba555f4096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: gpio/gpio-omap.c: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/gpio/gpio-omap.c: In function 'omap_gpio_probe': drivers/gpio/gpio-omap.c:1060: warning: assignment discards qualifiers from pointer target type Acked-by: Linus Walleij Signed-off-by: Uwe Kleine-König diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index e6efd77..cc0b46d 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1058,7 +1058,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct device_node *node = dev->of_node; const struct of_device_id *match; - struct omap_gpio_platform_data *pdata; + const struct omap_gpio_platform_data *pdata; struct resource *res; struct gpio_bank *bank; int ret = 0; -- cgit v0.10.2 From 01a04ddc86f904eff65e1668cf6524a58203fe2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: gpio/mpc8xxx: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/gpio/gpio-mpc8xxx.c: In function 'mpc8xxx_add_controller': drivers/gpio/gpio-mpc8xxx.c:360:30: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Linus Walleij Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 5a1817e..9ae29cc 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c @@ -38,7 +38,7 @@ struct mpc8xxx_gpio_chip { */ u32 data; struct irq_domain *irq; - void *of_dev_id_data; + const void *of_dev_id_data; }; static inline u32 mpc8xxx_gpio2mask(unsigned int gpio) -- cgit v0.10.2 From c4dba0119bdab0af8fc11fab23301e015e198b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: i2c/i2c-omap: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/i2c/busses/i2c-omap.c: In function 'omap_i2c_probe': drivers/i2c/busses/i2c-omap.c:1025: warning: assignment discards qualifiers from pointer target type Reviewed-by: Shubhrajyoti D Signed-off-by: Uwe Kleine-König diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 6849635..3d2a33a 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -944,7 +944,8 @@ omap_i2c_probe(struct platform_device *pdev) struct omap_i2c_dev *dev; struct i2c_adapter *adap; struct resource *mem, *irq, *ioarea; - struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data; + const struct omap_i2c_bus_platform_data *pdata = + pdev->dev.platform_data; struct device_node *node = pdev->dev.of_node; const struct of_device_id *match; irq_handler_t isr; -- cgit v0.10.2 From 215e691c2ac9104dd6dfbdd291366ad4c202b7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: i2c/mpc: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/i2c/busses/i2c-mpc.c: In function 'fsl_i2c_probe': drivers/i2c/busses/i2c-mpc.c:650:31: warning: initialization discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index b76731e..775062c 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -647,7 +647,7 @@ static int __devinit fsl_i2c_probe(struct platform_device *op) } if (match->data) { - struct mpc_i2c_data *data = match->data; + const struct mpc_i2c_data *data = match->data; data->setup(op->dev.of_node, i2c, clock, data->prescaler); } else { /* Backwards compatibility */ -- cgit v0.10.2 From efc9b736c4477df7ff3ce403bca66846d21458d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: mmc/omap_hsmmc: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/mmc/host/omap_hsmmc.c: In function 'omap_hsmmc_probe': drivers/mmc/host/omap_hsmmc.c:1808: warning: initialization discards qualifiers from pointer target type Acked-by: Venkatraman S Signed-off-by: Uwe Kleine-König diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3a09f93..e975d3e 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1782,7 +1782,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev) if (match) { pdata = of_get_hsmmc_pdata(&pdev->dev); if (match->data) { - u16 *offsetp = match->data; + const u16 *offsetp = match->data; pdata->reg_offset = *offsetp; } } -- cgit v0.10.2 From 519a6510981a98c199828df24d5d3619f6394985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: macintosh/mediabay: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/macintosh/mediabay.c: In function 'media_bay_attach': drivers/macintosh/mediabay.c:589:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 831d751..54bf584 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -63,7 +63,7 @@ struct media_bay_info { int value_count; int timer; struct macio_dev *mdev; - struct mb_ops* ops; + const struct mb_ops* ops; int index; int cached_gpio; int sleeping; -- cgit v0.10.2 From bfef61d03eba45984207208222b5a3506258e537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: powerpc/83xx: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: arch/powerpc/platforms/83xx/suspend.c: In function 'pmc_probe': arch/powerpc/platforms/83xx/suspend.c:336:7: error: assignment discards 'const' qualifier from pointer target type [-Werror] Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c index 1a04671..1d769a2 100644 --- a/arch/powerpc/platforms/83xx/suspend.c +++ b/arch/powerpc/platforms/83xx/suspend.c @@ -326,7 +326,7 @@ static int pmc_probe(struct platform_device *ofdev) const struct of_device_id *match; struct device_node *np = ofdev->dev.of_node; struct resource res; - struct pmc_type *type; + const struct pmc_type *type; int ret = 0; match = of_match_device(pmc_match, &ofdev->dev); -- cgit v0.10.2 From f318f1d75b9bdc067171f84f55d7384019884876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: powerpc/fsl_msi: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: arch/powerpc/sysdev/fsl_msi.c: In function 'fsl_of_msi_probe': arch/powerpc/sysdev/fsl_msi.c:379:11: error: assignment discards 'const' qualifier from pointer target type [-Werror] Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 6e097de..a40acd6 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -368,7 +368,7 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev) int err, i, j, irq_index, count; int rc; const u32 *p; - struct fsl_msi_feature *features; + const struct fsl_msi_feature *features; int len; u32 offset; static const u32 all_avail[] = { 0, NR_MSI_IRQS }; -- cgit v0.10.2 From 12736b14afb4a6c456ada1f095ca7f22b3c349ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 21 May 2012 21:57:39 +0200 Subject: powerpc/celleb_pci: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: arch/powerpc/platforms/cell/celleb_pci.c: In function 'celleb_setup_phb': arch/powerpc/platforms/cell/celleb_pci.c:485:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c index 5822141..abc8af4 100644 --- a/arch/powerpc/platforms/cell/celleb_pci.c +++ b/arch/powerpc/platforms/cell/celleb_pci.c @@ -472,7 +472,7 @@ int __init celleb_setup_phb(struct pci_controller *phb) { struct device_node *dev = phb->dn; const struct of_device_id *match; - struct celleb_phb_spec *phb_spec; + const struct celleb_phb_spec *phb_spec; int rc; match = of_match_node(celleb_phb_match, dev); -- cgit v0.10.2 From 639397e48684b75c3476138ab1bfa5a67d6c2048 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 21 May 2012 21:57:39 +0200 Subject: watchdog/mpc8xxx: add a const qualifier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/watchdog/mpc8xxx_wdt.c: In function 'mpc8xxx_wdt_probe': drivers/watchdog/mpc8xxx_wdt.c:203:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] Signed-off-by: Arnd Bergmann [ukl: split Arnd's patch by driver and add changelog] Acked-by: Wim Van Sebroeck Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index 40f7bf1..e6a038a 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c @@ -193,7 +193,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) int ret; const struct of_device_id *match; struct device_node *np = ofdev->dev.of_node; - struct mpc8xxx_wdt_type *wdt_type; + const struct mpc8xxx_wdt_type *wdt_type; u32 freq = fsl_get_sys_freq(); bool enabled; -- cgit v0.10.2 From 83a1ef2eb68cffda5940568b8c3f48daa5ab9d0c Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 29 Aug 2012 10:23:07 +0200 Subject: dma: tegra: make tegra_dma.chip_data a pointer to const data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares *of_device_id.data becoming const. Without this change the following warning would occur: drivers/dma/tegra20-apb-dma.c: In function 'tegra_dma_probe': drivers/dma/tegra20-apb-dma.c:1210:9: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] [ukl: split Laxman's patch to prevent warnings in the middle of the series. Original patch was sent with msgid 1346217447-19730-1-git-send-email-ldewangan@nvidia.com] Signed-off-by: Laxman Dewangan Acked-by: Stephen Warren Acked-by: Vinod Koul Signed-off-by: Uwe Kleine-König diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index d52dbc6..29a39b8 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -201,7 +201,7 @@ struct tegra_dma { struct clk *dma_clk; spinlock_t global_lock; void __iomem *base_addr; - struct tegra_dma_chip_data *chip_data; + const struct tegra_dma_chip_data *chip_data; /* Some register need to be cache before suspend */ u32 reg_gen; @@ -1197,7 +1197,7 @@ static int __devinit tegra_dma_probe(struct platform_device *pdev) struct tegra_dma *tdma; int ret; int i; - struct tegra_dma_chip_data *cdata = NULL; + const struct tegra_dma_chip_data *cdata = NULL; if (pdev->dev.of_node) { const struct of_device_id *match; -- cgit v0.10.2 From d7c9a53f13cf4b273b220934167c7630c3362563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 7 Jun 2012 12:20:14 +0200 Subject: of: add const to struct *of_device_id.data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drivers should never need to modify the data of a device id. So it can be const which in turn allows more consts in the driver. Acked-by: Greg Kroah-Hartman Signed-off-by: Uwe Kleine-König diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 6955045..78874b3 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -232,7 +232,7 @@ struct of_device_id char type[32]; char compatible[128]; #ifdef __KERNEL__ - void *data; + const void *data; #else kernel_ulong_t data; #endif -- cgit v0.10.2 From c06e6769a89ae6fe7a2eb429224fa30cacdccdb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 6 Jul 2012 22:20:15 +0200 Subject: gpio/gpio-omap: make platformdata used as *of_device_id.data const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since of_device_id.data is declared as a pointer to const data a few more consts can be added in this driver. Acked-by: Linus Walleij Acked-by: Santosh Shilimkar Signed-off-by: Uwe Kleine-König diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index cc0b46d..0725d18 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1440,19 +1440,19 @@ static struct omap_gpio_reg_offs omap4_gpio_regs = { .fallingdetect = OMAP4_GPIO_FALLINGDETECT, }; -static struct omap_gpio_platform_data omap2_pdata = { +const static struct omap_gpio_platform_data omap2_pdata = { .regs = &omap2_gpio_regs, .bank_width = 32, .dbck_flag = false, }; -static struct omap_gpio_platform_data omap3_pdata = { +const static struct omap_gpio_platform_data omap3_pdata = { .regs = &omap2_gpio_regs, .bank_width = 32, .dbck_flag = true, }; -static struct omap_gpio_platform_data omap4_pdata = { +const static struct omap_gpio_platform_data omap4_pdata = { .regs = &omap4_gpio_regs, .bank_width = 32, .dbck_flag = true, -- cgit v0.10.2 From a99cc82bd61baefd8bb3110e1284629be3610c0c Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2012 16:24:26 +0000 Subject: powerpc/fsl_msi: drop unneeded cast to non-const pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cast is unneeded since *of_device_id.data became const. [ukl: split Arnd's patch by driver and add changelog] Signed-off-by: Arnd Bergmann Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index a40acd6..51ffafa 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c @@ -502,15 +502,15 @@ static const struct fsl_msi_feature vmpic_msi_feature = { static const struct of_device_id fsl_of_msi_ids[] = { { .compatible = "fsl,mpic-msi", - .data = (void *)&mpic_msi_feature, + .data = &mpic_msi_feature, }, { .compatible = "fsl,ipic-msi", - .data = (void *)&ipic_msi_feature, + .data = &ipic_msi_feature, }, { .compatible = "fsl,vmpic-msi", - .data = (void *)&vmpic_msi_feature, + .data = &vmpic_msi_feature, }, {} }; -- cgit v0.10.2 From e27d650b3d39e22df7359dc68401b7dca486fce3 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2012 16:24:26 +0000 Subject: mfd/da9052: make i2c_device_id array const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is possible since *of_device_id.data became const. While at it also drop a cast to const that was never needed. [ukl: split Arnd's patch by driver and add changlog] Signed-off-by: Arnd Bergmann Signed-off-by: Uwe Kleine-König diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c index 82c9d64..352c58b 100644 --- a/drivers/mfd/da9052-i2c.c +++ b/drivers/mfd/da9052-i2c.c @@ -46,7 +46,7 @@ static int da9052_i2c_enable_multiwrite(struct da9052 *da9052) return 0; } -static struct i2c_device_id da9052_i2c_id[] = { +static const struct i2c_device_id da9052_i2c_id[] = { {"da9052", DA9052}, {"da9053-aa", DA9053_AA}, {"da9053-ba", DA9053_BA}, @@ -104,7 +104,7 @@ static int __devinit da9052_i2c_probe(struct i2c_client *client, const struct of_device_id *deviceid; deviceid = of_match_node(dialog_dt_ids, np); - id = (const struct i2c_device_id *)deviceid->data; + id = deviceid->data; } #endif -- cgit v0.10.2 From 1d10a65fde071fae939387348c309bd6c237d36e Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2012 16:24:26 +0000 Subject: i2c/mpc: make data used as *of_device_id.data const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since of_device_id.data is declared as a pointer to const data a few more consts can be added in this driver. [ukl: split Arnd's patch by driver] Signed-off-by: Arnd Bergmann Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 775062c..57f7703 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -730,24 +730,24 @@ static int mpc_i2c_resume(struct device *dev) SIMPLE_DEV_PM_OPS(mpc_i2c_pm_ops, mpc_i2c_suspend, mpc_i2c_resume); #endif -static struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = { +static const struct mpc_i2c_data mpc_i2c_data_512x __devinitdata = { .setup = mpc_i2c_setup_512x, }; -static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = { +static const struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = { .setup = mpc_i2c_setup_52xx, }; -static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = { +static const struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = { .setup = mpc_i2c_setup_8xxx, }; -static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = { +static const struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = { .setup = mpc_i2c_setup_8xxx, .prescaler = 2, }; -static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = { +static const struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = { .setup = mpc_i2c_setup_8xxx, .prescaler = 3, }; -- cgit v0.10.2 From 306e352ab1b59335c56657f4d59cbe8edc040a8c Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2012 16:24:26 +0000 Subject: macintosh/mediabay: make data used as *of_device_id.data const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since of_device_id.data is declared as a pointer to const data a few more consts can be added in this driver. [ukl: split Arnd's patch by driver] Signed-off-by: Arnd Bergmann Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 54bf584..3f8d032 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c @@ -669,7 +669,7 @@ static int media_bay_resume(struct macio_dev *mdev) /* Definitions of "ops" structures. */ -static struct mb_ops ohare_mb_ops = { +static const struct mb_ops ohare_mb_ops = { .name = "Ohare", .content = ohare_mb_content, .power = ohare_mb_power, @@ -678,7 +678,7 @@ static struct mb_ops ohare_mb_ops = { .un_reset_ide = ohare_mb_un_reset_ide, }; -static struct mb_ops heathrow_mb_ops = { +static const struct mb_ops heathrow_mb_ops = { .name = "Heathrow", .content = heathrow_mb_content, .power = heathrow_mb_power, @@ -687,7 +687,7 @@ static struct mb_ops heathrow_mb_ops = { .un_reset_ide = heathrow_mb_un_reset_ide, }; -static struct mb_ops keylargo_mb_ops = { +static const struct mb_ops keylargo_mb_ops = { .name = "KeyLargo", .init = keylargo_mb_init, .content = keylargo_mb_content, -- cgit v0.10.2 From 6d99c4c5d21a18ea34d03deb3cb2777fb82677dd Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2012 16:24:26 +0000 Subject: can: mpc5xxx_can: make data used as *of_device_id.data const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since of_device_id.data is declared as a pointer to const data a few more consts can be added in this driver. [ukl: split Arnd's patch by driver] Signed-off-by: Arnd Bergmann Acked-by: Marc Kleine-Budde Acked-by: Benjamin Herrenschmidt Signed-off-by: Uwe Kleine-König diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index 06adf88..8a8df82 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c @@ -380,12 +380,12 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev) } #endif -static struct mpc5xxx_can_data __devinitdata mpc5200_can_data = { +static const struct mpc5xxx_can_data __devinitdata mpc5200_can_data = { .type = MSCAN_TYPE_MPC5200, .get_clock = mpc52xx_can_get_clock, }; -static struct mpc5xxx_can_data __devinitdata mpc5121_can_data = { +static const struct mpc5xxx_can_data __devinitdata mpc5121_can_data = { .type = MSCAN_TYPE_MPC5121, .get_clock = mpc512x_can_get_clock, }; -- cgit v0.10.2 From 75f21631bce693f867e7f2204875cb06cee9deff Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Wed, 29 Aug 2012 10:31:18 +0200 Subject: dma: tegra: make data used as *of_device_id.data const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since of_device_id.data is declared as a pointer to const data a few more consts can be added in this driver. [ukl: split Laxman's patch to prevent warnings in the middle of the series. Original patch was sent with msgid 1346217447-19730-1-git-send-email-ldewangan@nvidia.com] Signed-off-by: Laxman Dewangan Acked-by: Stephen Warren Acked-by: Vinod Koul Signed-off-by: Uwe Kleine-König diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 29a39b8..56adcfc1 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -1166,14 +1166,14 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc) } /* Tegra20 specific DMA controller information */ -static struct tegra_dma_chip_data tegra20_dma_chip_data = { +static const struct tegra_dma_chip_data tegra20_dma_chip_data = { .nr_channels = 16, .max_dma_count = 1024UL * 64, }; #if defined(CONFIG_OF) /* Tegra30 specific DMA controller information */ -static struct tegra_dma_chip_data tegra30_dma_chip_data = { +static const struct tegra_dma_chip_data tegra30_dma_chip_data = { .nr_channels = 32, .max_dma_count = 1024UL * 64, }; -- cgit v0.10.2