Changeset 31120 for trunk


Ignore:
Timestamp:
2012-03-28T11:36:50+02:00 (4 years ago)
Author:
hauke
Message:

brcm47xx: BCMA - Consolidate/reduce code in bcma_device_name

Eliminate unneeded procedure by incorporating code into bcma_device_name

Signed-off-by: Nathan Hintz <nlhintz@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch

    r30875 r31120  
    4949        { BCMA_CORE_DDR12_MEM_CTL, "DDR1/DDR2 Memory Controller" }, 
    5050        { BCMA_CORE_PCIE_RC, "PCIe Root Complex" }, 
    51 @@ -79,16 +80,57 @@ struct bcma_device_id_name bcma_device_n 
     51@@ -79,16 +80,41 @@ struct bcma_device_id_name bcma_device_n 
    5252        { BCMA_CORE_SHIM, "SHIM" }, 
    5353        { BCMA_CORE_DEFAULT, "Default" }, 
     
    6161+}; 
    6262+ 
    63 +static const char *bcma_scan_device_names(const struct bcma_device_id *id, 
    64 +                                  const struct bcma_device_id_name *device_names, 
    65 +                                  int array_size) 
     63+static const char *bcma_device_name(const struct bcma_device_id *id) 
    6664 { 
    67         int i; 
     65-       int i; 
     66+       const struct bcma_device_id_name *names; 
     67+       int size, i; 
    6868  
    6969-       if (id->manuf == BCMA_MANUF_BCM) { 
     
    7272-                               return bcma_device_names[i].name; 
    7373-               } 
    74 +       for (i = 0; i < array_size; i++) { 
    75 +               if (device_names[i].id == id->id) 
    76 +                       return device_names[i].name; 
    77         } 
    78 +       return NULL; 
    79 +} 
    80 + 
    81 +static const char *bcma_device_name(const struct bcma_device_id *id) 
    82 +{ 
    83 +       const char *name; 
    84 +       const struct bcma_device_id_name *names; 
    85 +       int size; 
    86 + 
    8774+       /* search manufacturer specific names */ 
    8875+       switch (id->manuf) { 
     
    10087+               break; 
    10188+       default: 
    102 +               names = NULL; 
    103 +               break; 
    104 +       } 
     89+               return "UNKNOWN"; 
     90        } 
    10591+ 
    106 +       if (names) { 
    107 +               name = bcma_scan_device_names(id, names, size); 
    108 +               if (name) 
    109 +                       return name; 
     92+       for (i = 0; i < size; i++) { 
     93+               if (names[i].id == id->id) 
     94+                       return names[i].name; 
    11095+       } 
    11196+ 
Note: See TracChangeset for help on using the changeset viewer.