]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
i2c: stm32f7: change setup struct to const
authorPatrick Delaunay <patrick.delaunay@st.com>
Mon, 29 Oct 2018 14:31:56 +0000 (15:31 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 16 Nov 2018 21:51:58 +0000 (16:51 -0500)
Change static array to const when it is useful to save memory
(move stm32f7_setup=0x18 from .data to .rodata section)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
drivers/i2c/stm32f7_i2c.c

index 7ed04d9bfcc062ca00e23a90f758379bdeb1d779..3872364d6bf59454cc26b5f19fdb0629c2c13c8d 100644 (file)
@@ -197,7 +197,7 @@ struct stm32_i2c_priv {
        int speed;
 };
 
-static struct stm32_i2c_spec i2c_specs[] = {
+static const struct stm32_i2c_spec i2c_specs[] = {
        [STM32_I2C_SPEED_STANDARD] = {
                .rate = STANDARD_RATE,
                .rate_min = 8000,
@@ -236,7 +236,7 @@ static struct stm32_i2c_spec i2c_specs[] = {
        },
 };
 
-static struct stm32_i2c_setup stm32f7_setup = {
+static const struct stm32_i2c_setup stm32f7_setup = {
        .rise_time = STM32_I2C_RISE_TIME_DEFAULT,
        .fall_time = STM32_I2C_FALL_TIME_DEFAULT,
        .dnf = STM32_I2C_DNF_DEFAULT,