From 24297c1295873ecdb729903aa2f53fe0ec1203d5 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 20 Apr 2018 15:26:43 -0500 Subject: Add has-radio flag to mts-io, and remove compiler warnings --- io-module/mts_lora.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'io-module/mts_lora.c') 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 -- cgit v1.2.3