linux/drivers/ide
Kay Sievers 263756ec22 [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ...
IDE: MODALIAS support for autoloading of ide-cd, ide-disk, ...

Add MODULE_ALIAS to IDE midlayer modules: ide-disk, ide-cd, ide-floppy and
ide-tape, to autoload these modules depending on the probed media type of
the IDE device.

It is used by udev and replaces the former agent shell script of the hotplug
package, which was required to lookup the media type in the proc filesystem.
Using proc was racy, cause the media file is created after the hotplug event
is sent out.

The module autoloading does not take any effect, until something like the
following udev rule is configured:
  SUBSYSTEM=="ide",  ACTION=="add", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"

The module ide-scsi will not be autoloaded, cause it requires manual
configuration. It can't be, and never was supported for automatic setup in
the hotplug package. Adding a MODULE_ALIAS to ide-scsi for all supported
media types, would just lead to a default blacklist entry anyway.

  $ modinfo ide-disk
  filename:       /lib/modules/2.6.15-rc4-g1b0997f5/kernel/drivers/ide/ide-disk.ko
  description:    ATA DISK Driver
  alias:          ide:*m-disk*
  license:        GPL
  ...

  $ modprobe -vn ide:m-disk
  insmod /lib/modules/2.6.15-rc4-g1b0997f5/kernel/drivers/ide/ide-disk.ko

  $ cat /sys/bus/ide/devices/0.0/modalias
  ide:m-disk

It also adds attributes to the IDE device:
  $ tree /sys/bus/ide/devices/0.0/
  /sys/bus/ide/devices/0.0/
  |-- bus -> ../../../../../../../bus/ide
  |-- drivename
  |-- media
  |-- modalias
  |-- power
  |   |-- state
  |   `-- wakeup
  `-- uevent

  $ cat /sys/bus/ide/devices/0.0/{modalias,drivename,media}
  ide:m-disk
  hda
  disk

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-04 16:18:09 -08:00
..
arm Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cris [PATCH] CRIS IDE driver 2005-07-27 16:26:02 -07:00
h8300 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
legacy [PATCH] ide: incorrect device link for ide-cs 2005-11-09 22:47:18 +01:00
mips [PATCH] ide: AU1200 IDE update 2005-12-15 02:17:46 +01:00
pci [PATCH] via82cxxx IDE: Add VT8251 ISA bridge 2005-12-15 02:11:55 +01:00
ppc [PATCH] pmac IDE: don't release empty interfaces 2005-11-18 22:37:37 +01:00
ide-cd.c [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ... 2006-01-04 16:18:09 -08:00
ide-cd.h [PATCH] ide-cd: remove write-only cmd field from struct cdrom_info 2005-12-15 02:20:49 +01:00
ide-disk.c [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ... 2006-01-04 16:18:09 -08:00
ide-dma.c [PATCH] ide: core modifications for AU1200 2005-12-15 02:16:18 +01:00
ide-floppy.c [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ... 2006-01-04 16:18:09 -08:00
ide-generic.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ide-io.c [PATCH] ide: remove unused ide_action_t:ide_next 2005-11-19 22:01:35 +01:00
ide-iops.c [PATCH] ide: possible cleanups 2005-11-09 23:07:56 +01:00
ide-lib.c [PATCH] ide: fix ide_toggle_bounce() to not try to bounce if we have an IOMMU 2005-11-18 23:13:33 +01:00
ide-pnp.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ide-probe.c [PATCH] kfree cleanup: misc remaining drivers 2005-11-07 07:54:05 -08:00
ide-proc.c Cleaned up AMD Au1200 IDE driver: 2005-10-29 19:32:20 +01:00
ide-tape.c [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ... 2006-01-04 16:18:09 -08:00
ide-taskfile.c [PATCH] ide: remove dead code from flagged_taskfile() 2005-11-19 22:17:55 +01:00
ide-timing.h [PATCH] janitor: ide: min/max macros in ide-timing.h 2005-09-10 10:06:31 -07:00
ide.c [PATCH] ide: MODALIAS support for autoloading of ide-cd, ide-disk, ... 2006-01-04 16:18:09 -08:00
Kconfig [PATCH] ide: AU1200 IDE update 2005-12-15 02:17:46 +01:00
Makefile [IDE] Add driver for Sibyte Swarm evaluation board 2005-11-17 16:23:50 +00:00
setup-pci.c [PATCH] ide: make comment match reality 2005-11-18 23:11:24 +01:00