Re: 53052feb6 (PNP: remove pnp_mem_flags() as an lvalue) breaks my ALSA intel8x0 sound card regression

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bjorn Helgaas <bjorn.helgaas@...>
Cc: <torvalds@...>, <avuton@...>, <rene.herman@...>, <rene.herman@...>, <len.brown@...>, <linux-kernel@...>, <rjw@...>
Date: Monday, June 2, 2008 - 7:49 pm

On Mon, 2 Jun 2008 16:42:49 -0600
Bjorn Helgaas <bjorn.helgaas@hp.com> wrote:


This broke
pnp-replace-pnp_resource_table-with-dynamically-allocated-resources.patch:

***************
*** 80,91 ****
  		reserve_range(dev, res->start, res->end, 1);
  	}
  
- 	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++) {
- 		if (res->flags & IORESOURCE_UNSET)
- 			continue;
- 
  		reserve_range(dev, res->start, res->end, 0);
- 	}
  }
  
  static int system_pnp_probe(struct pnp_dev *dev,
--- 78,85 ----
  		reserve_range(dev, res->start, res->end, 1);
  	}
  
+ 	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++)
  		reserve_range(dev, res->start, res->end, 0);
  }
  
  static int system_pnp_probe(struct pnp_dev *dev,

Which I fixed thusly:

static void reserve_resources_of_dev(struct pnp_dev *dev)
{
	struct resource *res;
	int i;

	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_IO, i)); i++) {
		if (res->start == 0)
			continue;	/* disabled */
		if (res->start < 0x100)
			/*
			 * Below 0x100 is only standard PC hardware
			 * (pics, kbd, timer, dma, ...)
			 * We should not get resource conflicts there,
			 * and the kernel reserves these anyway
			 * (see arch/i386/kernel/setup.c).
			 * So, do nothing
			 */
			continue;
		if (res->end < res->start)
			continue;	/* invalid */

		reserve_range(dev, res->start, res->end, 1);
	}

	for (i = 0; (res = pnp_get_resource(dev, IORESOURCE_MEM, i)); i++)
		reserve_range(dev, res->start, res->end, 0);
}


Is it still correct?

Thanks.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: 53052feb6 (PNP: remove pnp_mem_flags() as an lvalue) bre..., Andrew Morton, (Mon Jun 2, 7:49 pm)