diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/platform.c | 18 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_mainstone.c | 1 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_sharpsl.c | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 17b5ece8f82..eb84d9d4464 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -160,6 +160,11 @@ static void platform_device_release(struct device *dev) * * Create a platform device object which can have other objects attached * to it, and which will have attached objects freed when it is released. + * + * This device will be marked as not supporting hotpluggable drivers; no + * device add/remove uevents will be generated. In the unusual case that + * the device isn't being dynamically allocated as a legacy "probe the + * hardware" driver, infrastructure code should reverse this marking. */ struct platform_device *platform_device_alloc(const char *name, unsigned int id) { @@ -172,6 +177,12 @@ struct platform_device *platform_device_alloc(const char *name, unsigned int id) pa->pdev.id = id; device_initialize(&pa->pdev.dev); pa->pdev.dev.release = platform_device_release; + + /* prevent hotplug "modprobe $(MODALIAS)" from causing trouble in + * legacy probe-the-hardware drivers, which don't properly split + * out device enumeration logic from drivers. + */ + pa->pdev.dev.uevent_suppress = 1; } return pa ? &pa->pdev : NULL; @@ -351,6 +362,13 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); * memory allocated for the device allows drivers using such devices * to be unloaded iwithout waiting for the last reference to the device * to be dropped. + * + * This interface is primarily intended for use with legacy drivers + * which probe hardware directly. Because such drivers create sysfs + * device nodes themselves, rather than letting system infrastructure + * handle such device enumeration tasks, they don't fully conform to + * the Linux driver model. In particular, when such drivers are built + * as modules, they can't be "hotplugged". */ struct platform_device *platform_device_register_simple(char *name, unsigned int id, struct resource *res, unsigned int num) diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c index fda06941e73..383107ba4bd 100644 --- a/drivers/pcmcia/pxa2xx_mainstone.c +++ b/drivers/pcmcia/pxa2xx_mainstone.c @@ -175,6 +175,7 @@ static int __init mst_pcmcia_init(void) if (!mst_pcmcia_device) return -ENOMEM; + mst_pcmcia_device->dev.uevent_suppress = 0; mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops; ret = platform_device_add(mst_pcmcia_device); diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index b7b9e149c5b..a2daa3f531b 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -261,6 +261,7 @@ static int __init sharpsl_pcmcia_init(void) if (!sharpsl_pcmcia_device) return -ENOMEM; + sharpsl_pcmcia_device->dev.uevent_suppress = 0; sharpsl_pcmcia_device->dev.platform_data = &sharpsl_pcmcia_ops; sharpsl_pcmcia_device->dev.parent = platform_scoop_config->devs[0].dev; |