]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: samsung: Constify wakeup driver specific data
authorKrzysztof Kozlowski <krzk@kernel.org>
Tue, 23 May 2017 18:41:39 +0000 (20:41 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Wed, 7 Jun 2017 18:40:47 +0000 (20:40 +0200)
Static exynos_irq_chip structures, containing driver specific data, are
referenced only through opaque data pointer in const of_device_id table.
The contents of pointed memory (exynos_irq_chip structure itself) is
then copied with kmemdup() during wakeup initialization so
exynos_irq_chip can be made const for code safenes.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
drivers/pinctrl/samsung/pinctrl-exynos.c

index 0dbd1f58dad57e2b9b6245ec4a4d0f72ad78320f..727462cc670cce22b63289111cff7d72e6a8230a 100644 (file)
@@ -363,7 +363,7 @@ static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on)
 /*
  * irq_chip for wakeup interrupts
  */
-static struct exynos_irq_chip exynos4210_wkup_irq_chip __initdata = {
+static const struct exynos_irq_chip exynos4210_wkup_irq_chip __initconst = {
        .chip = {
                .name = "exynos4210_wkup_irq_chip",
                .irq_unmask = exynos_irq_unmask,
@@ -379,7 +379,7 @@ static struct exynos_irq_chip exynos4210_wkup_irq_chip __initdata = {
        .eint_pend = EXYNOS_WKUP_EPEND_OFFSET,
 };
 
-static struct exynos_irq_chip exynos7_wkup_irq_chip __initdata = {
+static const struct exynos_irq_chip exynos7_wkup_irq_chip __initconst = {
        .chip = {
                .name = "exynos7_wkup_irq_chip",
                .irq_unmask = exynos_irq_unmask,