Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b66e0986 authored by Ernesto Ramos's avatar Ernesto Ramos Committed by Greg Kroah-Hartman
Browse files

staging:ti dspbridge: remove DSP_FAILED macro from rmgr



Since status succeeded is 0, DSP_FAILED macro
is not necessary anymore.

Signed-off-by: default avatarErnesto Ramos <ernesto@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 51d5e099
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ int dcd_create_manager(char *sz_zl_dll_name,
	DBC_REQUIRE(dcd_mgr);

	status = cod_create(&cod_mgr, sz_zl_dll_name, NULL);
	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	/* Create a DCD object. */
@@ -464,7 +464,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
	/* Open COFF file. */
	status = cod_open(dcd_mgr_obj->cod_mgr, dcd_key->path,
							COD_NOLOAD, &lib);
	if (DSP_FAILED(status)) {
	if (status) {
		status = -EACCES;
		goto func_end;
	}
@@ -480,7 +480,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,

	/* Get section information. */
	status = cod_get_section(lib, sz_sect_name, &ul_addr, &ul_len);
	if (DSP_FAILED(status)) {
	if (status) {
		status = -EACCES;
		goto func_end;
	}
@@ -513,7 +513,7 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,
		/* Parse the content of the COFF buffer. */
		status =
		    get_attrs_from_buf(psz_coff_buf, ul_len, obj_type, obj_def);
		if (DSP_FAILED(status))
		if (status)
			status = -EACCES;
	} else {
		status = -EACCES;
@@ -557,14 +557,14 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,

	/* Open DSP coff file, don't load symbols. */
	status = cod_open(dcd_mgr_obj->cod_mgr, sz_coff_path, COD_NOLOAD, &lib);
	if (DSP_FAILED(status)) {
	if (status) {
		status = -EACCES;
		goto func_cont;
	}

	/* Get DCD_RESIGER_SECTION section information. */
	status = cod_get_section(lib, DCD_REGISTER_SECTION, &ul_addr, &ul_len);
	if (DSP_FAILED(status) || !(ul_len > 0)) {
	if (status || !(ul_len > 0)) {
		status = -EACCES;
		goto func_cont;
	}
@@ -617,7 +617,7 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,
			 */
			status =
			    register_fxn(&dsp_uuid_obj, object_type, handle);
			if (DSP_FAILED(status)) {
			if (status) {
				/* if error occurs, break from while loop. */
				break;
			}
@@ -729,7 +729,7 @@ int dcd_get_library_name(struct dcd_manager *hdcd_mgr,
		status = -ENOKEY;

	/* If can't find, phases might be registered as generic LIBRARYTYPE */
	if (DSP_FAILED(status) && phase != NLDR_NOPHASE) {
	if (status && phase != NLDR_NOPHASE) {
		if (phase_split)
			*phase_split = false;

@@ -872,7 +872,7 @@ int dcd_register_object(struct dsp_uuid *uuid_obj,
			status = -EPERM;
	}

	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	/*
@@ -1449,14 +1449,14 @@ static int get_dep_lib_info(struct dcd_manager *hdcd_mgr,
		/* Get dependent library section information. */
		status = cod_get_section(lib, DEPLIBSECT, &ul_addr, &ul_len);

		if (DSP_FAILED(status)) {
		if (status) {
			/* Ok, no dependent libraries */
			ul_len = 0;
			status = 0;
		}
	}

	if (DSP_FAILED(status) || !(ul_len > 0))
	if (status || !(ul_len > 0))
		goto func_cont;

	/* Allocate zeroed buffer. */
@@ -1466,7 +1466,7 @@ static int get_dep_lib_info(struct dcd_manager *hdcd_mgr,

	/* Read section contents. */
	status = cod_read_section(lib, DEPLIBSECT, psz_coff_buf, ul_len);
	if (DSP_FAILED(status))
	if (status)
		goto func_cont;

	/* Compress and format DSP buffer to conform to PC format. */
+14 −14
Original line number Diff line number Diff line
@@ -121,12 +121,12 @@ int disp_create(struct disp_object **dispatch_obj,

	/* check device type and decide if streams or messag'ing is used for
	 * RMS/EDS */
	if (DSP_FAILED(status))
	if (status)
		goto func_cont;

	status = dev_get_dev_type(hdev_obj, &dev_type);

	if (DSP_FAILED(status))
	if (status)
		goto func_cont;

	if (dev_type != DSP_UNIT) {
@@ -168,7 +168,7 @@ int disp_create(struct disp_object **dispatch_obj,
	else
		delete_disp(disp_obj);

	DBC_ENSURE(((DSP_FAILED(status)) && ((*dispatch_obj == NULL))) ||
	DBC_ENSURE((status && *dispatch_obj == NULL) ||
				(!status && *dispatch_obj));
	return status;
}
@@ -284,7 +284,7 @@ int disp_node_create(struct disp_object *disp_obj,

	status = dev_get_dev_type(disp_obj->hdev_obj, &dev_type);

	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	if (dev_type != DSP_UNIT) {
@@ -377,7 +377,7 @@ int disp_node_create(struct disp_object *disp_obj,
		       node_msg_args.arg_length);
		total += dw_length;
	}
	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	/* If node is a task node, copy task create arguments into  buffer */
@@ -425,7 +425,7 @@ int disp_node_create(struct disp_object *disp_obj,
			/* Fill SIO defs and offsets */
			offset = sio_defs_offset;
			for (i = 0; i < task_arg_obj.num_inputs; i++) {
				if (DSP_FAILED(status))
				if (status)
					break;

				pdw_buf[sio_in_def_offset + i] =
@@ -467,7 +467,7 @@ int disp_node_create(struct disp_object *disp_obj,
			 * on the DSP-side
			 */
			status = (((rms_word *) (disp_obj->pbuf))[0]);
			if (DSP_FAILED(status))
			if (status < 0)
				dev_dbg(bridge, "%s: DSP-side failed: 0x%x\n",
					__func__, status);
		}
@@ -520,7 +520,7 @@ int disp_node_delete(struct disp_object *disp_obj,
				 * function on the DSP-side
				 */
				status = (((rms_word *) (disp_obj->pbuf))[0]);
				if (DSP_FAILED(status))
				if (status < 0)
					dev_dbg(bridge, "%s: DSP-side failed: "
						"0x%x\n", __func__, status);
			}
@@ -573,7 +573,7 @@ int disp_node_run(struct disp_object *disp_obj,
				 * function on the DSP-side
				 */
				status = (((rms_word *) (disp_obj->pbuf))[0]);
				if (DSP_FAILED(status))
				if (status < 0)
					dev_dbg(bridge, "%s: DSP-side failed: "
						"0x%x\n", __func__, status);
			}
@@ -603,7 +603,7 @@ static void delete_disp(struct disp_object *disp_obj)
			 * is invalid. */
			status = (*intf_fxns->pfn_chnl_close)
			    (disp_obj->chnl_from_dsp);
			if (DSP_FAILED(status)) {
			if (status) {
				dev_dbg(bridge, "%s: Failed to close channel "
					"from RMS: 0x%x\n", __func__, status);
			}
@@ -612,7 +612,7 @@ static void delete_disp(struct disp_object *disp_obj)
			status =
			    (*intf_fxns->pfn_chnl_close) (disp_obj->
							  chnl_to_dsp);
			if (DSP_FAILED(status)) {
			if (status) {
				dev_dbg(bridge, "%s: Failed to close channel to"
					" RMS: 0x%x\n", __func__, status);
			}
@@ -704,7 +704,7 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,
	/* Send the command */
	status = (*intf_fxns->pfn_chnl_add_io_req) (chnl_obj, pbuf, ul_bytes, 0,
						    0L, dw_arg);
	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	status =
@@ -718,14 +718,14 @@ static int send_message(struct disp_object *disp_obj, u32 timeout,
		}
	}
	/* Get the reply */
	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	chnl_obj = disp_obj->chnl_from_dsp;
	ul_bytes = REPLYSIZE;
	status = (*intf_fxns->pfn_chnl_add_io_req) (chnl_obj, pbuf, ul_bytes,
						    0, 0L, dw_arg);
	if (DSP_FAILED(status))
	if (status)
		goto func_end;

	status =
+4 −4
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ int drv_remove_all_dmm_res_elements(void *process_ctxt)
	list_for_each_entry_safe(map_obj, temp_map, &ctxt->dmm_map_list, link) {
		status = proc_un_map(ctxt->hprocessor,
				     (void *)map_obj->dsp_addr, ctxt);
		if (DSP_FAILED(status))
		if (status)
			pr_err("%s: proc_un_map failed!"
			       " status = 0x%xn", __func__, status);
	}
@@ -190,7 +190,7 @@ int drv_remove_all_dmm_res_elements(void *process_ctxt)
		status = proc_un_reserve_memory(ctxt->hprocessor, (void *)
						rsv_obj->dsp_reserved_addr,
						ctxt);
		if (DSP_FAILED(status))
		if (status)
			pr_err("%s: proc_un_reserve_memory failed!"
			       " status = 0x%xn", __func__, status);
	}
@@ -464,7 +464,7 @@ int drv_create(struct drv_object **drv_obj)
		kfree(pdrv_object);
	}

	DBC_ENSURE(DSP_FAILED(status) || pdrv_object);
	DBC_ENSURE(status || pdrv_object);
	return status;
}

@@ -767,7 +767,7 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg)

	DBC_ENSURE((!status && dev_node_strg != NULL &&
		    !LST_IS_EMPTY(pdrv_object->dev_node_string)) ||
		   (DSP_FAILED(status) && *dev_node_strg == 0));
		   (status && *dev_node_strg == 0));

	return status;
}
+4 −4
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ static void bridge_recover(struct work_struct *work)
	}
	dev = dev_get_first();
	dev_get_dev_node(dev, &dev_node);
	if (!dev_node || DSP_FAILED(proc_auto_start(dev_node, dev)))
	if (!dev_node || proc_auto_start(dev_node, dev))
		pr_err("DSP could not be restarted\n");
	recover = false;
	complete_all(&bridge_open_comp);
@@ -397,7 +397,7 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)
	void *hdrv_obj = NULL;

	status = cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT);
	if (DSP_FAILED(status))
	if (status)
		goto func_cont;

#ifdef CONFIG_TIDSPBRIDGE_DVFS
@@ -439,7 +439,7 @@ static int BRIDGE_SUSPEND(struct platform_device *pdev, pm_message_t state)
	u32 command = PWR_EMERGENCYDEEPSLEEP;

	status = pwr_sleep_dsp(command, time_out);
	if (DSP_FAILED(status))
	if (status)
		return -1;

	bridge_suspend_data.suspended = 1;
@@ -451,7 +451,7 @@ static int BRIDGE_RESUME(struct platform_device *pdev)
	u32 status;

	status = pwr_wake_dsp(time_out);
	if (DSP_FAILED(status))
	if (status)
		return -1;

	bridge_suspend_data.suspended = 0;
+4 −4
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ u32 dsp_init(u32 *init_status)
		goto func_cont;

	status = drv_create(&drv_obj);
	if (DSP_FAILED(status)) {
	if (status) {
		api_exit();
		goto func_cont;
	}
@@ -68,7 +68,7 @@ u32 dsp_init(u32 *init_status)
		/* Attempt to Start the Device */
		status = dev_start_device((struct cfg_devnode *)
					  device_node_string);
		if (DSP_FAILED(status))
		if (status)
			(void)drv_release_resources
			    ((u32) device_node_string, drv_obj);
	} else {
@@ -77,7 +77,7 @@ u32 dsp_init(u32 *init_status)
	}

	/* Unwind whatever was loaded */
	if (DSP_FAILED(status)) {
	if (status) {
		/* irrespective of the status of dev_remove_device we conitinue
		 * unloading. Get the Driver Object iterate through and remove.
		 * Reset the status to E_FAIL to avoid going through
@@ -106,7 +106,7 @@ u32 dsp_init(u32 *init_status)
		dev_dbg(bridge, "%s: Failed\n", __func__);
	}			/* End api_init_complete2 */
	DBC_ENSURE((!status && drv_obj != NULL) ||
		   (DSP_FAILED(status) && drv_obj == NULL));
		   (status && drv_obj == NULL));
	*init_status = status;
	/* Return the Driver Object */
	return (u32) drv_obj;
Loading