aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@openwrt.org>2012-03-28 09:36:50 +0000
committerHauke Mehrtens <hauke@openwrt.org>2012-03-28 09:36:50 +0000
commit68b4dc558351e2d0af0be5f106fff80777e366fc (patch)
tree442f0deb2968490572848cd61ab5ce999b380e0f /target
parent15384e2608a14b0796fb8dcef604c36238cdd5f6 (diff)
downloadupstream-68b4dc558351e2d0af0be5f106fff80777e366fc.tar.gz
upstream-68b4dc558351e2d0af0be5f106fff80777e366fc.tar.bz2
upstream-68b4dc558351e2d0af0be5f106fff80777e366fc.zip
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@hotmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31120 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch35
1 files changed, 10 insertions, 25 deletions
diff --git a/target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch b/target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch
index f76c5adec5..54addee966 100644
--- a/target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch
+++ b/target/linux/brcm47xx/patches-3.2/230-bcma-find-name-for-non-brcm.patch
@@ -48,7 +48,7 @@
{ BCMA_CORE_MAC_GBIT, "GBit MAC" },
{ BCMA_CORE_DDR12_MEM_CTL, "DDR1/DDR2 Memory Controller" },
{ BCMA_CORE_PCIE_RC, "PCIe Root Complex" },
-@@ -79,16 +80,57 @@ struct bcma_device_id_name bcma_device_n
+@@ -79,16 +80,41 @@ struct bcma_device_id_name bcma_device_n
{ BCMA_CORE_SHIM, "SHIM" },
{ BCMA_CORE_DEFAULT, "Default" },
};
@@ -60,30 +60,17 @@
+ { BCMA_CORE_MIPS_74K, "MIPS 74K" },
+};
+
-+static const char *bcma_scan_device_names(const struct bcma_device_id *id,
-+ const struct bcma_device_id_name *device_names,
-+ int array_size)
++static const char *bcma_device_name(const struct bcma_device_id *id)
{
- int i;
+- int i;
++ const struct bcma_device_id_name *names;
++ int size, i;
- if (id->manuf == BCMA_MANUF_BCM) {
- for (i = 0; i < ARRAY_SIZE(bcma_device_names); i++) {
- if (bcma_device_names[i].id == id->id)
- return bcma_device_names[i].name;
- }
-+ for (i = 0; i < array_size; i++) {
-+ if (device_names[i].id == id->id)
-+ return device_names[i].name;
- }
-+ return NULL;
-+}
-+
-+static const char *bcma_device_name(const struct bcma_device_id *id)
-+{
-+ const char *name;
-+ const struct bcma_device_id_name *names;
-+ int size;
-+
+ /* search manufacturer specific names */
+ switch (id->manuf) {
+ case BCMA_MANUF_ARM:
@@ -99,14 +86,12 @@
+ size = ARRAY_SIZE(bcma_mips_device_names);
+ break;
+ default:
-+ names = NULL;
-+ break;
-+ }
++ return "UNKNOWN";
+ }
+
-+ if (names) {
-+ name = bcma_scan_device_names(id, names, size);
-+ if (name)
-+ return name;
++ for (i = 0; i < size; i++) {
++ if (names[i].id == id->id)
++ return names[i].name;
+ }
+
return "UNKNOWN";