Skip to contentSkip to conversation

dspbridge: OSAL: Simplify REG API

PATCH New Andy Shevchenko 1 participant 3 messages Sep 21, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover dspbridge: OSAL: Simplify REG API

From: Andy Shevchenko <[email protected]>

There are two patches which simplify registry API.

Andy Shevchenko (2):
DSPBRIDGE: OSAL: Simplify REG API
DSPBRIDGE: OSAL: Remove unused registry variables

 arch/arm/plat-omap/include/dspbridge/dbreg.h |    3 -
 arch/arm/plat-omap/include/dspbridge/reg.h   |  102 +++----------------------
 drivers/dsp/bridge/rmgr/dbdcd.c              |   22 ++---
 drivers/dsp/bridge/rmgr/drv.c                |   22 ++----
 drivers/dsp/bridge/rmgr/drv_interface.c      |   35 ++-------
 drivers/dsp/bridge/services/cfg.c            |   50 ++++---------
 drivers/dsp/bridge/services/reg.c            |   26 ++-----
 drivers/dsp/bridge/services/regsup.c         |    3 +-
 drivers/dsp/bridge/services/regsup.h         |    4 +-
 drivers/dsp/bridge/wmd/tiomap3430.c          |    4 +-
 10 files changed, 68 insertions(+), 203 deletions(-)
#1 lore raw

PATCH 1/2 DSPBRIDGE: OSAL: Simplify REG API

From: Andy Shevchenko <[email protected]>

Simplify REG API by removing useless input parameters.

---
 arch/arm/plat-omap/include/dspbridge/reg.h |  102 ++++------------------------
 drivers/dsp/bridge/rmgr/dbdcd.c            |   22 +++----
 drivers/dsp/bridge/rmgr/drv.c              |   22 ++----
 drivers/dsp/bridge/rmgr/drv_interface.c    |   33 ++++-----
 drivers/dsp/bridge/services/cfg.c          |   49 +++++---------
 drivers/dsp/bridge/services/reg.c          |   26 ++-----
 drivers/dsp/bridge/services/regsup.c       |    3 +-
 drivers/dsp/bridge/services/regsup.h       |    4 +-
 drivers/dsp/bridge/wmd/tiomap3430.c        |    4 +-
 9 files changed, 75 insertions(+), 190 deletions(-)
arch/arm/plat-omap/include/dspbridge/reg.h +13 -89
index 5b34952..64a8fe8 100644
@@ -22,7 +22,6 @@
  *
  *  Public Functions:
  *      REG_DeleteValue
- *      REG_EnumKey
  *      REG_EnumValue
  *      REG_Exit
  *      REG_GetValue
@@ -53,23 +52,6 @@
 
 #include <linux/types.h>
 
-/*  ------------------------- Defines, Data Structures, Typedefs for Linux */
-#ifndef UNDER_CE
-
-#ifndef REG_SZ
-#define REG_SZ          1
-#endif
-
-#ifndef REG_BINARY
-#define REG_BINARY      3
-#endif
-
-#ifndef REG_DWORD
-#define REG_DWORD       4
-#endif
-
-#endif				/* UNDER_CE */
-
 #define REG_MAXREGPATHLENGTH    255
 
 /*
@@ -78,57 +60,18 @@
  *      Deletes a registry entry. NOTE: A registry entry is not the same as
  *      a registry key.
  *  Parameters:
- *      phKey:      Currently reserved; must be NULL.
- *      pstrSubkey: Path to key to open.
  *      pstrValue:  Name of entry to delete.
  *  Returns:
  *      DSP_SOK:    Success.
  *      DSP_EFAIL:  General failure.
  *  Requires:
  *      - REG initialized.
- *      - pstrSubkey & pstrValue are non-NULL values.
- *      - phKey is NULL.
- *      - length of pstrSubkey < REG_MAXREGPATHLENGTH.
+ *      - pstrValue is non-NULL value.
  *      - length of pstrValue < REG_MAXREGPATHLENGTH.
  *  Ensures:
  *  Details:
  */
