summaryrefslogtreecommitdiff
path: root/drivers/pnp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/base.h4
-rw-r--r--drivers/pnp/card.c32
-rw-r--r--drivers/pnp/core.c16
-rw-r--r--drivers/pnp/driver.c19
-rw-r--r--drivers/pnp/isapnp/core.c4
-rw-r--r--drivers/pnp/quirks.c2
6 files changed, 23 insertions, 54 deletions
diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h
index 4e80273dfb1e..b342570d0236 100644
--- a/drivers/pnp/base.h
+++ b/drivers/pnp/base.h
@@ -9,7 +9,6 @@ extern const struct attribute_group *pnp_dev_groups[];
extern const struct bus_type pnp_bus_type;
int pnp_register_protocol(struct pnp_protocol *protocol);
-void pnp_unregister_protocol(struct pnp_protocol *protocol);
#define PNP_EISA_ID_MASK 0x7fffffff
void pnp_eisa_id_to_string(u32 id, char *str);
@@ -21,9 +20,7 @@ int pnp_add_device(struct pnp_dev *dev);
struct pnp_id *pnp_add_id(struct pnp_dev *dev, const char *id);
int pnp_add_card(struct pnp_card *card);
-void pnp_remove_card(struct pnp_card *card);
int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
-void pnp_remove_card_device(struct pnp_dev *dev);
struct pnp_port {
resource_size_t min; /* min base number */
@@ -138,7 +135,6 @@ void pnp_init_resources(struct pnp_dev *dev);
void pnp_fixup_device(struct pnp_dev *dev);
void pnp_free_options(struct pnp_dev *dev);
int __pnp_add_device(struct pnp_dev *dev);
-void __pnp_remove_device(struct pnp_dev *dev);
int pnp_check_port(struct pnp_dev *dev, struct resource *res);
int pnp_check_mem(struct pnp_dev *dev, struct resource *res);
diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c
index 9610a9f08ff4..c7596dc24fbd 100644
--- a/drivers/pnp/card.c
+++ b/drivers/pnp/card.c
@@ -270,25 +270,6 @@ int pnp_add_card(struct pnp_card *card)
}
/**
- * pnp_remove_card - removes a PnP card from the PnP Layer
- * @card: pointer to the card to remove
- */
-void pnp_remove_card(struct pnp_card *card)
-{
- struct list_head *pos, *temp;
-
- device_unregister(&card->dev);
- mutex_lock(&pnp_lock);
- list_del(&card->global_list);
- list_del(&card->protocol_list);
- mutex_unlock(&pnp_lock);
- list_for_each_safe(pos, temp, &card->devices) {
- struct pnp_dev *dev = card_to_pnp_dev(pos);
- pnp_remove_card_device(dev);
- }
-}
-
-/**
* pnp_add_card_device - adds a device to the specified card
* @card: pointer to the card to add to
* @dev: pointer to the device to add
@@ -307,19 +288,6 @@ int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev)
}
/**
- * pnp_remove_card_device- removes a device from the specified card
- * @dev: pointer to the device to remove
- */
-void pnp_remove_card_device(struct pnp_dev *dev)
-{
- mutex_lock(&pnp_lock);
- dev->card = NULL;
- list_del(&dev->card_list);
- mutex_unlock(&pnp_lock);
- __pnp_remove_device(dev);
-}
-
-/**
* pnp_request_card_device - Searches for a PnP device under the specified card
* @clink: pointer to the card link, cannot be NULL
* @id: pointer to a PnP ID structure that explains the rules for finding the device
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 6a60c5d83383..ac48db6dcfe3 100644
--- a/drivers/pnp/core.c
+++ b/drivers/pnp/core.c
@@ -78,16 +78,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
return ret;
}
-/**
- * pnp_unregister_protocol - removes a pnp protocol from the pnp layer
- * @protocol: pointer to the corresponding pnp_protocol structure
- */
-void pnp_unregister_protocol(struct pnp_protocol *protocol)
-{
- pnp_remove_protocol(protocol);
- device_unregister(&protocol->dev);
-}
-
static void pnp_free_ids(struct pnp_dev *dev)
{
struct pnp_id *id;
@@ -220,12 +210,6 @@ int pnp_add_device(struct pnp_dev *dev)
return 0;
}
-void __pnp_remove_device(struct pnp_dev *dev)
-{
- pnp_delist_device(dev);
- device_unregister(&dev->dev);
-}
-
static int __init pnp_init(void)
{
return bus_register(&pnp_bus_type);
diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
index 7de7aabb275e..05e9840bc3d4 100644
--- a/drivers/pnp/driver.c
+++ b/drivers/pnp/driver.c
@@ -150,6 +150,24 @@ static void pnp_device_shutdown(struct device *dev)
drv->shutdown(pnp_dev);
}
+static int pnp_uevent(const struct device *dev, struct kobj_uevent_env *env)
+{
+ struct pnp_id *pos;
+ const struct pnp_dev *pnp_dev = to_pnp_dev(dev);
+
+ if (!dev)
+ return -ENODEV;
+
+ pos = pnp_dev->id;
+ while (pos) {
+ if (add_uevent_var(env, "MODALIAS=pnp:d%s", pos->id))
+ return -ENOMEM;
+ pos = pos->next;
+ }
+
+ return 0;
+}
+
static int pnp_bus_match(struct device *dev, const struct device_driver *drv)
{
struct pnp_dev *pnp_dev = to_pnp_dev(dev);
@@ -259,6 +277,7 @@ static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
const struct bus_type pnp_bus_type = {
.name = "pnp",
.match = pnp_bus_match,
+ .uevent = pnp_uevent,
.probe = pnp_device_probe,
.remove = pnp_device_remove,
.shutdown = pnp_device_shutdown,
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index c43d8ad02529..219f96f2aaaf 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -27,6 +27,7 @@
#include <linux/init.h>
#include <linux/isapnp.h>
#include <linux/mutex.h>
+#include <linux/string_choices.h>
#include <asm/io.h>
#include "../base.h"
@@ -843,6 +844,7 @@ EXPORT_SYMBOL(isapnp_protocol);
EXPORT_SYMBOL(isapnp_present);
EXPORT_SYMBOL(isapnp_cfg_begin);
EXPORT_SYMBOL(isapnp_cfg_end);
+EXPORT_SYMBOL(isapnp_read_byte);
EXPORT_SYMBOL(isapnp_write_byte);
static int isapnp_get_resources(struct pnp_dev *dev)
@@ -1036,7 +1038,7 @@ static int __init isapnp_init(void)
if (cards)
printk(KERN_INFO
"isapnp: %i Plug & Play card%s detected total\n", cards,
- cards > 1 ? "s" : "");
+ str_plural(cards));
else
printk(KERN_INFO "isapnp: No Plug & Play card found\n");
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 6085a1471de2..6e1d4bfd28ac 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -290,7 +290,7 @@ static void quirk_system_pci_resources(struct pnp_dev *dev)
#ifdef CONFIG_AMD_NB
-#include <asm/amd_nb.h>
+#include <asm/amd/nb.h>
static void quirk_amd_mmconfig_area(struct pnp_dev *dev)
{