Commit 8af28932 authored by C A Subramaniam's avatar C A Subramaniam Committed by Hari Kanigeri

SYSLINK NOTIFY Patch to cleanup notify_ducati module

Added the following changes
	- Removed array that was used to track ducati
	  driver objects.
	- Removed array introduced in syslink 2-0-0-12
	  migration to track notify driver.
	- Introduced a list implementation for tracking
	  notify objects.
	- Removed the index variable introduced in syslink
	  2-0-0-12 migration.
	- Re-organized notify_ducatidrv_create() function
	  call.
	- Added support for multiple creates to be called
	  with same driver name.
Signed-off-by: default avatarC A Subramaniam <subramaniam.ca@ti.com>
parent 985a9df8
...@@ -394,7 +394,6 @@ struct notify_driver_object { ...@@ -394,7 +394,6 @@ struct notify_driver_object {
struct notify_driver_attrs attrs; struct notify_driver_attrs attrs;
u32 *disable_flag[NOTIFY_MAXNESTDEPTH]; u32 *disable_flag[NOTIFY_MAXNESTDEPTH];
void *driver_object; void *driver_object;
int index;
}; };
......
...@@ -69,14 +69,13 @@ int notify_register_driver(char *driver_name, ...@@ -69,14 +69,13 @@ int notify_register_driver(char *driver_name,
if (strncmp(driver_name, drv_handle->name, if (strncmp(driver_name, drv_handle->name,
NOTIFY_MAX_NAMELEN) == 0) { NOTIFY_MAX_NAMELEN) == 0) {
status = NOTIFY_E_ALREADYEXISTS; status = NOTIFY_E_ALREADYEXISTS;
break; goto return_existing_handle;
} }
} }
if (drv_handle->is_init == NOTIFY_DRIVERINITSTATUS_NOTDONE) { if (drv_handle->is_init == NOTIFY_DRIVERINITSTATUS_NOTDONE) {
/* Found an empty slot, so block it. */ /* Found an empty slot, so block it. */
drv_handle->is_init = drv_handle->is_init =
NOTIFY_DRIVERINITSTATUS_INPROGRESS; NOTIFY_DRIVERINITSTATUS_INPROGRESS;
drv_handle->index = i;
status = NOTIFY_SUCCESS; status = NOTIFY_SUCCESS;
break; break;
} }
...@@ -91,6 +90,8 @@ int notify_register_driver(char *driver_name, ...@@ -91,6 +90,8 @@ int notify_register_driver(char *driver_name,
memcpy(&(drv_handle->fn_table), fn_table, memcpy(&(drv_handle->fn_table), fn_table,
sizeof(struct notify_interface)); sizeof(struct notify_interface));
drv_handle->driver_object = NULL; drv_handle->driver_object = NULL;
return_existing_handle:
/*is_setup is set when driverInit is called. */ /*is_setup is set when driverInit is called. */
*driver_handle = drv_handle; *driver_handle = drv_handle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment