diff options
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 33fee4f..284ab7e 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -47,7 +47,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v1.5.6" +#define DRIVER_VERSION "v1.5.7" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -641,6 +641,9 @@ static DEVICE_ATTR_RO_MTS(dev_attr_eth_mac, "mac-eth", #include "mtcdt.c" #include "mtcap.c" +/* include capabilities sub-directory support */ +#include "mts_capab.c" + #if NUM_AP > 0 @@ -653,8 +656,6 @@ static struct kobject *ap_subdirs[NUM_AP]; static struct attribute_group ap_attr_groups[NUM_AP]; /* info for accessory port (contains function pointers for setup and teardown and and useful info) */ static struct ap_info* port_info[NUM_AP]; -static struct kobject *capab; -static struct attribute_group capab_group; /* accessory card support */ #include "mtac.c" @@ -662,7 +663,6 @@ static struct attribute_group capab_group; #include "mtac_mfser.c" #include "mtac_eth.c" #include "mtac_lora.c" -#include "mts_capab.c" static bool load_port(int port) { int port_index = port - 1; @@ -936,8 +936,7 @@ static void cleanup(void) freelater = NULL; } - if(capab_group.attrs) - kfree((struct kobject *)capab_group.attrs); + mts_capab_dir_delete(); } static int __init mts_io_init(void) @@ -968,21 +967,10 @@ static int __init mts_io_init(void) init_ports(); - capab = kobject_create_and_add("capability", &mts_io_platform_device->dev.kobj); - if (capab == NULL) { - log_error("kobject_create_and_add for capability directory failed"); - return false; - } - - capab_group.attrs = kzalloc(sizeof(struct attribute*) * (capabilities_count+1), GFP_KERNEL); - if (! capab_add_attributes(capab_group.attrs)) { - return false; - } - - if (sysfs_create_group(capab, &capab_group)) { + ret = mts_capab_dir_create(); + if (ret) { cleanup(); - log_error("sysfs_create_group failed to create capability group"); - return false; + return ret; } ret = sysfs_create_group(&mts_io_platform_device->dev.kobj, attr_group); |