pnp_info("res: The PnP device '%s' is already active.", dev->dev.bus_id);
return -EBUSY;
}
- spin_lock(&pnp_lock); /* we lock just in case the device is being configured during this call */
- dev->active = 1;
- spin_unlock(&pnp_lock); /* once the device is claimed active we know it won't be configured so we can unlock */
-
/* If this condition is true, advanced configuration failed, we need to get this device up and running
* so we use the simple config engine which ignores cold conflicts, this of course may lead to new failures */
if (!pnp_is_active(dev)) {
goto fail;
}
}
+
+ spin_lock(&pnp_lock); /* we lock just in case the device is being configured during this call */
+ dev->active = 1;
+ spin_unlock(&pnp_lock); /* once the device is claimed active we know it won't be configured so we can unlock */
+
if (dev->config_mode & PNP_CONFIG_INVALID) {
pnp_info("res: Unable to activate the PnP device '%s' because its resource configuration is invalid.", dev->dev.bus_id);
goto fail;
/* check for cold conflicts */
pnp_for_each_dev(tdev) {
/* Is the device configurable? */
- if (tdev == dev || (mode ? !dev->active : dev->active))
+ if (tdev == dev || (mode ? !tdev->active : tdev->active))
continue;
for (tmp = 0; tmp < PNP_MAX_PORT; tmp++) {
if (tdev->res.port_resource[tmp].flags & IORESOURCE_IO) {
/* check for cold conflicts */
pnp_for_each_dev(tdev) {
/* Is the device configurable? */
- if (tdev == dev || (mode ? !dev->active : dev->active))
+ if (tdev == dev || (mode ? !tdev->active : tdev->active))
continue;
for (tmp = 0; tmp < PNP_MAX_MEM; tmp++) {
if (tdev->res.mem_resource[tmp].flags & IORESOURCE_MEM) {
/* check for cold conflicts */
pnp_for_each_dev(tdev) {
/* Is the device configurable? */
- if (tdev == dev || (mode ? !dev->active : dev->active))
+ if (tdev == dev || (mode ? !tdev->active : tdev->active))
continue;
for (tmp = 0; tmp < PNP_MAX_IRQ; tmp++) {
if (tdev->res.irq_resource[tmp].flags & IORESOURCE_IRQ) {
/* check for cold conflicts */
pnp_for_each_dev(tdev) {
/* Is the device configurable? */
- if (tdev == dev || (mode ? !dev->active : dev->active))
+ if (tdev == dev || (mode ? !tdev->active : tdev->active))
continue;
for (tmp = 0; tmp < PNP_MAX_DMA; tmp++) {
if (tdev->res.dma_resource[tmp].flags & IORESOURCE_DMA) {