aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2006-12-01driver core: Introduce device_move(): move a device to a new parent.Cornelia Huck7-4/+228
Provide a function device_move() to move a device to a new parent device. Add auxilliary functions kobject_move() and sysfs_move_dir(). kobject_move() generates a new uevent of type KOBJ_MOVE, containing the previous path (DEVPATH_OLD) in addition to the usual values. For this, a new interface kobject_uevent_env() is created that allows to add further environmental data to the uevent at the kobject layer. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: make drivers/base/core.c:setup_parent() staticAdrian Bunk1-2/+2
This patch makes the needlessly global setup_parent() static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01driver core: Introduce device_find_child().Cornelia Huck2-0/+35
Introduce device_find_child() to match device_for_each_child(). Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01sysfs: sysfs_write_file() writes zero terminated dataThomas Maier1-0/+3
since most of the files in sysfs are text files, it would be nice, if the "store" function called during sysfs_write_file() gets a zero terminated string / data. The current implementation seems not to ensure this. (But only if it is the first time the zeroed buffer page is allocated.) So the buffer can be scanned by sscanf() easily, for example. This patch simply sets a \0 char behind the data in buffer->page. Signed-off-by: Thomas Maier <balagi@justmail.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01cpu topology: consider sysfs_create_group return valueHeiko Carstens1-23/+32
Take return value of sysfs_create_group() into account. That function got called in case of CPU_ONLINE notification. Since callbacks are not allowed to fail on CPU_ONLINE notification do the sysfs group creation on CPU_UP_PREPARE notification. Also remember if creation succeeded in a bitmask. So it's possible to know whether it's legal to call sysfs_remove_group or not. In addition some other minor stuff: - since CPU_UP_PREPARE might fail add CPU_UP_CANCELED handling as well. - use hotcpu_notifier instead of register_hotcpu_notifier. - #ifdef code that isn't needed in the !CONFIG_HOTPLUG_CPU case. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: Call platform_notify_remove laterBenjamin Herrenschmidt1-1/+1
Move the call to platform_notify_remove() to after the call to bus_remove_device(), where it belongs. It's bogus to notify the platform of removal while drivers are still attached to the device and possibly still operating since the platform might use this callback to tear down some resources used by the driver (ACPI bits, iommu table, ...) Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01ACPI: Change ACPI to use dev_archdata instead of firmware_dataBenjamin Herrenschmidt6-15/+39
Change ACPI to use dev_archdata instead of firmware_data This patch changes ACPI to use the new dev_archdata on i386, x86_64 and ia64 (is there any other arch using ACPI ?) to store it's acpi_handle. It also removes the firmware_data field from struct device as this was the only user. Only build-tested on x86 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: add dev_archdata to struct deviceBenjamin Herrenschmidt27-0/+190
Add arch specific dev_archdata to struct device Adds an arch specific struct dev_arch to struct device. This enables architecture to add specific fields to every device in the system, like DMA operation pointers, NUMA node ID, firmware specific data, etc... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Andi Kleen <ak@suse.de> Acked-By: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert sound core to use struct deviceGreg Kroah-Hartman6-30/+37
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. It also makes the struct sound_card to show up as a "real" device where all the different sound class devices are placed as childs and different card attribute files can hang off of. /sys/class/sound is still a flat directory, but the symlink targets of all devices belonging to the same card, point the the /sys/devices tree below the new card device object. Thanks to Kay for the updates to this patch. Signed-off-by: Kay Sievers <kay.sievers@novell.com> Acked-by: Jaroslav Kysela <perex@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: change mem class_devices to be real devicesGreg Kroah-Hartman1-4/+4
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert fb code to use struct deviceGreg Kroah-Hartman3-84/+103
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert firmware code to use struct deviceGreg Kroah-Hartman1-62/+57
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert mmc code to use struct deviceGreg Kroah-Hartman4-19/+19
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert ppdev code to use struct deviceGreg Kroah-Hartman1-3/+3
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert PPP code to use struct deviceGreg Kroah-Hartman1-2/+2
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert cpuid code to use struct deviceGreg Kroah-Hartman1-10/+10
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert msr code to use struct deviceGreg Kroah-Hartman1-10/+10
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01I2C: convert i2c-dev to use struct device instead of struct class_deviceGreg Kroah-Hartman1-13/+13
As class_device is going away eventually... Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert raw device code to use struct deviceGreg Kroah-Hartman1-6/+6
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert tty core to use struct deviceGreg Kroah-Hartman6-28/+29
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Also fixes up the isdn drivers that were putting something in the class device's directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: change misc class_devices to be real devicesGreg Kroah-Hartman5-33/+27
This also ment that some of the misc drivers had to also be fixed up as they were assuming the device was a class_device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert vc code to use struct deviceGreg Kroah-Hartman1-8/+8
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: convert vt code to use struct deviceGreg Kroah-Hartman1-42/+39
Converts from using struct "class_device" to "struct device" making everything show up properly in /sys/devices/ with symlinks from the /sys/class directory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01CONFIG_SYSFS_DEPRECATED - class symlinksKay Sievers1-51/+98
Turn off class symlinks CONFIG_SYSFS_DEPRECATED is enabled. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01CONFIG_SYSFS_DEPRECATED - PHYSDEV* uevent variablesKay Sievers1-0/+4
Disable the PHYSDEV* uevent variables if CONFIG_SYSFS_DEPRECATED is enabled. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01CONFIG_SYSFS_DEPRECATED - device symlinksKay Sievers1-4/+14
Turn off device symlinks CONFIG_SYSFS_DEPRECATED is enabled. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01CONFIG_SYSFS_DEPRECATED - bus symlinksKay Sievers1-3/+17
Turn off the bus symlinks if CONFIG_SYSFS_DEPRECATED is enabled Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: make old versions of udev work properlyGreg Kroah-Hartman1-14/+45
If CONFIG_SYSFS_DEPRECATED is enabled, old versions of udev will work properly with devices that are associated with a class. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01CONFIG_SYSFS_DEPRECATEDKay Sievers1-0/+20
Provide a way to support older versions of udev that are shipped in older distros. If this option is disabled, it will also turn off the compatible symlinks in sysfs that older programs might rely on. When in doubt, or if running a distro older than 2006, say Yes here. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver Core: Move virtual_device_parent() to core.cGreg Kroah-Hartman3-19/+17
It doesn't need to be global or in device.h Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: fix "driver" symlink timingKay Sievers1-30/+52
Create the "driver" link before the child device may be created by the probing logic. This makes it possible for userspace (udev), to determine the driver property of the parent device, at the time the child device is created. Signed-off-by: Kay Sievers <kay.sievers@novell.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-01Driver core: add notification of bus eventsBenjamin Herrenschmidt4-0/+61
I finally did as you suggested and added the notifier to the struct bus_type itself. There are still problems to be expected is something attaches to a bus type where the code can hook in different struct device sub-classes (which is imho a big bogosity but I won't even try to argue that case now) but it will solve nicely a number of issues I've had so far. That also means that clients interested in registering for such notifications have to do it before devices are added and after bus types are registered. Fortunately, most bus types that matter for the various usage scenarios I have in mind are registerd at postcore_initcall time, which means I have a really nice spot at arch_initcall time to add my notifiers. There are 4 notifications provided. Device being added (before hooked to the bus) and removed (failure of previous case or after being unhooked from the bus), along with driver being bound to a device and about to be unbound. The usage I have for these are: - The 2 first ones are used to maintain a struct device_ext that is hooked to struct device.firmware_data. This structure contains for now a pointer to the Open Firmware node related to the device (if any), the NUMA node ID (for quick access to it) and the DMA operations pointers & iommu table instance for DMA to/from this device. For bus types I own (like IBM VIO or EBUS), I just maintain that structure directly from the bus code when creating the devices. But for bus types managed by generic code like PCI or platform (actually, of_platform which is a variation of platform linked to Open Firmware device-tree), I need this notifier. - The other two ones have a completely different usage scenario. I have cases where multiple devices and their drivers depend on each other. For example, the IBM EMAC network driver needs to attach to a MAL DMA engine which is a separate device, and a PHY interface which is also a separate device. They are all of_platform_device's (well, about to be with my upcoming patches) but there is no say in what precise order the core will "probe" them and instanciate the various modules. The solution I found for that is to have the drivers for emac to use multithread_probe, and wait for a driver to be bound to the target MAL and PHY control devices (the device-tree contains reference to the MAL and PHY interface nodes, which I can then match to of_platform_devices). Right now, I've been polling, but with that notifier, I can more cleanly wait (with a timeout of course). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-11-29Linux 2.6.19Linus Torvalds1-1/+1
It's all good.
2006-11-29[PATCH] r8169: Fix iteration variable signFrancois Romieu1-2/+2
This changes the type of variable "i" in rtl8169_init_one() from "unsigned int" to "int". "i" is checked for < 0 later, which can never happen for "unsigned". This results in broken error handling. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-29Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-armLinus Torvalds13-16/+38
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 3943/1: share declaration of struct pxa2xx_udc_mach_info between multiple platforms [ARM] Export smp_call_function() [ARM] Add PM_LEGACY defaults
2006-11-29[ARM] 3943/1: share declaration of struct pxa2xx_udc_mach_info between multiple platformsMilan Svoboda2-16/+27
Move declaration of struct pxa2xx_udc_mach_info from include/asm-arm/arch-pxa/udc.h to new file include/asm-arm/mach/udc_pxa2xx.h. This allow us to use this structure with multiple platforms - pxa and ixp4xx. USB device controller used in pxa25x is the same as controller used in ixp4xx. Signed-off-by: Milan Svoboda <msvoboda@ra.rockwell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-11-29[MIPS] Do topology_init even on uniprocessor kernels.Ralf Baechle3-24/+30
Otherwise CPU 0 doesn't show up in sysfs which breaks some software. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2006-11-28Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds6-22/+35
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NET]: Fix MAX_HEADER setting. [NETFILTER]: ipt_REJECT: fix memory corruption [NETFILTER]: conntrack: fix refcount leak when finding expectation [NETFILTER]: ctnetlink: fix reference count leak [NETFILTER]: nf_conntrack: fix the race on assign helper to new conntrack [NETFILTER]: nfctnetlink: assign helper to newly created conntrack
2006-11-28[NET]: Fix MAX_HEADER setting.David S. Miller1-2/+4
MAX_HEADER is either set to LL_MAX_HEADER or LL_MAX_HEADER + 48, and this is controlled by a set of CONFIG_* ifdef tests. It is trying to use LL_MAX_HEADER + 48 when any of the tunnels are enabled which set hard_header_len like this: dev->hard_header_len = LL_MAX_HEADER + sizeof(struct xxx); The correct set of tunnel drivers which do this are: ipip ip_gre ip6_tunnel sit so make the ifdef test match. Noticed by Patrick McHardy and with help from Herbert Xu. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28[NETFILTER]: ipt_REJECT: fix memory corruptionPatrick McHardy1-7/+9
On devices with hard_header_len > LL_MAX_HEADER ip_route_me_harder() reallocates the skb, leading to memory corruption when using the stale tcph pointer to update the checksum. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28[NETFILTER]: conntrack: fix refcount leak when finding expectationYasuyuki Kozakai2-6/+6
All users of __{ip,nf}_conntrack_expect_find() don't expect that it increments the reference count of expectation. Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28[NETFILTER]: ctnetlink: fix reference count leakPatrick McHardy2-0/+2
When NFA_NEST exceeds the skb size the protocol reference is leaked. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28[NETFILTER]: nf_conntrack: fix the race on assign helper to new conntrackYasuyuki Kozakai1-7/+6
The found helper cannot be assigned to conntrack after unlocking nf_conntrack_lock. This tries to find helper to assign again. Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28[NETFILTER]: nfctnetlink: assign helper to newly created conntrackYasuyuki Kozakai1-0/+8
This fixes the bug which doesn't assign helper to newly created conntrack via nf_conntrack_netlink. Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-11-28Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-devLinus Torvalds2-8/+24
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [PATCH] libata: Fixup ata_sas_queuecmd to handle __ata_scsi_queuecmd failure [PATCH] ahci: AHCI mode SATA patch for Intel ICH9 [PATCH] libata: don't schedule EH on wcache on/off if old EH
2006-11-28Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6Linus Torvalds1-1/+2
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6: selinux: fix dentry_open() error check
2006-11-28Merge branch 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6Linus Torvalds4-7/+18
* 'for-linus' of git://one.firstfloor.org/home/andi/git/linux-2.6: [PATCH] x86-64: Use stricter in process stack check for unwinder [PATCH] i386: Fix compilation with UP genericarch [PATCH] x86-64: Fix warning in io_apic.c [PATCH] x86-64: work around gcc4 issue with -Os in Dwarf2 stack unwind [PATCH] x86_64: Align data segment to PAGE_SIZE boundary
2006-11-28Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsaLinus Torvalds9-23/+41
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: [ALSA] version 1.0.13 [ALSA] snd-emu10k1: Fix capture for one variant. [ALSA] Fix hang-up at disconnection of usb-audio [ALSA] hda: fix typo for xw4400 PCI sub-ID [ALSA] hda: fix sigmatel dell system detection [ALSA] Enable stereo line input for TAS codec [ALSA] rtctimer: handle RTC interrupts with a tasklet
2006-11-28Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linusLinus Torvalds1-1/+1
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: [MIPS] Fix Bonito bootup message.
2006-11-28[PATCH] add missing libsas include to fix s390 compilation.Dave Jones1-0/+1
include/scsi/libsas.h:479: error: field 'smp_req' has incomplete type include/scsi/libsas.h:480: error: field 'smp_resp' has incomplete type Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>