aboutsummaryrefslogtreecommitdiff
path: root/include/linux/device.h
AgeCommit message (Collapse)AuthorFilesLines
2006-06-21[PATCH] Driver Core: Make dev_info and friends print the bus name if there ↵Alan Stern1-1/+2
is no driver This patch (as721) makes dev_info and related macros print the device's bus name if the device doesn't have a driver, instead of printing just a blank. If the device isn't on a bus either... well, then it does leave a blank space. But it will be easier for someone else to change if they want. Cc: Matthew Wilcox <[email protected]> Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-06-21[PATCH] Driver core: allow struct device to have a dev_tGreg Kroah-Hartman1-0/+14
This is the first step in moving class_device to being replaced by struct device. It allows struct device to export a dev_t and makes it easy to dynamically create and destroy struct device as long as they are associated with a specific class. Cc: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-06-21[PATCH] Driver Core: remove unused exportsGreg Kroah-Hartman1-8/+0
Cc: Arjan van de Ven <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-05-24Merge branch 'master' of ↵David Woodhouse1-0/+2
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: include/asm-powerpc/unistd.h include/asm-sparc/unistd.h include/asm-sparc64/unistd.h Signed-off-by: David Woodhouse <[email protected]>
2006-05-06[CLASS DEVICE]: add attribute_group creationStephen Hemminger1-0/+2
Extend the support of attribute groups in class_device's to allow groups to be created as part of the registration process. This allows network device's to avoid race between registration and creating groups. Note that unlike attributes that are a property of the class object, the groups are a property of the class_device object. This is done because there are different types of network devices (wireless for example). Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2006-04-26Don't include linux/config.h from anywhere else in include/David Woodhouse1-1/+0
Signed-off-by: David Woodhouse <[email protected]>
2006-03-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds1-1/+1
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: fixed path to moved file in include/linux/device.h Fix spelling in E1000_DISABLE_PACKET_SPLIT Kconfig description Documentation/dvb/get_dvb_firmware: fix firmware URL Documentation: Update to BUG-HUNTING Remove superfluous NOTIFY_COOKIE_LEN define add "tags" to .gitignore Fix "frist", "fisrt", typos fix rwlock usage example It's UTF-8
2006-03-22fixed path to moved file in include/linux/device.hRytchkov Alexey1-1/+1
Signed-off-by: Adrian Bunk <[email protected]>
2006-03-21Merge ../linux-2.6James Bottomley1-0/+2
2006-03-20[PATCH] Driver core: add macros notice(), dev_notice()Tilman Schmidt1-0/+2
Both usb.h and device.h have collections of convenience macros for printk() with the KERN_ERR, KERN_WARNING, and KERN_NOTICE severity levels. This patch adds macros for the KERN_NOTICE level which was so far uncatered for. These macros already exist privately in drivers/isdn/gigaset/gigaset.h (currently in the process of being submitted for the kernel tree) but they really belong with their brothers and sisters in include/linux/{device,usb}.h. Signed-off-by: Tilman Schmidt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-03-14[SCSI] drivers/base/bus.c - export reprobeMoore, Eric1-0/+1
Adding support for exposing hidden raid components for sg interface. The sdev->no_uld_attach flag will set set accordingly. The sas module supports adding/removing raid volumes using online storage management application interface. This patch was provided to me by Christoph Hellwig. Signed-off-by: Eric Moore <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2006-01-13[PATCH] Add bus_type probe, remove, shutdown methods.Russell King1-0/+3
Add bus_type probe, remove and shutdown methods to replace the corresponding methods in struct device_driver. This matches the way we handle the suspend/resume methods. Since the bus methods override the device_driver methods, warn if a device driver is registered whose methods will not be called. The long-term idea is to remove the device_driver methods entirely. Signed-off-by: Russell King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-04[PATCH] driver core: replace "hotplug" by "uevent"Kay Sievers1-7/+7
Leave the overloaded "hotplug" word to susbsystems which are handling real devices. The driver core does not "plug" anything, it just exports the state to userspace and generates events. Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-29Create platform_device.h to contain all the platform device details.Russell King1-26/+0
Convert everyone who uses platform_bus_type to include linux/platform_device.h. Signed-off-by: Russell King <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacksRussell King1-15/+2
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] Driver Core: document struct class_device properlyGreg Kroah-Hartman1-0/+24
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] Driver Core: add the ability for class_device structures to be nestedGreg Kroah-Hartman1-3/+10
This patch allows struct class_device to be nested, so that another struct class_device can be the parent of a new one, instead of only having the struct class be the parent. This will allow us to (hopefully) fix up the input and video class subsystem mess. But please people, don't go crazy and start making huge trees of class devices, you should only need 2 levels deep to get everything to work (remember to use a class_interface to get notification of a new class device being added to the system.) Oh, this also allows us to have the possibility of potentially, someday, moving /sys/block into /sys/class. The main hindrance is that pesky /dev numberspace issue... Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] add sysfs attr to re-emit device hotplug eventKay Sievers1-29/+28
A "coldplug + udevstart" can be simple like this: for i in /sys/block/*/*/uevent; do echo 1 > $i; done for i in /sys/class/*/*/uevent; do echo 1 > $i; done for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done Signed-off-by: Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-10-28[PATCH] Driver core: pass interface to class interface methodsDmitry Torokhov1-2/+2
Driver core: pass interface to class intreface methods Pass interface as argument to add() and remove() class interface methods. This way a subsystem can implement generic add/remove handlers and then call interface-specific ones. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-09-22[PATCH] driver core: add helper device_is_registered()Daniel Ritz1-0/+5
add the helper and use it instead of open coding the klist_node_attached() check (which is a layering violation IMHO) idea by Alan Stern. Signed-off-by: Daniel Ritz <[email protected]> Cc: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2005-07-12[ACPI] merge acpi-2.6.12 branch into latest Linux 2.6.13-rc...Len Brown1-2/+4
Signed-off-by: Len Brown <[email protected]>
2005-07-11[ACPI] Bind PCI devices with ACPI devicesDavid Shaohua Li1-2/+4
Implement the framework for binding physical devices with ACPI devices. A physical bus like PCI bus should create a 'acpi_bus_type', with: .find_device: For device which has parent such as normal PCI devices. .find_bridge: It's for special devices, such as PCI root bridge or IDE controller. Such devices generally haven't a parent or ->bus. We use the special method to get an ACPI handle. Uses new field in struct device: firmware_data http://bugzilla.kernel.org/show_bug.cgi?id=4277 Signed-off-by: David Shaohua Li <[email protected]> Signed-off-by: Len Brown <[email protected]>
2005-06-29[PATCH] driver core: change bus_rescan_devices to return voidGreg Kroah-Hartman1-1/+1
No one was looking at the return value of bus_rescan_devices, and it really wasn't anything that anyone in the kernel would ever care about. So change it which enabled some counting code to be removed also. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-29[PATCH] driver core: add bus_find_device & driver_find_device functionsCornelia Huck1-0/+5
Add bus_find_device() and driver_find_device() which allow searching for a device in the bus's resp. the driver's klist and obtain a reference on it. Signed-off-by: Cornelia Huck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Driver core: change device_attribute callbacksYani Ioannou1-2/+4
This patch adds the device_attribute paramerter to the device_attribute store and show sysfs callback functions, and passes a reference to the attribute when the callbacks are called. Signed-off-by: Yani Ioannou <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Driver Core: fix bk-driver-core kills ppc64Patrick Mochel1-1/+0
There's no check to see if the device is already bound to a driver, which could do bad things. The first thing to go wrong is that it will try to match a driver with a device already bound to one. In some cases (it appears with USB with drivers/usb/core/usb.c::usb_match_id()), some drivers will match a device based on the class type, so it would be common (especially for HID devices) to match a device that is already bound. The fun comes when ->probe() is called, it fails, then driver_probe_device() does this: dev->driver = NULL; Later on, that pointer could be be dereferenced without checking and cause hell to break loose. This problem could be nasty. It's very hardware dependent, since some devices could have a different set of matching qualifiers than others. Now, I don't quite see exactly where/how you were getting that crash. You're dereferencing bad memory, but I'm not sure which pointer was bad and where it came from, but it could have come from a couple of different places. The patch below will hopefully fix it all up for you. It's against 2.6.12-rc2-mm1, and does the following: - Move logic to driver_probe_device() and comments uncommon returns: 1 - If device is bound 0 - If device not bound, and no error error - If there was an error. - Move locking to caller of that function, since we want to lock a device for the entire time we're trying to bind it to a driver (to prevent against a driver being loaded at the same time). - Update __device_attach() and __driver_attach() to do that locking. - Check if device is already bound in __driver_attach() - Update the converse device_release_driver() so it locks the device around all of the operations. - Mark driver_probe_device() as static and remove export. It's an internal function, it should stay that way, and there are no other callers. If there is ever a need to export it, we can audit it as necessary. Signed-off-by: Andrew Morton <[email protected]>
2005-06-20[PATCH] Use a klist for device child lists.[email protected]1-8/+2
- Use klist iterator in device_for_each_child(), making it safe to use for removing devices. - Remove unused list_to_dev() function. - Kills all usage of devices_subsys.rwsem. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Remove struct device::driver_list.[email protected]1-1/+0
Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Remove struct device::bus_list.[email protected]1-1/+0
Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Remove the unused device_find().[email protected]1-1/+0
Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Add a klist to struct device_driver for the devices bound to it.[email protected]1-1/+2
- Use it in driver_for_each_device() instead of the regular list_head and stop using the bus's rwsem for protection. - Use driver_for_each_device() in driver_detach() so we don't deadlock on the bus's rwsem. - Remove ->devices. - Move klist access and sysfs link access out from under device's semaphore, since they're synchronized through other means. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Add a klist to struct bus_type for its drivers.[email protected]1-0/+2
- Use it in bus_for_each_drv(). - Use the klist spinlock instead of the bus rwsem. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Add a klist to struct bus_type for its devices.[email protected]1-0/+3
- Use it for bus_for_each_dev(). - Use the klist spinlock instead of the bus rwsem. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] Add driver_for_each_device().[email protected]1-0/+3
Now there's an iterator for accessing each device bound to a driver. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Index: linux-2.6.12-rc2/drivers/base/driver.c ===================================================================
2005-06-20[PATCH] Add a semaphore to struct device to synchronize calls to its driver.[email protected]1-0/+4
This adds a per-device semaphore that is taken before every call from the core to a driver method. This prevents e.g. simultaneous calls to the ->suspend() or ->resume() and ->probe() or ->release(), potentially saving a whole lot of headaches. It also moves us a step closer to removing the bus rwsem, since it protects the fields in struct device that are modified by the core. Signed-off-by: Patrick Mochel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] class: remove class_simple code, as no one in the tree is using it ↵[email protected]1-10/+0
anymore. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] CLASS: move a "simple" class logic into the class core.[email protected]1-0/+9
One step on improving the class api so that it can not be used incorrectly. This also fixes the module owner issue with the dev files that happened when the devt logic moved to the class core. Based on a patch originally written by Kay Sievers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-06-20[PATCH] make driver's name be const char *Dmitry Torokhov1-6/+6
Driver core: change driver's, bus's, class's and platform device's names to be const char * so one can use const char *drv_name = "asdfg"; when initializing structures. Also kill couple of whitespaces. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-05-17[PATCH] Driver Core: remove driver model detach_stateDavid Brownell1-3/+0
The driver model has a "detach_state" mechanism that: - Has never been used by any in-kernel drive; - Is superfluous, since driver remove() methods can do the same thing; - Became buggy when the suspend() parameter changed semantics and type; - Could self-deadlock when called from certain suspend contexts; - Is effectively wasted documentation, object code, and headspace. This removes that "detach_state" mechanism; net code shrink, as well as a per-device saving in the driver model and sysfs. Signed-off-by: David Brownell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+426
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!