Commit d8e026a4 authored by Laurentiu Tudor's avatar Laurentiu Tudor Committed by Greg Kroah-Hartman
Browse files

staging: fsl-mc: remove some superfluous WARN_ONs



These WARN_ONs shouldn't trigger unless something went very wrong.
Since the driver is in a stable state let's remove these debug
WARN_ONs.

Signed-off-by: default avatarLaurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 53639c64
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)
	struct fsl_mc_child_objs *objs;
	struct fsl_mc_device *mc_dev;

	WARN_ON(!dev);
	WARN_ON(!data);
	mc_dev = to_fsl_mc_device(dev);
	objs = data;

@@ -60,8 +58,6 @@ static int __fsl_mc_device_remove_if_not_in_mc(struct device *dev, void *data)

static int __fsl_mc_device_remove(struct device *dev, void *data)
{
	WARN_ON(!dev);
	WARN_ON(data);
	fsl_mc_device_remove(to_fsl_mc_device(dev));
	return 0;
}
@@ -453,8 +449,6 @@ static int disable_dprc_irq(struct fsl_mc_device *mc_dev)
	int error;
	struct fsl_mc_io *mc_io = mc_dev->mc_io;

	WARN_ON(mc_dev->obj_desc.irq_count != 1);

	/*
	 * Disable generation of interrupt, while we configure it:
	 */
@@ -496,8 +490,6 @@ static int register_dprc_irq_handler(struct fsl_mc_device *mc_dev)
	int error;
	struct fsl_mc_device_irq *irq = mc_dev->irqs[0];

	WARN_ON(mc_dev->obj_desc.irq_count != 1);

	/*
	 * NOTE: devm_request_threaded_irq() invokes the device-specific
	 * function that programs the MSI physically in the device
+0 −10
Original line number Diff line number Diff line
@@ -199,7 +199,6 @@ int __must_check fsl_mc_resource_allocate(struct fsl_mc_bus *mc_bus,
					    struct fsl_mc_resource, node);

	if (!resource) {
		WARN_ON(res_pool->free_count != 0);
		error = -ENXIO;
		dev_err(&mc_bus_dev->dev,
			"No more resources of type %s left\n",
@@ -474,7 +473,6 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
		irqs[i] = to_fsl_mc_irq(resource);
		res_allocated_count++;

		WARN_ON(irqs[i]->mc_dev);
		irqs[i]->mc_dev = mc_dev;
		irqs[i]->dev_irq_index = i;
	}
@@ -516,7 +514,6 @@ void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev)
		return;

	for (i = 0; i < irq_count; i++) {
		WARN_ON(!irqs[i]->mc_dev);
		irqs[i]->mc_dev = NULL;
		fsl_mc_resource_free(&irqs[i]->resource);
	}
@@ -553,17 +550,10 @@ static void fsl_mc_cleanup_resource_pool(struct fsl_mc_device *mc_bus_dev,
					&mc_bus->resource_pools[pool_type];
	int free_count = 0;

	WARN_ON(res_pool->type != pool_type);
	WARN_ON(res_pool->free_count != res_pool->max_count);

	list_for_each_entry_safe(resource, next, &res_pool->free_list, node) {
		free_count++;
		WARN_ON(resource->type != res_pool->type);
		WARN_ON(resource->parent_pool != res_pool);
		devm_kfree(&mc_bus_dev->dev, resource);
	}

	WARN_ON(free_count != res_pool->free_count);
}

void fsl_mc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
+0 −12
Original line number Diff line number Diff line
@@ -162,12 +162,7 @@ static int fsl_mc_driver_probe(struct device *dev)
	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
	int error;

	if (WARN_ON(!dev->driver))
		return -EINVAL;

	mc_drv = to_fsl_mc_driver(dev->driver);
	if (WARN_ON(!mc_drv->probe))
		return -EINVAL;

	error = mc_drv->probe(mc_dev);
	if (error < 0) {
@@ -184,9 +179,6 @@ static int fsl_mc_driver_remove(struct device *dev)
	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
	int error;

	if (WARN_ON(!dev->driver))
		return -EINVAL;

	error = mc_drv->remove(mc_dev);
	if (error < 0) {
		dev_err(dev, "%s failed: %d\n", __func__, error);
@@ -352,8 +344,6 @@ static int translate_mc_addr(struct fsl_mc_device *mc_dev,
	struct fsl_mc *mc;

	fsl_mc_get_root_dprc(&mc_dev->dev, &root_dprc_dev);
	if (WARN_ON(!root_dprc_dev))
		return -EINVAL;
	mc = dev_get_drvdata(root_dprc_dev->parent);

	if (mc->num_translation_ranges == 0) {
@@ -401,7 +391,6 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev,
		 * type, as this object type is not supposed to have MMIO
		 * regions
		 */
		WARN_ON(true);
		return -EINVAL;
	}

@@ -424,7 +413,6 @@ static int fsl_mc_device_get_mmio_regions(struct fsl_mc_device *mc_dev,
			goto error_cleanup_regions;
		}

		WARN_ON(region_desc.size == 0);
		error = translate_mc_addr(mc_dev, mc_region_type,
					  region_desc.base_offset,
					  &regions[i].start);
+0 −1
Original line number Diff line number Diff line
@@ -124,7 +124,6 @@ static void fsl_mc_msi_write_msg(struct irq_data *irq_data,
	struct fsl_mc_device_irq *mc_dev_irq =
		&mc_bus->irq_resources[msi_desc->fsl_mc.msi_index];

	WARN_ON(mc_dev_irq->msi_desc != msi_desc);
	msi_desc->msg = *msg;

	/*
+0 −3
Original line number Diff line number Diff line
@@ -93,9 +93,6 @@ int __init its_fsl_mc_msi_init(void)
			continue;
		}

		WARN_ON(mc_msi_domain->host_data !=
			&its_fsl_mc_msi_domain_info);

		pr_info("fsl-mc MSI: %pOF domain created\n", np);
	}

Loading