diff options
Diffstat (limited to 'drivers/parisc/pdc_stable.c')
| -rw-r--r-- | drivers/parisc/pdc_stable.c | 411 |
1 files changed, 295 insertions, 116 deletions
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c index bbeabe3fc4c..0f54ab6260d 100644 --- a/drivers/parisc/pdc_stable.c +++ b/drivers/parisc/pdc_stable.c @@ -28,8 +28,15 @@ * following code can deal with just 96 bytes of Stable Storage, and all * sizes between 96 and 192 bytes (provided they are multiple of struct * device_path size, eg: 128, 160 and 192) to provide full information. - * The code makes no use of data above 192 bytes. One last word: there's one - * path we can always count on: the primary path. + * One last word: there's one path we can always count on: the primary path. + * Anything above 224 bytes is used for 'osdep2' OS-dependent storage area. + * + * The first OS-dependent area should always be available. Obviously, this is + * not true for the other one. Also bear in mind that reading/writing from/to + * osdep2 is much more expensive than from/to osdep1. + * NOTE: We do not handle the 2 bytes OS-dep area at 0x5D, nor the first + * 2 bytes of storage available right after OSID. That's a total of 4 bytes + * sacrificed: -ETOOLAZY :P * * The current policy wrt file permissions is: * - write: root only @@ -64,15 +71,18 @@ #include <asm/uaccess.h> #include <asm/hardware.h> -#define PDCS_VERSION "0.22" +#define PDCS_VERSION "0.30" #define PDCS_PREFIX "PDC Stable Storage" #define PDCS_ADDR_PPRI 0x00 #define PDCS_ADDR_OSID 0x40 +#define PDCS_ADDR_OSD1 0x48 +#define PDCS_ADDR_DIAG 0x58 #define PDCS_ADDR_FSIZ 0x5C #define PDCS_ADDR_PCON 0x60 #define PDCS_ADDR_PALT 0x80 #define PDCS_ADDR_PKBD 0xA0 +#define PDCS_ADDR_OSD2 0xE0 MODULE_AUTHOR("Thibaut VARENE <varenet@parisc-linux.org>"); MODULE_DESCRIPTION("sysfs interface to HP PDC Stable Storage data"); @@ -82,6 +92,9 @@ MODULE_VERSION(PDCS_VERSION); /* holds Stable Storage size. Initialized once and for all, no lock needed */ static unsigned long pdcs_size __read_mostly; +/* holds OS ID. Initialized once and for all, hopefully to 0x0006 */ +static u16 pdcs_osid __read_mostly; + /* This struct defines what we need to deal with a parisc pdc path entry */ struct pdcspath_entry { rwlock_t rw_lock; /* to protect path entry access */ @@ -107,15 +120,15 @@ struct pdcspath_entry pdcspath_entry_##_name = { \ }; #define PDCS_ATTR(_name, _mode, _show, _store) \ -struct subsys_attribute pdcs_attr_##_name = { \ - .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \ +struct kobj_attribute pdcs_attr_##_name = { \ + .attr = {.name = __stringify(_name), .mode = _mode}, \ .show = _show, \ .store = _store, \ }; #define PATHS_ATTR(_name, _mode, _show, _store) \ struct pdcspath_attribute paths_attr_##_name = { \ - .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE}, \ + .attr = {.name = __stringify(_name), .mode = _mode}, \ .show = _show, \ .store = _store, \ }; @@ -128,7 +141,7 @@ struct pdcspath_attribute paths_attr_##_name = { \ * @entry: A pointer to an allocated pdcspath_entry. * * The general idea is that you don't read from the Stable Storage every time - * you access the files provided by the facilites. We store a copy of the + * you access the files provided by the facilities. We store a copy of the * content of the stable storage WRT various paths in these structs. We read * these structs when reading the files, and we will write to these structs when * writing to the files, and only then write them back to the Stable Storage. @@ -199,12 +212,10 @@ pdcspath_store(struct pdcspath_entry *entry) entry, devpath, entry->addr); /* addr, devpath and count must be word aligned */ - if (pdc_stable_write(entry->addr, devpath, sizeof(*devpath)) != PDC_OK) { - printk(KERN_ERR "%s: an error occured when writing to PDC.\n" + if (pdc_stable_write(entry->addr, devpath, sizeof(*devpath)) != PDC_OK) + WARN(1, KERN_ERR "%s: an error occurred when writing to PDC.\n" "It is likely that the Stable Storage data has been corrupted.\n" "Please check it carefully upon next reboot.\n", __func__); - WARN_ON(1); - } /* kobject is already registered */ entry->ready = 2; @@ -269,6 +280,7 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun unsigned short i; char in[count+1], *temp; struct device *dev; + int ret; if (!entry || !buf || !count) return -EINVAL; @@ -320,7 +332,9 @@ pdcspath_hwpath_write(struct pdcspath_entry *entry, const char *buf, size_t coun /* Update the symlink to the real device */ sysfs_remove_link(&entry->kobj, "device"); - sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); + ret = sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); + WARN_ON(ret); + write_unlock(&entry->rw_lock); printk(KERN_INFO PDCS_PREFIX ": changed \"%s\" path to \"%s\"\n", @@ -354,7 +368,7 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf) if (!i) /* entry is not ready */ return -ENODATA; - for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) + for (i = 0; i < 6 && devpath->layers[i]; i++) out += sprintf(out, "%u ", devpath->layers[i]); out += sprintf(out, "\n"); @@ -465,7 +479,7 @@ pdcspath_attr_store(struct kobject *kobj, struct attribute *attr, return ret; } -static struct sysfs_ops pdcspath_attr_ops = { +static const struct sysfs_ops pdcspath_attr_ops = { .show = pdcspath_attr_show, .store = pdcspath_attr_store, }; @@ -507,17 +521,17 @@ static struct pdcspath_entry *pdcspath_entries[] = { /** * pdcs_size_read - Stable Storage size output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. */ -static ssize_t -pdcs_size_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_size_read(struct kobject *kobj, + struct kobj_attribute *attr, + char *buf) { char *out = buf; - - if (!entry || !buf) + + if (!buf) return -EINVAL; - + /* show the size of the stable storage */ out += sprintf(out, "%ld\n", pdcs_size); @@ -526,17 +540,17 @@ pdcs_size_read(struct subsystem *entry, char *buf) /** * pdcs_auto_read - Stable Storage autoboot/search flag output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag */ -static ssize_t -pdcs_auto_read(struct subsystem *entry, char *buf, int knob) +static ssize_t pdcs_auto_read(struct kobject *kobj, + struct kobj_attribute *attr, + char *buf, int knob) { char *out = buf; struct pdcspath_entry *pathentry; - if (!entry || !buf) + if (!buf) return -EINVAL; /* Current flags are stored in primary boot path entry */ @@ -552,40 +566,37 @@ pdcs_auto_read(struct subsystem *entry, char *buf, int knob) /** * pdcs_autoboot_read - Stable Storage autoboot flag output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. */ -static inline ssize_t -pdcs_autoboot_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_autoboot_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { - return pdcs_auto_read(entry, buf, PF_AUTOBOOT); + return pdcs_auto_read(kobj, attr, buf, PF_AUTOBOOT); } /** * pdcs_autosearch_read - Stable Storage autoboot flag output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. */ -static inline ssize_t -pdcs_autosearch_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_autosearch_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { - return pdcs_auto_read(entry, buf, PF_AUTOSEARCH); + return pdcs_auto_read(kobj, attr, buf, PF_AUTOSEARCH); } /** * pdcs_timer_read - Stable Storage timer count output (in seconds). - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. * * The value of the timer field correponds to a number of seconds in powers of 2. */ -static ssize_t -pdcs_timer_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_timer_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { char *out = buf; struct pdcspath_entry *pathentry; - if (!entry || !buf) + if (!buf) return -EINVAL; /* Current flags are stored in primary boot path entry */ @@ -602,52 +613,85 @@ pdcs_timer_read(struct subsystem *entry, char *buf) /** * pdcs_osid_read - Stable Storage OS ID register output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. */ -static ssize_t -pdcs_osid_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_osid_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { char *out = buf; - __u32 result; - char *tmpstr = NULL; - if (!entry || !buf) + if (!buf) return -EINVAL; - /* get OSID */ - if (pdc_stable_read(PDCS_ADDR_OSID, &result, sizeof(result)) != PDC_OK) + out += sprintf(out, "%s dependent data (0x%.4x)\n", + os_id_to_string(pdcs_osid), pdcs_osid); + + return out - buf; +} + +/** + * pdcs_osdep1_read - Stable Storage OS-Dependent data area 1 output. + * @buf: The output buffer to write to. + * + * This can hold 16 bytes of OS-Dependent data. + */ +static ssize_t pdcs_osdep1_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + char *out = buf; + u32 result[4]; + + if (!buf) + return -EINVAL; + + if (pdc_stable_read(PDCS_ADDR_OSD1, &result, sizeof(result)) != PDC_OK) return -EIO; - /* the actual result is 16 bits away */ - switch (result >> 16) { - case 0x0000: tmpstr = "No OS-dependent data"; break; - case 0x0001: tmpstr = "HP-UX dependent data"; break; - case 0x0002: tmpstr = "MPE-iX dependent data"; break; - case 0x0003: tmpstr = "OSF dependent data"; break; - case 0x0004: tmpstr = "HP-RT dependent data"; break; - case 0x0005: tmpstr = "Novell Netware dependent data"; break; - default: tmpstr = "Unknown"; break; - } - out += sprintf(out, "%s (0x%.4x)\n", tmpstr, (result >> 16)); + out += sprintf(out, "0x%.8x\n", result[0]); + out += sprintf(out, "0x%.8x\n", result[1]); + out += sprintf(out, "0x%.8x\n", result[2]); + out += sprintf(out, "0x%.8x\n", result[3]); + + return out - buf; +} + +/** + * pdcs_diagnostic_read - Stable Storage Diagnostic register output. + * @buf: The output buffer to write to. + * + * I have NFC how to interpret the content of that register ;-). + */ +static ssize_t pdcs_diagnostic_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + char *out = buf; + u32 result; + + if (!buf) + return -EINVAL; + + /* get diagnostic */ + if (pdc_stable_read(PDCS_ADDR_DIAG, &result, sizeof(result)) != PDC_OK) + return -EIO; + + out += sprintf(out, "0x%.4x\n", (result >> 16)); return out - buf; } /** * pdcs_fastsize_read - Stable Storage FastSize register output. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The output buffer to write to. * * This register holds the amount of system RAM to be tested during boot sequence. */ -static ssize_t -pdcs_fastsize_read(struct subsystem *entry, char *buf) +static ssize_t pdcs_fastsize_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) { char *out = buf; - __u32 result; + u32 result; - if (!entry || !buf) + if (!buf) return -EINVAL; /* get fast-size */ @@ -664,8 +708,39 @@ pdcs_fastsize_read(struct subsystem *entry, char *buf) } /** + * pdcs_osdep2_read - Stable Storage OS-Dependent data area 2 output. + * @buf: The output buffer to write to. + * + * This can hold pdcs_size - 224 bytes of OS-Dependent data, when available. + */ +static ssize_t pdcs_osdep2_read(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + char *out = buf; + unsigned long size; + unsigned short i; + u32 result; + + if (unlikely(pdcs_size <= 224)) + return -ENODATA; + + size = pdcs_size - 224; + + if (!buf) + return -EINVAL; + + for (i=0; i<size; i+=4) { + if (unlikely(pdc_stable_read(PDCS_ADDR_OSD2 + i, &result, + sizeof(result)) != PDC_OK)) + return -EIO; + out += sprintf(out, "0x%.8x\n", result); + } + + return out - buf; +} + +/** * pdcs_auto_write - This function handles autoboot/search flag modifying. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The input buffer to read from. * @count: The number of bytes to be read. * @knob: The PF_AUTOBOOT or PF_AUTOSEARCH flag @@ -674,8 +749,9 @@ pdcs_fastsize_read(struct subsystem *entry, char *buf) * We expect a precise syntax: * \"n\" (n == 0 or 1) to toggle AutoBoot Off or On */ -static ssize_t -pdcs_auto_write(struct subsystem *entry, const char *buf, size_t count, int knob) +static ssize_t pdcs_auto_write(struct kobject *kobj, + struct kobj_attribute *attr, const char *buf, + size_t count, int knob) { struct pdcspath_entry *pathentry; unsigned char flags; @@ -685,7 +761,7 @@ pdcs_auto_write(struct subsystem *entry, const char *buf, size_t count, int knob if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (!entry || !buf || !count) + if (!buf || !count) return -EINVAL; /* We'll use a local copy of buf */ @@ -701,12 +777,9 @@ pdcs_auto_write(struct subsystem *entry, const char *buf, size_t count, int knob read_unlock(&pathentry->rw_lock); DPRINTK("%s: flags before: 0x%X\n", __func__, flags); - - temp = in; - - while (*temp && isspace(*temp)) - temp++; - + + temp = skip_spaces(in); + c = *temp++ - '0'; if ((c != 0) && (c != 1)) goto parse_error; @@ -740,7 +813,6 @@ parse_error: /** * pdcs_autoboot_write - This function handles autoboot flag modifying. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The input buffer to read from. * @count: The number of bytes to be read. * @@ -748,15 +820,15 @@ parse_error: * We expect a precise syntax: * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On */ -static inline ssize_t -pdcs_autoboot_write(struct subsystem *entry, const char *buf, size_t count) +static ssize_t pdcs_autoboot_write(struct kobject *kobj, + struct kobj_attribute *attr, + const char *buf, size_t count) { - return pdcs_auto_write(entry, buf, count, PF_AUTOBOOT); + return pdcs_auto_write(kobj, attr, buf, count, PF_AUTOBOOT); } /** * pdcs_autosearch_write - This function handles autosearch flag modifying. - * @entry: An allocated and populated subsytem struct. We don't use it tho. * @buf: The input buffer to read from. * @count: The number of bytes to be read. * @@ -764,10 +836,95 @@ pdcs_autoboot_write(struct subsystem *entry, const char *buf, size_t count) * We expect a precise syntax: * \"n\" (n == 0 or 1) to toggle AutoSearch Off or On */ -static inline ssize_t -pdcs_autosearch_write(struct subsystem *entry, const char *buf, size_t count) +static ssize_t pdcs_autosearch_write(struct kobject *kobj, + struct kobj_attribute *attr, + const char *buf, size_t count) { - return pdcs_auto_write(entry, buf, count, PF_AUTOSEARCH); + return pdcs_auto_write(kobj, attr, buf, count, PF_AUTOSEARCH); +} + +/** + * pdcs_osdep1_write - Stable Storage OS-Dependent data area 1 input. + * @buf: The input buffer to read from. + * @count: The number of bytes to be read. + * + * This can store 16 bytes of OS-Dependent data. We use a byte-by-byte + * write approach. It's up to userspace to deal with it when constructing + * its input buffer. + */ +static ssize_t pdcs_osdep1_write(struct kobject *kobj, + struct kobj_attribute *attr, + const char *buf, size_t count) +{ + u8 in[16]; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (!buf || !count) + return -EINVAL; + + if (unlikely(pdcs_osid != OS_ID_LINUX)) + return -EPERM; + + if (count > 16) + return -EMSGSIZE; + + /* We'll use a local copy of buf */ + memset(in, 0, 16); + memcpy(in, buf, count); + + if (pdc_stable_write(PDCS_ADDR_OSD1, &in, sizeof(in)) != PDC_OK) + return -EIO; + + return count; +} + +/** + * pdcs_osdep2_write - Stable Storage OS-Dependent data area 2 input. + * @buf: The input buffer to read from. + * @count: The number of bytes to be read. + * + * This can store pdcs_size - 224 bytes of OS-Dependent data. We use a + * byte-by-byte write approach. It's up to userspace to deal with it when + * constructing its input buffer. + */ +static ssize_t pdcs_osdep2_write(struct kobject *kobj, + struct kobj_attribute *attr, + const char *buf, size_t count) +{ + unsigned long size; + unsigned short i; + u8 in[4]; + + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + if (!buf || !count) + return -EINVAL; + + if (unlikely(pdcs_size <= 224)) + return -ENOSYS; + + if (unlikely(pdcs_osid != OS_ID_LINUX)) + return -EPERM; + + size = pdcs_size - 224; + + if (count > size) + return -EMSGSIZE; + + /* We'll use a local copy of buf */ + + for (i=0; i<count; i+=4) { + memset(in, 0, 4); + memcpy(in, buf+i, (count-i < 4) ? count-i : 4); + if (unlikely(pdc_stable_write(PDCS_ADDR_OSD2 + i, &in, + sizeof(in)) != PDC_OK)) + return -EIO; + } + + return count; } /* The remaining attributes. */ @@ -775,21 +932,31 @@ static PDCS_ATTR(size, 0444, pdcs_size_read, NULL); static PDCS_ATTR(autoboot, 0644, pdcs_autoboot_read, pdcs_autoboot_write); static PDCS_ATTR(autosearch, 0644, pdcs_autosearch_read, pdcs_autosearch_write); static PDCS_ATTR(timer, 0444, pdcs_timer_read, NULL); -static PDCS_ATTR(osid, 0400, pdcs_osid_read, NULL); +static PDCS_ATTR(osid, 0444, pdcs_osid_read, NULL); +static PDCS_ATTR(osdep1, 0600, pdcs_osdep1_read, pdcs_osdep1_write); +static PDCS_ATTR(diagnostic, 0400, pdcs_diagnostic_read, NULL); static PDCS_ATTR(fastsize, 0400, pdcs_fastsize_read, NULL); - -static struct subsys_attribute *pdcs_subsys_attrs[] = { - &pdcs_attr_size, - &pdcs_attr_autoboot, - &pdcs_attr_autosearch, - &pdcs_attr_timer, - &pdcs_attr_osid, - &pdcs_attr_fastsize, +static PDCS_ATTR(osdep2, 0600, pdcs_osdep2_read, pdcs_osdep2_write); + +static struct attribute *pdcs_subsys_attrs[] = { + &pdcs_attr_size.attr, + &pdcs_attr_autoboot.attr, + &pdcs_attr_autosearch.attr, + &pdcs_attr_timer.attr, + &pdcs_attr_osid.attr, + &pdcs_attr_osdep1.attr, + &pdcs_attr_diagnostic.attr, + &pdcs_attr_fastsize.attr, + &pdcs_attr_osdep2.attr, NULL, }; -static decl_subsys(paths, &ktype_pdcspath, NULL); -static decl_subsys(stable, NULL, NULL); +static struct attribute_group pdcs_attr_group = { + .attrs = pdcs_subsys_attrs, +}; + +static struct kobject *stable_kobj; +static struct kset *paths_kset; /** * pdcs_register_pathentries - Prepares path entries kobjects for sysfs usage. @@ -819,21 +986,24 @@ pdcs_register_pathentries(void) if (err < 0) continue; - if ((err = kobject_set_name(&entry->kobj, "%s", entry->name))) + entry->kobj.kset = paths_kset; + err = kobject_init_and_add(&entry->kobj, &ktype_pdcspath, NULL, + "%s", entry->name); + if (err) return err; - kobj_set_kset_s(entry, paths_subsys); - if ((err = kobject_register(&entry->kobj))) - return err; - + /* kobject is now registered */ write_lock(&entry->rw_lock); entry->ready = 2; /* Add a nice symlink to the real device */ - if (entry->dev) - sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); + if (entry->dev) { + err = sysfs_create_link(&entry->kobj, &entry->dev->kobj, "device"); + WARN_ON(err); + } write_unlock(&entry->rw_lock); + kobject_uevent(&entry->kobj, KOBJ_ADD); } return 0; @@ -851,7 +1021,7 @@ pdcs_unregister_pathentries(void) for (i = 0; (entry = pdcspath_entries[i]); i++) { read_lock(&entry->rw_lock); if (entry->ready >= 2) - kobject_unregister(&entry->kobj); + kobject_put(&entry->kobj); read_unlock(&entry->rw_lock); } } @@ -863,8 +1033,8 @@ pdcs_unregister_pathentries(void) static int __init pdc_stable_init(void) { - struct subsys_attribute *attr; - int i, rc = 0, error = 0; + int rc = 0, error = 0; + u32 result; /* find the size of the stable storage */ if (pdc_stable_get_size(&pdcs_size) != PDC_OK) @@ -876,21 +1046,31 @@ pdc_stable_init(void) printk(KERN_INFO PDCS_PREFIX " facility v%s\n", PDCS_VERSION); - /* For now we'll register the stable subsys within this driver */ - if ((rc = firmware_register(&stable_subsys))) + /* get OSID */ + if (pdc_stable_read(PDCS_ADDR_OSID, &result, sizeof(result)) != PDC_OK) + return -EIO; + + /* the actual result is 16 bits away */ + pdcs_osid = (u16)(result >> 16); + + /* For now we'll register the directory at /sys/firmware/stable */ + stable_kobj = kobject_create_and_add("stable", firmware_kobj); + if (!stable_kobj) { + rc = -ENOMEM; goto fail_firmreg; + } /* Don't forget the root entries */ - for (i = 0; (attr = pdcs_subsys_attrs[i]) && !error; i++) - if (attr->show) - error = subsys_create_file(&stable_subsys, attr); - - /* register the paths subsys as a subsystem of stable subsys */ - kset_set_kset_s(&paths_subsys, stable_subsys); - if ((rc= subsystem_register(&paths_subsys))) - goto fail_subsysreg; + error = sysfs_create_group(stable_kobj, &pdcs_attr_group); + + /* register the paths kset as a child of the stable kset */ + paths_kset = kset_create_and_add("paths", NULL, stable_kobj); + if (!paths_kset) { + rc = -ENOMEM; + goto fail_ksetreg; + } - /* now we create all "files" for the paths subsys */ + /* now we create all "files" for the paths kset */ if ((rc = pdcs_register_pathentries())) goto fail_pdcsreg; @@ -898,10 +1078,10 @@ pdc_stable_init(void) fail_pdcsreg: pdcs_unregister_pathentries(); - subsystem_unregister(&paths_subsys); + kset_unregister(paths_kset); -fail_subsysreg: - firmware_unregister(&stable_subsys); +fail_ksetreg: + kobject_put(stable_kobj); fail_firmreg: printk(KERN_INFO PDCS_PREFIX " bailing out\n"); @@ -912,9 +1092,8 @@ static void __exit pdc_stable_exit(void) { pdcs_unregister_pathentries(); - subsystem_unregister(&paths_subsys); - - firmware_unregister(&stable_subsys); + kset_unregister(paths_kset); + kobject_put(stable_kobj); } |
