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

Commit f4490002 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown
Browse files

PNP: add pnp_init_resources(struct pnp_dev *) interface



Add pnp_init_resources(struct pnp_dev *) to replace
pnp_init_resource_table(), which takes a pointer to the
pnp_resource_table itself.  Passing only the pnp_dev * reduces
the possibility for error in the caller and removes the
pnp_resource_table implementation detail from the interface.

Even though pnp_init_resource_table() is exported, I did not
export pnp_init_resources() because it is used only by the PNP
core.

Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Acked-By: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 81b5c75f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -351,14 +351,14 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
	if (!strnicmp(buf, "auto", 4)) {
		if (dev->active)
			goto done;
		pnp_init_resource_table(&dev->res);
		pnp_init_resources(dev);
		retval = pnp_auto_config_dev(dev);
		goto done;
	}
	if (!strnicmp(buf, "clear", 5)) {
		if (dev->active)
			goto done;
		pnp_init_resource_table(&dev->res);
		pnp_init_resources(dev);
		goto done;
	}
	if (!strnicmp(buf, "get", 3)) {
@@ -373,7 +373,7 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
		if (dev->active)
			goto done;
		buf += 3;
		pnp_init_resource_table(&dev->res);
		pnp_init_resources(dev);
		mutex_lock(&pnp_res_mutex);
		while (1) {
			while (isspace(*buf))
+2 −2
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ static struct pnp_dev *__init isapnp_parse_device(struct pnp_card *card,
	dev->capabilities |= PNP_READ;
	dev->capabilities |= PNP_WRITE;
	dev->capabilities |= PNP_DISABLE;
	pnp_init_resource_table(&dev->res);
	pnp_init_resources(dev);
	return dev;
}

@@ -981,7 +981,7 @@ static int isapnp_get_resources(struct pnp_dev *dev)
	int ret;

	dev_dbg(&dev->dev, "get resources\n");
	pnp_init_resource_table(&dev->res);
	pnp_init_resources(dev);
	isapnp_cfg_begin(dev->card->number, dev->number);
	ret = isapnp_read_resources(dev);
	isapnp_cfg_end();
+5 −0
Original line number Diff line number Diff line
@@ -272,6 +272,11 @@ void pnp_init_resource_table(struct pnp_resource_table *table)
	}
}

void pnp_init_resources(struct pnp_dev *dev)
{
	pnp_init_resource_table(&dev->res);
}

/**
 * pnp_clean_resources - clears resources that were not manually set
 * @res: the resources to clean
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)

	/* clear out the damaged flags */
	if (!dev->active)
		pnp_init_resource_table(&dev->res);
		pnp_init_resources(dev);
	pnp_add_device(dev);
	num++;

+1 −2
Original line number Diff line number Diff line
@@ -410,8 +410,7 @@ acpi_status pnpacpi_parse_allocated_resource(struct pnp_dev *dev)

	dev_dbg(&dev->dev, "parse allocated resources\n");

	/* Blank the resource table values */
	pnp_init_resource_table(&dev->res);
	pnp_init_resources(dev);

	return acpi_walk_resources(handle, METHOD_NAME__CRS,
				   pnpacpi_allocated_resource, dev);
Loading