diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2005-12-06 20:25:07 +0100 |
---|---|---|
committer | Dominik Brodowski <brodo@isilmar.linta.de> | 2005-12-06 20:27:21 +0100 |
commit | 1050829dc4aa7be84652a95a6e2ad56f5f529296 (patch) | |
tree | d7f1072002d0e113edb2df5362d1eb6e1ef038dc | |
parent | 48166159e549890157aad9a9428e311d2a6ad5a2 (diff) | |
download | pcmciautils-1050829dc4aa7be84652a95a6e2ad56f5f529296.tar.gz |
Release of pcmciautils-002 (2005-03-17)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | hotplug/pcmcia.agent | 9 | ||||
-rwxr-xr-x | hotplug/pcmcia.rc | 8 | ||||
-rw-r--r-- | src/pcmcia-modalias.c | 12 | ||||
-rw-r--r-- | src/startup.c | 2 |
5 files changed, 19 insertions, 14 deletions
@@ -30,7 +30,7 @@ PCMCIA_CHECK_BROKEN_CIS = pcmcia-check-broken-cis PCMCIA_MODALIAS = pcmcia-modalias PCMCIA_SOCKET_STARTUP = pcmcia-socket-startup -VERSION = 001 +VERSION = 002 #INSTALL_DIR = /usr/local/sbin RELEASE_NAME = pcmciautils-$(VERSION) diff --git a/hotplug/pcmcia.agent b/hotplug/pcmcia.agent index 7ef9454..a9ec4d1 100755 --- a/hotplug/pcmcia.agent +++ b/hotplug/pcmcia.agent @@ -16,12 +16,17 @@ if [ "$ACTION" = "" ]; then exit 1 fi -debug_mesg $SOCKET_NO $DEVICE_NO $MODNAME $DEVPATH +if [ "$MODALIAS" = "" ]; then + # this will go away soon -- only a few -mm kernels exported this wrongly. + MODALIAS=$(MODNAME) +fi + +debug_mesg $SOCKET_NO $DEVICE_NO $MODALIAS $DEVPATH case $ACTION in add) - modprobe $MODNAME + modprobe $MODALIAS # check whether the CIS is completely broken if [ ! -h $SYSFS$DEVPATH/driver ]; then diff --git a/hotplug/pcmcia.rc b/hotplug/pcmcia.rc index 4d874dc..a660b81 100755 --- a/hotplug/pcmcia.rc +++ b/hotplug/pcmcia.rc @@ -21,13 +21,13 @@ pcmcia_boot_events () if [ $PCMCIA_DEVICE == \* ]; then continue; fi; - MODNAME=$(pcmcia-modalias $PCMCIA_DEVICE) - debug_mesg $MODNAME $PCMICA_DEVICE - if [ -z $MODNAME ]; then + MODALIAS=$(pcmcia-modalias $PCMCIA_DEVICE) + debug_mesg $MODALIAS $PCMICA_DEVICE + if [ -z $MODALIAS ]; then continue; fi; ACTION=add - export MODNAME ACTION + export MODALIAS ACTION /sbin/hotplug pcmcia done; fi; diff --git a/src/pcmcia-modalias.c b/src/pcmcia-modalias.c index 4aad951..6403872 100644 --- a/src/pcmcia-modalias.c +++ b/src/pcmcia-modalias.c @@ -94,12 +94,6 @@ static int extract_modalias_string(char *device) { if (pos > (SYSFS_PATH_MAX - 10)) return -ENOMEM; - value = read_one(device, "function"); - pos += snprintf(&modalias_string[pos], SYSFS_PATH_MAX - pos, - "pfn%02X", value); - if (pos > (SYSFS_PATH_MAX - 10)) - return -ENOMEM; - tmp2 = sscanf(device, "%d.%d", &tmp, &value); if (tmp2 != 2) return -EIO; @@ -108,6 +102,12 @@ static int extract_modalias_string(char *device) { if (pos > (SYSFS_PATH_MAX - 10)) return -ENOMEM; + value = read_one(device, "function"); + pos += snprintf(&modalias_string[pos], SYSFS_PATH_MAX - pos, + "pfn%02X", value); + if (pos > (SYSFS_PATH_MAX - 10)) + return -ENOMEM; + value = get_one_hash(device, 1); pos += snprintf(&modalias_string[pos], SYSFS_PATH_MAX - pos, "pa%08X", value); diff --git a/src/startup.c b/src/startup.c index cce0ad6..00d1328 100644 --- a/src/startup.c +++ b/src/startup.c @@ -104,7 +104,7 @@ static int setup_done(unsigned int socket_no) if (!attr) return -ENODEV; - sysfs_write_attribute(attr, "42", 2); + ret = sysfs_write_attribute(attr, "42", 2); sysfs_close_attribute(attr); |