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

Commit 73b87a91 authored by Ivan Gomez Castellanos's avatar Ivan Gomez Castellanos Committed by Greg Kroah-Hartman
Browse files

staging: tidspbridge: Remove cfg_get_object()



As the services directory is going to be removed, the cfg_get_object
function has also to be removed.

Since the driver object handle is retrieved from the drv_data structure,
then the word "Registry" is replaced by "driver data" in the comments.

Also, the hdrv_obj is not used in function omap34_xx_bridge_remove(), so
it is removed.

Signed-off-by: default avatarIvan Gomez Castellanos <ivan.gomez@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 315a1a20
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -40,23 +40,6 @@
 */
extern int cfg_get_cd_version(u32 *version);

/*
 *  ======== cfg_get_object ========
 *  Purpose:
 *      Retrieve the Driver Object handle From the Registry
 *  Parameters:
 *      value:      Ptr to location to store the value.
 *      dw_type      Type of Object to Get
 *  Returns:
 *      0:    Success.
 *  Requires:
 *      CFG initialized.
 *  Ensures:
 *      0:    *value is set to the retrieved u32(non-Zero).
 *      else:       *value is set to 0L.
 */
extern int cfg_get_object(u32 *value, u8 dw_type);

/*
 *  ======== cfg_get_perf_value ========
 *  Purpose:
+8 −2
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ int dev_create_device(struct dev_object **device_obj,
	struct io_attrs io_mgr_attrs;
	u32 num_windows;
	struct drv_object *hdrv_obj = NULL;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);
	int status = 0;
	DBC_REQUIRE(refs > 0);
	DBC_REQUIRE(device_obj != NULL);
@@ -163,10 +164,15 @@ int dev_create_device(struct dev_object **device_obj,

	/*  Get the Bridge driver interface functions */
	bridge_drv_entry(&drv_fxns, driver_file_name);
	if (cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT)) {
		/* don't propogate CFG errors from this PROC function */

	/* Retrieve the Object handle from the driver data */
	if (drv_datap && drv_datap->drv_object) {
		hdrv_obj = drv_datap->drv_object;
	} else {
		status = -EPERM;
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	/* Create the device object, and pass a handle to the Bridge driver for
	 * storage. */
	if (!status) {
+27 −7
Original line number Diff line number Diff line
@@ -438,11 +438,15 @@ u32 drv_get_first_dev_object(void)
{
	u32 dw_dev_object = 0;
	struct drv_object *pdrv_obj;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {
	if (drv_datap && drv_datap->drv_object) {
		pdrv_obj = drv_datap->drv_object;
		if ((pdrv_obj->dev_list != NULL) &&
		    !LST_IS_EMPTY(pdrv_obj->dev_list))
			dw_dev_object = (u32) lst_first(pdrv_obj->dev_list);
	} else {
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	return dw_dev_object;
@@ -458,14 +462,17 @@ u32 drv_get_first_dev_extension(void)
{
	u32 dw_dev_extension = 0;
	struct drv_object *pdrv_obj;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {

	if (drv_datap && drv_datap->drv_object) {
		pdrv_obj = drv_datap->drv_object;
		if ((pdrv_obj->dev_node_string != NULL) &&
		    !LST_IS_EMPTY(pdrv_obj->dev_node_string)) {
			dw_dev_extension =
			    (u32) lst_first(pdrv_obj->dev_node_string);
		}
	} else {
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	return dw_dev_extension;
@@ -482,18 +489,22 @@ u32 drv_get_next_dev_object(u32 hdev_obj)
{
	u32 dw_next_dev_object = 0;
	struct drv_object *pdrv_obj;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	DBC_REQUIRE(hdev_obj != 0);

	if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {

	if (drv_datap && drv_datap->drv_object) {
		pdrv_obj = drv_datap->drv_object;
		if ((pdrv_obj->dev_list != NULL) &&
		    !LST_IS_EMPTY(pdrv_obj->dev_list)) {
			dw_next_dev_object = (u32) lst_next(pdrv_obj->dev_list,
							    (struct list_head *)
							    hdev_obj);
		}
	} else {
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	return dw_next_dev_object;
}

@@ -509,16 +520,20 @@ u32 drv_get_next_dev_extension(u32 dev_extension)
{
	u32 dw_dev_extension = 0;
	struct drv_object *pdrv_obj;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	DBC_REQUIRE(dev_extension != 0);

	if (!cfg_get_object((u32 *) &pdrv_obj, REG_DRV_OBJECT)) {
	if (drv_datap && drv_datap->drv_object) {
		pdrv_obj = drv_datap->drv_object;
		if ((pdrv_obj->dev_node_string != NULL) &&
		    !LST_IS_EMPTY(pdrv_obj->dev_node_string)) {
			dw_dev_extension =
			    (u32) lst_next(pdrv_obj->dev_node_string,
					   (struct list_head *)dev_extension);
		}
	} else {
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	return dw_dev_extension;
@@ -616,6 +631,7 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg)
	int status = 0;
	struct drv_object *pdrv_object;
	struct drv_ext *pszdev_node;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	DBC_REQUIRE(dw_context != 0);
	DBC_REQUIRE(dev_node_strg != NULL);
@@ -626,7 +642,11 @@ int drv_request_resources(u32 dw_context, u32 *dev_node_strg)
	 *  list.
	 */

	status = cfg_get_object((u32 *) &pdrv_object, REG_DRV_OBJECT);
	if (!drv_datap || !drv_datap->drv_object)
		status = -ENODATA;
	else
		pdrv_object = drv_datap->drv_object;

	if (!status) {
		pszdev_node = kzalloc(sizeof(struct drv_ext), GFP_KERNEL);
		if (pszdev_node) {
+6 −3
Original line number Diff line number Diff line
@@ -394,11 +394,14 @@ static int __devexit omap34_xx_bridge_remove(struct platform_device *pdev)
	dev_t devno;
	bool ret;
	int status = 0;
	void *hdrv_obj = NULL;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	status = cfg_get_object((u32 *) &hdrv_obj, REG_DRV_OBJECT);
	if (status)
	/* Retrieve the Object handle from the driver data */
	if (!drv_datap || !drv_datap->drv_object) {
		status = -ENODATA;
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
		goto func_cont;
	}

#ifdef CONFIG_TIDSPBRIDGE_DVFS
	if (cpufreq_unregister_notifier(&iva_clk_notifier,
+7 −2
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ bool dsp_deinit(u32 device_context)
	bool ret = true;
	u32 device_node;
	struct mgr_object *mgr_obj = NULL;
	struct drv_data *drv_datap = dev_get_drvdata(bridge);

	while ((device_node = drv_get_first_dev_extension()) != 0) {
		(void)dev_remove_device((struct cfg_devnode *)device_node);
@@ -131,10 +132,14 @@ bool dsp_deinit(u32 device_context)

	(void)drv_destroy((struct drv_object *)device_context);

	/* Get the Manager Object from Registry
	/* Get the Manager Object from driver data
	 * MGR Destroy will unload the DCD dll */
	if (!cfg_get_object((u32 *) &mgr_obj, REG_MGR_OBJECT))
	if (drv_datap && drv_datap->mgr_object) {
		mgr_obj = drv_datap->mgr_object;
		(void)mgr_destroy(mgr_obj);
	} else {
		pr_err("%s: Failed to retrieve the object handle\n", __func__);
	}

	api_exit();

Loading