From 51b9c8bffdd16bbe148eb65c93287456912ce055 Mon Sep 17 00:00:00 2001 From: zwp Date: Wed, 8 Feb 2012 09:49:48 +0800 Subject: [PATCH] modify mu509 sysfs interface(read and write function) to fit linux3.0. --- drivers/misc/mu509.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mu509.c b/drivers/misc/mu509.c index 6a613c29e0d1..cf74aefabd6c 100755 --- a/drivers/misc/mu509.c +++ b/drivers/misc/mu509.c @@ -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; -- 2.34.1