summaryrefslogtreecommitdiff
path: root/io-module/mts_lora.c
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2018-04-20 15:26:43 -0500
committerJohn Klug <john.klug@multitech.com>2018-04-20 15:32:40 -0500
commit24297c1295873ecdb729903aa2f53fe0ec1203d5 (patch)
tree923f73903033abb2b166fb87808b1dfa3f1d8c9f /io-module/mts_lora.c
parent90d4811e95b58f5bb0124cd793e7045dc1ff6b3d (diff)
downloadmts-io-24297c1295873ecdb729903aa2f53fe0ec1203d5.tar.gz
mts-io-24297c1295873ecdb729903aa2f53fe0ec1203d5.tar.bz2
mts-io-24297c1295873ecdb729903aa2f53fe0ec1203d5.zip
Add has-radio flag to mts-io, and remove compiler warnings
Diffstat (limited to 'io-module/mts_lora.c')
-rw-r--r--io-module/mts_lora.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/io-module/mts_lora.c b/io-module/mts_lora.c
index 7b7e204..4cd65a7 100644
--- a/io-module/mts_lora.c
+++ b/io-module/mts_lora.c
@@ -18,12 +18,14 @@ static void mts_teardown_lora_port(void)
}
}
-static ssize_t mts_attr_show_lora_product_info(struct kobject *kobj,
- struct kobj_attribute *attr, char *buf)
+static ssize_t mts_attr_show_lora_product_info(struct device *dev,
+ struct device_attribute *at, char *buf)
{
ssize_t value;
-
char label[32];
+ struct kobject *kobj = (struct kobject *)dev;
+ struct kobj_attribute *attr = (struct kobj_attribute *)at;
+
snprintf(label, sizeof label, "%s/%s", kobj->name, attr->attr.name);
if (strcmp(label, "lora/eui") == 0) {
@@ -50,12 +52,14 @@ static ssize_t mts_attr_show_lora_product_info(struct kobject *kobj,
return value;
}
-static ssize_t mts_attr_show_lora_gpio_pin(struct kobject *kobj,
- struct kobj_attribute *attr,
+static ssize_t mts_attr_show_lora_gpio_pin(struct device *dev,
+ struct device_attribute *at,
char *buf)
{
int value;
struct gpio_pin *pin;
+ struct kobject *kobj = (struct kobject *)dev;
+ struct kobj_attribute *attr = (struct kobj_attribute *)at;
char pin_label[32];
snprintf(pin_label, sizeof pin_label, "%s/%s", kobj->name, attr->attr.name); // ex. lora/reset
@@ -82,12 +86,14 @@ static ssize_t mts_attr_show_lora_gpio_pin(struct kobject *kobj,
return sprintf(buf, "%d\n", value);
}
-static ssize_t mts_attr_store_lora_gpio_pin(struct kobject *kobj,
- struct kobj_attribute *attr, const char *buf, size_t count)
+static ssize_t mts_attr_store_lora_gpio_pin(struct device *dev,
+ struct device_attribute *at, const char *buf, size_t count)
{
int value;
struct gpio_pin *pin;
char pin_label[32];
+ struct kobject *kobj = (struct kobject *)dev;
+ struct kobj_attribute *attr = (struct kobj_attribute *)at;
snprintf(pin_label, sizeof pin_label, "%s/%s", kobj->name, attr->attr.name); // ex. lora/reset