• Arnd Bergmann's avatar
    ARM: davinci: only use NVMEM when available · 04b9665b
    Arnd Bergmann authored
    The davinci platform contains code that calls into the nvmem
    subsystem, but that might be a loadable module, causing a
    link error:
    
    arch/arm/mach-davinci/built-in.o: In function `davinci_get_mac_addr':
    :(.text+0x1088): undefined reference to `nvmem_device_read'
    arch/arm/mach-davinci/built-in.o: In function `read_factory_config':
    :(.text+0x214c): undefined reference to `nvmem_device_read'
    
    Also, when NVMEM is completely disabled, the functions fail with
    nonobvious error messages.
    
    This ensures we only call the API functions when the code is actually
    reachable from the board file, and otherwise prints a unique log
    message.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Fixes: bec3c11b ("misc: at24: replace memory_accessor with nvmem_device_read")
    Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
    Signed-off-by: default avatarKevin Hilman <khilman@baylibre.com>
    04b9665b
common.c 3.01 KB