aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-10-31 15:15:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-10-31 15:15:28 -0400
commita9fd74cb5843d8b2e44fb42f792766649ad24bfc (patch)
tree6a00601b476e6e8e4c3fbfef2635bc93a0f10ee7 /drivers
parent7d531a7e519406c4bb2501a66e3da5ba39280739 (diff)
parent657348a056eea4a27be20cf8e22c98a252597447 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: Documentation: ABI: /sys/devices/system/cpu/cpu#/node Documentation: ABI: /sys/devices/system/cpu/cpuidle/ Documentation: ABI: /sys/devices/system/cpu/sched_[mc|smt]_power_savings Documentation: ABI: /sys/devices/system/cpu/cpu#/ topology files Documentation: ABI: /sys/devices/system/cpu/ topology files Documentation: ABI: document /sys/devices/system/cpu/ Documentation: ABI: rename sysfs-devices-cache_disable properly Driver core: allow certain drivers prohibit bind/unbind via sysfs Driver core: fix driver_register() return value
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/bus.c17
-rw-r--r--drivers/base/driver.c2
-rw-r--r--drivers/base/platform.c6
3 files changed, 17 insertions, 8 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 973bf2ad4e0..63c143e54a5 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -689,15 +689,19 @@ int bus_add_driver(struct device_driver *drv)
689 printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n", 689 printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
690 __func__, drv->name); 690 __func__, drv->name);
691 } 691 }
692 error = add_bind_files(drv); 692
693 if (error) { 693 if (!drv->suppress_bind_attrs) {
694 /* Ditto */ 694 error = add_bind_files(drv);
695 printk(KERN_ERR "%s: add_bind_files(%s) failed\n", 695 if (error) {
696 __func__, drv->name); 696 /* Ditto */
697 printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
698 __func__, drv->name);
699 }
697 } 700 }
698 701
699 kobject_uevent(&priv->kobj, KOBJ_ADD); 702 kobject_uevent(&priv->kobj, KOBJ_ADD);
700 return 0; 703 return 0;
704
701out_unregister: 705out_unregister:
702 kfree(drv->p); 706 kfree(drv->p);
703 drv->p = NULL; 707 drv->p = NULL;
@@ -720,7 +724,8 @@ void bus_remove_driver(struct device_driver *drv)
720 if (!drv->bus) 724 if (!drv->bus)
721 return; 725 return;
722 726
723 remove_bind_files(drv); 727 if (!drv->suppress_bind_attrs)
728 remove_bind_files(drv);
724 driver_remove_attrs(drv->bus, drv); 729 driver_remove_attrs(drv->bus, drv);
725 driver_remove_file(drv, &driver_attr_uevent); 730 driver_remove_file(drv, &driver_attr_uevent);
726 klist_remove(&drv->p->knode_bus); 731 klist_remove(&drv->p->knode_bus);
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index ed2ebd3c287..f367885a764 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -236,7 +236,7 @@ int driver_register(struct device_driver *drv)
236 put_driver(other); 236 put_driver(other);
237 printk(KERN_ERR "Error: Driver '%s' is already registered, " 237 printk(KERN_ERR "Error: Driver '%s' is already registered, "
238 "aborting...\n", drv->name); 238 "aborting...\n", drv->name);
239 return -EEXIST; 239 return -EBUSY;
240 } 240 }
241 241
242 ret = bus_add_driver(drv); 242 ret = bus_add_driver(drv);
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index ed156a13aa4..4fa954b07ac 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -521,11 +521,15 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
521{ 521{
522 int retval, code; 522 int retval, code;
523 523
524 /* make sure driver won't have bind/unbind attributes */
525 drv->driver.suppress_bind_attrs = true;
526
524 /* temporary section violation during probe() */ 527 /* temporary section violation during probe() */
525 drv->probe = probe; 528 drv->probe = probe;
526 retval = code = platform_driver_register(drv); 529 retval = code = platform_driver_register(drv);
527 530
528 /* Fixup that section violation, being paranoid about code scanning 531 /*
532 * Fixup that section violation, being paranoid about code scanning
529 * the list of drivers in order to probe new devices. Check to see 533 * the list of drivers in order to probe new devices. Check to see
530 * if the probe was successful, and make sure any forced probes of 534 * if the probe was successful, and make sure any forced probes of
531 * new devices fail. 535 * new devices fail.