Skip to content

Commit b563cf5

Browse files
Rene Hermantorvalds
authored andcommitted
pnp: make the resource type an unsigned long
PnP encodes the resource type directly as its struct resource->flags value which is an unsigned long. Make it so... Signed-off-by: Rene Herman <rene.herman@gmail.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Andi Kleen <andi@firstfloor.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a63cc18 commit b563cf5

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎drivers/pnp/base.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ char *pnp_resource_type_name(struct resource *res);
147147
void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc);
148148

149149
void pnp_free_resources(struct pnp_dev *dev);
150-
int pnp_resource_type(struct resource *res);
150+
unsigned long pnp_resource_type(struct resource *res);
151151

152152
struct pnp_resource {
153153
struct list_head list;

‎drivers/pnp/quirks.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
245245
*/
246246
for_each_pci_dev(pdev) {
247247
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
248-
unsigned int type;
248+
unsigned long type;
249249

250250
type = pci_resource_flags(pdev, i) &
251251
(IORESOURCE_IO | IORESOURCE_MEM);

‎drivers/pnp/resource.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,14 +467,14 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res)
467467
#endif
468468
}
469469

470-
int pnp_resource_type(struct resource *res)
470+
unsigned long pnp_resource_type(struct resource *res)
471471
{
472472
return res->flags & (IORESOURCE_IO | IORESOURCE_MEM |
473473
IORESOURCE_IRQ | IORESOURCE_DMA);
474474
}
475475

476476
struct resource *pnp_get_resource(struct pnp_dev *dev,
477-
unsigned int type, unsigned int num)
477+
unsigned long type, unsigned int num)
478478
{
479479
struct pnp_resource *pnp_res;
480480
struct resource *res;

‎include/linux/pnp.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ struct pnp_dev;
2222
* Resource Management
2323
*/
2424
#ifdef CONFIG_PNP
25-
struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);
25+
struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type,
26+
unsigned int num);
2627
#else
27-
static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num)
28+
static inline struct resource *pnp_get_resource(struct pnp_dev *dev,
29+
unsigned long type, unsigned int num)
2830
{
2931
return NULL;
3032
}

0 commit comments

Comments
 (0)