-	extern DSP_STATUS REG_DeleteValue(OPTIONAL IN HANDLE *phKey,
-					  IN CONST char *pstrSubkey,
-					  IN CONST char *pstrValue);
-
-/*
- *  ======== REG_EnumKey ========
- *  Purpose:
- *      Enumerates subkeys of the specified path to the  registry key
- *      Retrieves the  name of the subkey(given the index) and
- *      appends with the orignal path to form the full path.
- *  Parameters:
- *      phKey:      Currently reserved; must be NULL.
- *      pstrKey     The name of the registry key to be enumerated.
- *      dwIndex     Specifies the index of the subkey to retrieve.
- *      pstrSubkey: Pointer to buffer that receives full path name of the
- *                  specified key + the sub-key
- *      pdwValueSize:   Specifies bytes of memory pstrSubkey points to on input,
- *                      on output, specifies actual memory bytes written into.
- *                      If there is no sub key,pdwValueSize returns NULL.
- *  Returns:
- *      DSP_SOK:    Success.
- *      DSP_EFAIL:  General failure.
- *  Requires:
- *      - REG initialized.
- *      - pstrKey is non-NULL value.
- *      - pdwValueSize is a valid pointer.
- *      - phKey is NULL.
- *      - length of pstrKey < REG_MAXREGPATHLENGTH.
- *  Ensures:
- *      - strlen(pstrSubkey) is > strlen(pstrKey) &&
- *      - strlen(pstrSubkey) is < REG_MAXREGPATHLENGTH
- */
-	extern DSP_STATUS REG_EnumKey(OPTIONAL IN HANDLE *phKey,
-				      IN u32 dwIndex, IN CONST char *pstrKey,
-				      IN OUT char *pstrSubkey,
-				      IN OUT u32 *pdwValueSize);
+extern DSP_STATUS REG_DeleteValue(IN CONST char *pstrValue);
 
 /*
  *  ======== REG_EnumValue ========
@@ -136,7 +79,6 @@
  *      Enumerates values of a specified key. Retrieves each value name and
  *      the data associated with the value.
  *  Parameters:
- *      phKey:          Currently reserved; must be NULL.
  *      dwIndex:        Specifies the index of the value to retrieve.
  *      pstrKey:        The name of the registry key to be enumerated.
  *      pstrValue:      Pointer to buffer that receives the name of the value.
@@ -152,19 +94,16 @@
  *      DSP_EFAIL:      General failure.
  *  Requires:
  *      REG initialized.
- *      phKey is NULL.
  *      pstrKey is a non-NULL value.
  *      pstrValue, pstrData, pdwValueSize and pdwDataSize are valid pointers.
  *      Length of pstrKey is less than REG_MAXREGPATHLENGTH.
  *  Ensures:
  */
-	extern DSP_STATUS REG_EnumValue(IN HANDLE *phKey,
-					IN u32 dwIndex,
-					IN CONST char *pstrKey,
-					IN OUT char *pstrValue,
-					IN OUT u32 *pdwValueSize,
-					IN OUT char *pstrData,
-					IN OUT u32 *pdwDataSize);
+extern DSP_STATUS REG_EnumValue(IN u32 dwIndex, IN CONST char *pstrKey,
+				IN OUT char *pstrValue,
+				IN OUT u32 *pdwValueSize,
+				IN OUT char *pstrData,
+				IN OUT u32 *pdwDataSize);
 
 /*
  *  ======== REG_Exit ========
@@ -185,8 +124,6 @@
  *  Purpose:
  *      Retrieve a value from the registry.
  *  Parameters:
- *      phKey:          Currently reserved; must be NULL.
- *      pstrSubkey:     Path to key to open.
  *      pstrEntry:      Name of entry to retrieve.
  *      pbValue:        Upon return, points to retrieved value.
  *      pdwValueSize:   Specifies bytes of memory pbValue points to on input,
@@ -198,18 +135,13 @@
  *      DSP_EFAIL:      General failure.
  *  Requires:
  *      - REG initialized.
- *      - pstrSubkey & pstrEntry are non-NULL values.
+ *      - pstrEntry is non-NULL value.
  *      - pbValue is a valid pointer.
- *      - phKey is NULL.
- *      - length of pstrSubkey < REG_MAXREGPATHLENGTH.
  *      - length of pstrEntry < REG_MAXREGPATHLENGTH.
  *  Ensures:
  */
