diff options
author | John Klug <john.klug@multitech.com> | 2016-12-02 17:22:01 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2016-12-02 17:22:01 -0600 |
commit | 765d88576c6dbc9247ce216ca542e52814f09126 (patch) | |
tree | 8509f3246fc1b669f8c222e50d845b4261752dc2 /io-module/mts_io.c | |
parent | 3da4f0384f9ee1890fece5ebd9fe9784e1910116 (diff) | |
download | mts-io-765d88576c6dbc9247ce216ca542e52814f09126.tar.gz mts-io-765d88576c6dbc9247ce216ca542e52814f09126.tar.bz2 mts-io-765d88576c6dbc9247ce216ca542e52814f09126.zip |
Ethernet AC buffer overrun, and add capability directory to platform1.5.5
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index b71eabb..85f9474 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.4" +#define DRIVER_VERSION "v1.5.5" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -653,6 +653,8 @@ 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" @@ -660,6 +662,7 @@ static struct ap_info* port_info[NUM_AP]; #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; @@ -934,7 +937,9 @@ static void cleanup(void) kfree(freelater); freelater = NULL; } - log_info("done cleaning up...."); + + if(capab_group.attrs) + kfree((struct kobject *)capab_group.attrs); } static int __init mts_io_init(void) @@ -965,6 +970,23 @@ 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)) { + cleanup(); + log_error("sysfs_create_group failed to create capability group"); + return false; + } + ret = sysfs_create_group(&mts_io_platform_device->dev.kobj, attr_group); if (ret) { cleanup(); |