From 8a89efd18aa15bb832778baa4e6eee3857ecada4 Mon Sep 17 00:00:00 2001 From: Drew Moseley Date: Sun, 28 Sep 2008 01:31:35 +0200 Subject: PNP: create device attributes via default device attributes This creates the attributes before the uevent is sent. Signed-off-by: Drew Moseley Acked-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/pnp/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pnp/base.h') diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 9fd7bb9b7dce..3532984a9cab 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h @@ -4,6 +4,7 @@ */ extern spinlock_t pnp_lock; +extern struct device_attribute pnp_interface_attrs[]; void *pnp_alloc(long size); int pnp_register_protocol(struct pnp_protocol *protocol); @@ -16,7 +17,6 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid); int pnp_add_device(struct pnp_dev *dev); struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id); -int pnp_interface_attach_device(struct pnp_dev *dev); int pnp_add_card(struct pnp_card *card); void pnp_remove_card(struct pnp_card *card); -- cgit v1.2.3-70-g09d2 From b563cf59c4d67da7d671788a9848416bfa4180ab Mon Sep 17 00:00:00 2001 From: Rene Herman Date: Wed, 15 Oct 2008 22:03:58 -0700 Subject: 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 Cc: "H. Peter Anvin" Acked-by: Bjorn Helgaas Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/base.h | 2 +- drivers/pnp/quirks.c | 2 +- drivers/pnp/resource.c | 4 ++-- include/linux/pnp.h | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/pnp/base.h') diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h index 9fd7bb9b7dce..7cc7bf5304aa 100644 --- a/drivers/pnp/base.h +++ b/drivers/pnp/base.h @@ -147,7 +147,7 @@ char *pnp_resource_type_name(struct resource *res); void dbg_pnp_show_resources(struct pnp_dev *dev, char *desc); void pnp_free_resources(struct pnp_dev *dev); -int pnp_resource_type(struct resource *res); +unsigned long pnp_resource_type(struct resource *res); struct pnp_resource { struct list_head list; diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 0bdf9b8a5e58..d15e2b77af88 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c @@ -245,7 +245,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev) */ for_each_pci_dev(pdev) { for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { - unsigned int type; + unsigned long type; type = pci_resource_flags(pdev, i) & (IORESOURCE_IO | IORESOURCE_MEM); diff --git a/drivers/pnp/resource.c b/drivers/pnp/resource.c index 4cfe3a1efdfb..dbae23acdd5b 100644 --- a/drivers/pnp/resource.c +++ b/drivers/pnp/resource.c @@ -467,14 +467,14 @@ int pnp_check_dma(struct pnp_dev *dev, struct resource *res) #endif } -int pnp_resource_type(struct resource *res) +unsigned long pnp_resource_type(struct resource *res) { return res->flags & (IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_IRQ | IORESOURCE_DMA); } struct resource *pnp_get_resource(struct pnp_dev *dev, - unsigned int type, unsigned int num) + unsigned long type, unsigned int num) { struct pnp_resource *pnp_res; struct resource *res; diff --git a/include/linux/pnp.h b/include/linux/pnp.h index be764e514e35..53b70fd1d9a5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -22,9 +22,11 @@ struct pnp_dev; * Resource Management */ #ifdef CONFIG_PNP -struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); +struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned long type, + unsigned int num); #else -static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num) +static inline struct resource *pnp_get_resource(struct pnp_dev *dev, + unsigned long type, unsigned int num) { return NULL; } -- cgit v1.2.3-70-g09d2