-	extern DSP_STATUS REG_GetValue(OPTIONAL IN HANDLE *phKey,
-				       IN CONST char *pstrSubkey,
-				       IN CONST char *pstrEntry,
-				       OUT u8 *pbValue,
-				       IN OUT u32 *pdwValueSize);
+extern DSP_STATUS REG_GetValue(IN CONST char *pstrEntry, OUT u8 *pbValue,
+			       IN OUT u32 *pdwValueSize);
 
 /*
  *  ======== REG_Init ========
@@ -229,10 +161,7 @@
  *  Purpose:
  *      Set a value in the registry.
  *  Parameters:
- *      phKey:          Handle to open reg key, or NULL if pSubkey is full path.
- *      pstrSubkey:     Path to key to open, could be based on phKey.
  *      pstrEntry:      Name of entry to set.
- *      dwType:         Data type of new registry value.
  *      pbValue:        Points to buffer containing new data.
  *      dwValueSize:    Specifies bytes of memory bValue points to.
  *  Returns:
@@ -240,18 +169,13 @@
  *      DSP_EFAIL:      General failure.
  *  Requires:
  *      - REG initialized.
- *      - pstrSubkey & pstrEntry are non-NULL values.
+ *      - pstrEntry is non-NULL value.
  *      - pbValue is a valid pointer.
- *      - phKey is NULL.
  *      - dwValuSize > 0.
- *      - length of pstrSubkey < REG_MAXREGPATHLENGTH.
  *      - length of pstrEntry < REG_MAXREGPATHLENGTH.
  *  Ensures:
  */
-	extern DSP_STATUS REG_SetValue(OPTIONAL IN HANDLE *phKey,
-				       IN CONST char *pstrSubKey,
-				       IN CONST char *pstrEntry,
-				       IN CONST u32 dwType,
-				       IN u8 *pbValue, IN u32 dwValueSize);
+extern DSP_STATUS REG_SetValue(IN CONST char *pstrEntry, IN u8 *pbValue,
+			       IN u32 dwValueSize);
 
 #endif				/* _REG_H */
drivers/dsp/bridge/rmgr/dbdcd.c +9 -13
index 954e83d..cc3373a 100644
@@ -344,7 +344,7 @@ DSP_STATUS DCD_EnumerateObject(IN s32 cIndex, IN enum DSP_DCDOBJTYPE objType,
 		}
 
 		if (DSP_SUCCEEDED(status)) {
-			status = REG_EnumValue(NULL, cIndex, szRegKey, szValue,
+			status = REG_EnumValue(cIndex, szRegKey, szValue,
 					&dwValueSize, szData, &dwDataSize);
 		}
 
@@ -529,8 +529,7 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 		dwBufSize = REG_MAXREGPATHLENGTH;
 	}
 	if (DSP_SUCCEEDED(status)) {
-		status = REG_GetValue(NULL, szRegKey, szRegKey, (u8 *)szRegData,
-					&dwBufSize);
+		status = REG_GetValue(szRegKey, (u8 *)szRegData, &dwBufSize);
 	}
 	if (DSP_FAILED(status)) {
 		status = DSP_EUUID;
@@ -824,8 +823,7 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
 	}
 	if (DSP_SUCCEEDED(status)) {
 		/* Retrieve path from the registry based on DSP_UUID */
-		status = REG_GetValue(NULL, szRegKey, szRegKey,
-					(u8 *)pstrLibName, pdwSize);
+		status = REG_GetValue(szRegKey, (u8 *)pstrLibName, pdwSize);
 	}
 
 	/* If can't find, phases might be registered as generic LIBRARYTYPE */
@@ -853,8 +851,7 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
 		else
 			status = DSP_EFAIL;
 
-		status = REG_GetValue(NULL, szRegKey, szRegKey,
-					(u8 *)pstrLibName, pdwSize);
+		status = REG_GetValue(szRegKey, (u8 *)pstrLibName, pdwSize);
 	}
 
 	return status;
