modify mu509 sysfs interface(read and write function) to fit linux3.0.
authorzwp <zwp@rock-chips.com>
Wed, 8 Feb 2012 01:49:48 +0000 (09:49 +0800)
committerzwp <zwp@rock-chips.com>
Wed, 8 Feb 2012 01:49:48 +0000 (09:49 +0800)
drivers/misc/mu509.c

index 6a613c29e0d156937eee8e8674b62902eb7c94f8..cf74aefabd6cca11a35a0f3627ed0f37c00e2e29 100755 (executable)
@@ -154,17 +154,24 @@ static struct miscdevice mu509_misc = {
        .name = MODEM_NAME,
        .fops = &mu509_fops
 };
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
+static ssize_t modem_status_read(struct class *cls, struct class_attribute *attr, char *_buf)
+#else
 static ssize_t modem_status_read(struct class *cls, char *_buf)
+#endif
 {
 
        return sprintf(_buf, "%d\n", modem_status);
        
 }
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37))
+static ssize_t modem_status_write(struct class *cls, struct class_attribute *attr, const char *_buf, size_t _count)
+#else
 static ssize_t modem_status_write(struct class *cls, const char *_buf, size_t _count)
+#endif
 {
 
-    printk("Read data from Android: %s\n", _buf);
+    printk("[%s]Read data from Android: %s\n",__FUNCTION__, _buf);
    struct rk29_mu509_data *pdata = gpdata;
    int new_state = simple_strtoul(_buf, NULL, 16);
    if(new_state == modem_status) return _count;