Ignore:
Timestamp:
Mar 12, 2017, 11:37:57 PM (2 months ago)
Author:
brainslayer
Message:

fix laguna build

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/arch/arm/mach-cns3xxx/laguna.c

    r31638 r31644  
    649649};
    650650
    651 static struct memory_accessor *at24_mem_acc;
    652 
    653 static void at24_setup(struct memory_accessor *mem_acc, void *context)
     651static struct nvmem_device *at24_nvmem;
     652
     653static void __init at24_setup(struct nvmem_device *mem_acc, void *context)
    654654{
    655655        char buf[16];
    656656
    657         at24_mem_acc = mem_acc;
    658 
    659         /* Read MAC addresses */
    660         if (at24_mem_acc->read(at24_mem_acc, buf, 0x100, 6) == 6)
     657        at24_nvmem = mem_acc;
     658
     659        if (nvmem_device_read(at24_nvmem, 0x100, 6, buf) == 6)
    661660                memcpy(&laguna_net_data.hwaddr[0], buf, ETH_ALEN);
    662         if (at24_mem_acc->read(at24_mem_acc, buf, 0x106, 6) == 6)
     661        if (nvmem_device_read(at24_nvmem, 0x106, 6, buf) == 6)
    663662                memcpy(&laguna_net_data.hwaddr[1], buf, ETH_ALEN);
    664         if (at24_mem_acc->read(at24_mem_acc, buf, 0x10C, 6) == 6)
     663        if (nvmem_device_read(at24_nvmem, 0x10C, 6, buf) == 6)
    665664                memcpy(&laguna_net_data.hwaddr[2], buf, ETH_ALEN);
    666         if (at24_mem_acc->read(at24_mem_acc, buf, 0x112, 6) == 6)
     665        if (nvmem_device_read(at24_nvmem, 0x112, 6, buf) == 6)
    667666                memcpy(&laguna_net_data.hwaddr[3], buf, ETH_ALEN);
    668667
    669668        /* Read out Model Information */
    670         if (at24_mem_acc->read(at24_mem_acc, buf, 0x130, 16) == 16)
     669        if (nvmem_device_read(at24_nvmem, 0x130, 16, buf) == 16)
    671670                memcpy(&laguna_info.model, buf, 16);
    672         if (at24_mem_acc->read(at24_mem_acc, buf, 0x140, 1) == 1)
     671        if (nvmem_device_read(at24_nvmem, 0x140, 1, buf) == 1)
    673672                memcpy(&laguna_info.nor_flash_size, buf, 1);
    674         if (at24_mem_acc->read(at24_mem_acc, buf, 0x141, 1) == 1)
     673        if (nvmem_device_read(at24_nvmem, 0x141, 1, buf) == 1)
    675674                memcpy(&laguna_info.spi_flash_size, buf, 1);
    676         if (at24_mem_acc->read(at24_mem_acc, buf, 0x142, 4) == 4)
     675        if (nvmem_device_read(at24_nvmem, 0x142, 4, buf) == 4)
    677676                memcpy(&laguna_info.config_bitmap, buf, 4);
    678         if (at24_mem_acc->read(at24_mem_acc, buf, 0x146, 4) == 4)
     677        if (nvmem_device_read(at24_nvmem, 0x146, 4, buf) == 4)
    679678                memcpy(&laguna_info.config2_bitmap, buf, 4);
    680 };
    681 
    682 static struct at24_platform_data laguna_eeprom_info = {
     679
     680};
     681
     682static struct at24_platform_data __initdata laguna_eeprom_info = {
    683683        .byte_len = 1024,
    684684        .page_size = 16,
Note: See TracChangeset for help on using the changeset viewer.