@@ -989,11 +986,10 @@ DSP_STATUS DCD_RegisterObject(IN struct DSP_UUID *pUuid,
 	if (pszPathName) {
 		/* Add new reg value (UUID+objType) with COFF path info. */
 		dwPathSize = strlen(pszPathName) + 1;
-		status = REG_SetValue(NULL, szRegKey, szRegKey, REG_SZ,
-				(u8 *)pszPathName, dwPathSize);
-		GT_3trace(curTrace, GT_6CLASS, "REG_SetValue  REG_SZ=%d, "
-			"(u8 *)pszPathName=%s, dwPathSize=%d\n",
-			REG_SZ, pszPathName, dwPathSize);
+		status = REG_SetValue(szRegKey, (u8 *)pszPathName, dwPathSize);
+		GT_3trace(curTrace, GT_6CLASS, "REG_SetValue  "
+			  "(u8 *)pszPathName=%s, dwPathSize=%d\n",
+			  pszPathName, dwPathSize);
 		if (DSP_FAILED(status)) {
 			status = DSP_EFAIL;
 			GT_0trace(curTrace, GT_6CLASS,
@@ -1018,7 +1014,7 @@ DSP_STATUS DCD_RegisterObject(IN struct DSP_UUID *pUuid,
 #endif /* RES_CLEANUP_DISABLE */
 	} else {
 		/* Deregister an existing object. */
-		status = REG_DeleteValue(NULL, szRegKey, szRegKey);
+		status = REG_DeleteValue(szRegKey);
 		if (DSP_FAILED(status)) {
 			status = DSP_EFAIL;
 			GT_0trace(curTrace, GT_6CLASS, "DCD_UnregisterObject: "
drivers/dsp/bridge/rmgr/drv.c +8 -14
index 8c83c22..838fb45 100644
@@ -1193,8 +1193,8 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, s32 bRequest)
 		/* Releasing resources by deleting the registry key  */
 		dwBuffSize = sizeof(struct CFG_HOSTRES);
 		pResources = MEM_Calloc(dwBuffSize, MEM_NONPAGED);
-		if (DSP_FAILED(REG_GetValue(NULL, (char *)driverExt->szString,
-		   CURRENTCONFIG, (u8 *)pResources, &dwBuffSize))) {
+		if (DSP_FAILED(REG_GetValue(CURRENTCONFIG, (u8 *)pResources,
+					    &dwBuffSize))) {
 			status = CFG_E_RESOURCENOTAVAIL;
 			GT_0trace(curTrace, GT_1CLASS,
 				 "REG_GetValue Failed \n");
@@ -1205,8 +1205,8 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, s32 bRequest)
 
 		if (pResources != NULL) {
 			dwBuffSize = sizeof(shm_size);
-			status = REG_GetValue(NULL, CURRENTCONFIG, SHMSIZE,
-				(u8 *)&shm_size, &dwBuffSize);
+			status = REG_GetValue(SHMSIZE, (u8 *)&shm_size,
+					      &dwBuffSize);
 			if (DSP_SUCCEEDED(status)) {
 				if ((pResources->dwMemBase[1]) &&
 				   (pResources->dwMemPhys[1])) {
@@ -1263,8 +1263,7 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, s32 bRequest)
 			pResources->dwDmmuBase = NULL;
 
 			dwBuffSize = sizeof(struct CFG_HOSTRES);
-			status = REG_SetValue(NULL, (char *)driverExt->szString,
-				 CURRENTCONFIG, REG_BINARY, (u8 *)pResources,
+			status = REG_SetValue(CURRENTCONFIG, (u8 *)pResources,
 				 (u32)dwBuffSize);
 			/*  Set all the other entries to NULL */
 			MEM_Free(pResources);
@@ -1315,9 +1314,7 @@ static DSP_STATUS RequestBridgeResources(u32 dwContext, s32 bRequest)
 			pResources->dwNumChnls = CHNL_MAXCHANNELS;
 			pResources->dwChnlBufSize = 0x400;
 			dwBuffSize = sizeof(struct CFG_HOSTRES);
-			status = REG_SetValue(NULL, (char *) dwContext,
-					     CURRENTCONFIG, REG_BINARY,
-					     (u8 *)pResources,
+			status = REG_SetValue(CURRENTCONFIG, (u8 *)pResources,
 					     sizeof(struct CFG_HOSTRES));
 			if (DSP_SUCCEEDED(status)) {
 				GT_0trace(curTrace, GT_1CLASS,
@@ -1408,8 +1405,7 @@ static DSP_STATUS RequestBridgeResourcesDSP(u32 dwContext, s32 bRequest)
 		GT_1trace(curTrace, GT_2CLASS, "dwDmmuBase 0x%x\n",
 						pResources->dwDmmuBase);
 		dwBuffSize = sizeof(shm_size);
-		status = REG_GetValue(NULL, CURRENTCONFIG, SHMSIZE,
-				     (u8 *)&shm_size, &dwBuffSize);
+		status = REG_GetValue(SHMSIZE, (u8 *)&shm_size, &dwBuffSize);
 		if (DSP_SUCCEEDED(status)) {
 			/* Allocate Physically contiguous,
 			 * non-cacheable  memory */
@@ -1441,9 +1437,7 @@ static DSP_STATUS RequestBridgeResourcesDSP(u32 dwContext, s32 bRequest)
 			pResources->dwNumChnls = CHNL_MAXCHANNELS;
 			pResources->dwChnlBufSize = 0x400;
 			dwBuffSize = sizeof(struct CFG_HOSTRES);
-			status = REG_SetValue(NULL, (char *)dwContext,
-					     CURRENTCONFIG, REG_BINARY,
-					     (u8 *)pResources,
+			status = REG_SetValue(CURRENTCONFIG, (u8 *)pResources,
 					     sizeof(struct CFG_HOSTRES));
 			if (DSP_SUCCEEDED(status)) {
 				GT_0trace(curTrace, GT_1CLASS,
drivers/dsp/bridge/rmgr/drv_interface.c +14 -19
index 06db1bd..6a540a9 100644
@@ -349,22 +349,18 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 
 	if (base_img) {
 		temp = true;
-		REG_SetValue(NULL, NULL, AUTOSTART, REG_DWORD, (u8 *)&temp,
-			    sizeof(temp));
-		REG_SetValue(NULL, NULL, DEFEXEC, REG_SZ, (u8 *)base_img,
-						strlen(base_img) + 1);
+		REG_SetValue(AUTOSTART, (u8 *)&temp, sizeof(temp));
+		REG_SetValue(DEFEXEC, (u8 *)base_img, strlen(base_img) + 1);
 	} else {
 		temp = false;
-		REG_SetValue(NULL, NULL, AUTOSTART, REG_DWORD, (u8 *)&temp,
-			    sizeof(temp));
-		REG_SetValue(NULL, NULL, DEFEXEC, REG_SZ, (u8 *) "\0", (u32)2);
+		REG_SetValue(AUTOSTART, (u8 *)&temp, sizeof(temp));
+		REG_SetValue(DEFEXEC, (u8 *) "\0", (u32)2);
 	}
-	REG_SetValue(NULL, NULL, NUMPROCS, REG_SZ, (u8 *) num_procs,
-						strlen(num_procs) + 1);
+	REG_SetValue(NUMPROCS, (u8 *) num_procs, strlen(num_procs) + 1);
 
 	if (shm_size >= 0x10000) {	/* 64 KB */
-		initStatus = REG_SetValue(NULL, NULL, SHMSIZE, REG_DWORD,
-					  (u8 *)&shm_size, sizeof(shm_size));
+		initStatus = REG_SetValue(SHMSIZE, (u8 *)&shm_size,
+					  sizeof(shm_size));
 	} else {
 		initStatus = DSP_EINVALIDARG;
 		status = -1;
@@ -380,16 +376,16 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 	}
 
 	if (phys_mempool_base > 0x0) {
-		initStatus = REG_SetValue(NULL, NULL, PHYSMEMPOOLBASE,
-					 REG_DWORD, (u8 *)&phys_mempool_base,
+		initStatus = REG_SetValue(PHYSMEMPOOLBASE,
+					 (u8 *)&phys_mempool_base,
 					 sizeof(phys_mempool_base));
 	}
 	GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_base = 0x%x \n",
 		 phys_mempool_base);
 
 	if (phys_mempool_size > 0x0) {
-		initStatus = REG_SetValue(NULL, NULL, PHYSMEMPOOLSIZE,
-					 REG_DWORD, (u8 *)&phys_mempool_size,
+		initStatus = REG_SetValue(PHYSMEMPOOLSIZE,
+					 (u8 *)&phys_mempool_size,
 					 sizeof(phys_mempool_size));
 	}
 	GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_size = 0x%x\n",
@@ -398,12 +394,11 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 		MEM_ExtPhysPoolInit(phys_mempool_base, phys_mempool_size);
 	if (tc_wordswapon) {
 		GT_0trace(driverTrace, GT_7CLASS, "TC Word Swap is enabled\n");
-		REG_SetValue(NULL, NULL, TCWORDSWAP, REG_DWORD,
-			    (u8 *)&tc_wordswapon, sizeof(tc_wordswapon));
+		REG_SetValue(TCWORDSWAP, (u8 *)&tc_wordswapon,
+			    sizeof(tc_wordswapon));
 	} else {
 		GT_0trace(driverTrace, GT_7CLASS, "TC Word Swap is disabled\n");
-		REG_SetValue(NULL, NULL, TCWORDSWAP,
-			    REG_DWORD, (u8 *)&tc_wordswapon,
+		REG_SetValue(TCWORDSWAP, (u8 *)&tc_wordswapon,
 			    sizeof(tc_wordswapon));
 	}
 	if (DSP_SUCCEEDED(initStatus)) {
drivers/dsp/bridge/services/cfg.c +18 -31

109 lines not on this page · raw message

drivers/dsp/bridge/services/reg.c +8 -18
index a1f287d..9fa1979 100644
@@ -64,19 +64,15 @@ struct GT_Mask REG_debugMask = { NULL, NULL };	/* GT trace var. */
  *  Deletes a registry entry value.  NOTE:  A registry entry value is not the
  *  same as *  a registry key.
  */
-DSP_STATUS REG_DeleteValue(OPTIONAL IN HANDLE *phKey, IN CONST char *pstrSubkey,
-			   IN CONST char *pstrValue)
+DSP_STATUS REG_DeleteValue(IN CONST char *pstrValue)
 {
 	DSP_STATUS status;
-	DBC_Require(pstrSubkey && pstrValue);
-	DBC_Require(phKey == NULL);
-       DBC_Require(strlen(pstrSubkey) < REG_MAXREGPATHLENGTH);
+	DBC_Require(pstrValue);
        DBC_Require(strlen(pstrValue) < REG_MAXREGPATHLENGTH);
 
 	GT_0trace(REG_debugMask, GT_ENTER, "REG_DeleteValue: entered\n");
 
-	/*  Note that we don't use phKey */
-	if (regsupDeleteValue(pstrSubkey, pstrValue) == DSP_SOK)
+	if (regsupDeleteValue(pstrValue) == DSP_SOK)
 		status = DSP_SOK;
 	else
 		status = DSP_EFAIL;
@@ -90,7 +86,7 @@ DSP_STATUS REG_DeleteValue(OPTIONAL IN HANDLE *phKey, IN CONST char *pstrSubkey,
  *  We will assume the input pdwValueSize is smaller than
  *  REG_MAXREGPATHLENGTH for implementation purposes.
  */
-DSP_STATUS REG_EnumValue(IN HANDLE *phKey, IN u32 dwIndex,
+DSP_STATUS REG_EnumValue(IN u32 dwIndex,
 			 IN CONST char *pstrKey, IN OUT char *pstrValue,
 			 IN OUT u32 *pdwValueSize, IN OUT char *pstrData,
 			 IN OUT u32 *pdwDataSize)
@@ -100,7 +96,6 @@ DSP_STATUS REG_EnumValue(IN HANDLE *phKey, IN u32 dwIndex,
 	DBC_Require(pstrKey && pstrValue && pdwValueSize && pstrData &&
 		    pdwDataSize);
 	DBC_Require(*pdwValueSize <= REG_MAXREGPATHLENGTH);
-	DBC_Require(phKey == NULL);
        DBC_Require(strlen(pstrKey) < REG_MAXREGPATHLENGTH);
 
 	GT_0trace(REG_debugMask, GT_ENTER, "REG_EnumValue: entered\n");
@@ -126,15 +121,12 @@ void REG_Exit(void)
  *  ======== REG_GetValue ========
  *  Retrieve a value from the registry.
  */
-DSP_STATUS REG_GetValue(OPTIONAL IN HANDLE *phKey, IN CONST char *pstrSubkey,
-			IN CONST char *pstrValue, OUT u8 *pbData,
+DSP_STATUS REG_GetValue(IN CONST char *pstrValue, OUT u8 *pbData,
 			IN OUT u32 *pdwDataSize)
 {
 	DSP_STATUS status;
 
-	DBC_Require(pstrSubkey && pstrValue && pbData);
-	DBC_Require(phKey == NULL);
-       DBC_Require(strlen(pstrSubkey) < REG_MAXREGPATHLENGTH);
+	DBC_Require(pstrValue && pbData);
        DBC_Require(strlen(pstrValue) < REG_MAXREGPATHLENGTH);
 
 	GT_0trace(REG_debugMask, GT_ENTER, "REG_GetValue: entered\n");
@@ -171,14 +163,12 @@ bool REG_Init(void)
  *  ======== REG_SetValue ========
  *  Set a value in the registry.
  */
-DSP_STATUS REG_SetValue(OPTIONAL IN HANDLE *phKey, IN CONST char *pstrSubkey,
-			IN CONST char *pstrValue, IN CONST u32 dwType,
-			IN u8 *pbData, IN u32 dwDataSize)
+DSP_STATUS REG_SetValue(IN CONST char *pstrValue, IN u8 *pbData,
+			IN u32 dwDataSize)
 {
 	DSP_STATUS status;
 
 	DBC_Require(pstrValue && pbData);
-	DBC_Require(phKey == NULL);
 	DBC_Require(dwDataSize > 0);
        DBC_Require(strlen(pstrValue) < REG_MAXREGPATHLENGTH);
 
drivers/dsp/bridge/services/regsup.c +1 -2
index 8e19ad1..0527f41 100644
@@ -318,8 +318,7 @@ DSP_STATUS regsupEnumValue(IN u32 dwIndex, IN CONST char *pstrKey,
 /*
  *  ======== regsupDeleteValue ========
  */
-DSP_STATUS regsupDeleteValue(IN CONST char *pstrSubkey,
-			    IN CONST char *pstrValue)
+DSP_STATUS regsupDeleteValue(IN CONST char *pstrValue)
 {
 	DSP_STATUS retVal = DSP_EFAIL;
 	u32 i;
drivers/dsp/bridge/services/regsup.h +2 -2
index 011be52..c4d9c2d 100644
@@ -38,8 +38,8 @@ extern void regsupExit(void);
 /*
  *  ======== regsupDeleteValue ========
  */
-extern DSP_STATUS regsupDeleteValue(IN CONST char *pstrSubkey,
-				    IN CONST char *pstrValue);
+extern DSP_STATUS regsupDeleteValue(IN CONST char *pstrValue);
+
 /*  Get the value of the entry having the given name.  Returns DSP_SOK  */
 /*  if an entry was found and the value retrieved.  Returns DSP_EFAIL
  *  otherwise.*/
drivers/dsp/bridge/wmd/tiomap3430.c +2 -2
index fe18cf2..032bdb4 100644
@@ -1140,8 +1140,8 @@ static DSP_STATUS WMD_DEV_Create(OUT struct WMD_DEV_CONTEXT **ppDevContext,
 	if (DSP_SUCCEEDED(status)) {
 		/* Set the Endianism Register */ /* Need to set this */
 		/* Retrieve the TC u16 SWAP Option */
-		status = REG_GetValue(NULL, CURRENTCONFIG, TCWORDSWAP,
-				     (u8 *)&tcWordSwap, &tcWordSwapSize);
+		status = REG_GetValue(TCWORDSWAP, (u8 *)&tcWordSwap,
+				      &tcWordSwapSize);
 		/* Save the value */
 		pDevContext->tcWordSwapOn = tcWordSwap;
 	}
Signature · 1 line
1.5.6.5
#2 lore raw

PATCH 2/2 DSPBRIDGE: OSAL: Remove unused registry variables

From: Andy Shevchenko <[email protected]>

---
 arch/arm/plat-omap/include/dspbridge/dbreg.h |    3 ---
 drivers/dsp/bridge/rmgr/drv_interface.c      |   12 ------------
 drivers/dsp/bridge/services/cfg.c            |    5 -----
 3 files changed, 0 insertions(+), 20 deletions(-)
arch/arm/plat-omap/include/dspbridge/dbreg.h +0 -3
index d311b88..59b6496 100644
@@ -88,7 +88,6 @@
 #define WMDFILENAME      "MiniDriver"	/* WMD entry name */
 #define CHIPTYPE         "ChipType"	/* Chip type */
 #define CHIPNUM          "NumChips"	/* Number of chips */
-#define NUMPROCS         "NumOfProcessors"	/* Number of processors */
 #define DEFEXEC          "DefaultExecutable"	/* Default executable */
 #define AUTOSTART        "AutoStart"	/* Statically load flag */
 #define IVAAUTOSTART     "IvaAutoStart"	/* Statically load flag */
@@ -107,7 +106,5 @@
 #define TCWORDSWAP       "TCWordSwap"	/* Traffic Contoller Word Swap */
 #define DSPRESOURCES     "DspTMSResources"	/* C55 DSP resurces on OMAP */
 #define IVA1RESOURCES    "ARM7IvaResources"	/* ARM7 IVA resurces on OMAP */
-#define PHYSMEMPOOLBASE  "PhysicalMemBase"   /* Physical mem passed to driver */
-#define PHYSMEMPOOLSIZE  "PhysicalMemSize"   /* Physical mem passed to driver */
 
 #endif				/* DBREG_ */
drivers/dsp/bridge/rmgr/drv_interface.c +0 -12
index 6a540a9..2653c1f 100644
@@ -129,7 +129,6 @@ static s32 driver_major = DRIVER_MAJOR;
 static s32 driver_minor = DRIVER_MINOR;
 static char *base_img;
 char *iva_img;
-static char *num_procs = "C55=1";
 static s32 shm_size = 0x500000;	/* 5 MB */
 static u32 phys_mempool_base;
 static u32 phys_mempool_size;
@@ -356,7 +355,6 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 		REG_SetValue(AUTOSTART, (u8 *)&temp, sizeof(temp));
 		REG_SetValue(DEFEXEC, (u8 *) "\0", (u32)2);
 	}
-	REG_SetValue(NUMPROCS, (u8 *) num_procs, strlen(num_procs) + 1);
 
 	if (shm_size >= 0x10000) {	/* 64 KB */
 		initStatus = REG_SetValue(SHMSIZE, (u8 *)&shm_size,
@@ -375,19 +373,9 @@ static int __devinit omap34xx_bridge_probe(struct platform_device *pdev)
 		phys_mempool_size = pdata->phys_mempool_size;
 	}
 
-	if (phys_mempool_base > 0x0) {
-		initStatus = REG_SetValue(PHYSMEMPOOLBASE,
-					 (u8 *)&phys_mempool_base,
-					 sizeof(phys_mempool_base));
-	}
 	GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_base = 0x%x \n",
 		 phys_mempool_base);
 
-	if (phys_mempool_size > 0x0) {
-		initStatus = REG_SetValue(PHYSMEMPOOLSIZE,
-					 (u8 *)&phys_mempool_size,
-					 sizeof(phys_mempool_size));
-	}
 	GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_size = 0x%x\n",
 		 phys_mempool_base);
 	if ((phys_mempool_base > 0x0) && (phys_mempool_size > 0x0))
drivers/dsp/bridge/services/cfg.c +0 -5
index cb4ffea..e3cdda3 100644
@@ -413,11 +413,6 @@ DSP_STATUS CFG_SetDevObject(struct CFG_DEVNODE *hDevNode, u32 dwValue)
 				  "Registering the DSP Device \n");
 			status = REG_SetValue("DEVICE_DSP", (u8 *)&dwValue,
 					      dwBuffSize);
-			if (DSP_SUCCEEDED(status)) {
-				dwBuffSize = sizeof(hDevNode);
-				status = REG_SetValue("DEVNODESTRING_DSP",
-						(u8 *)&hDevNode, dwBuffSize);
-			}
 		} else {
 			GT_0trace(CFG_debugMask, GT_6CLASS,
 				  "Failed to Register Device \n");
Signature · 1 line
1.5.6.5