diff options
Diffstat (limited to 'drivers/staging/zram/zram_sysfs.c')
-rw-r--r-- | drivers/staging/zram/zram_sysfs.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/drivers/staging/zram/zram_sysfs.c b/drivers/staging/zram/zram_sysfs.c index 8a23554..6996eb3 100644 --- a/drivers/staging/zram/zram_sysfs.c +++ b/drivers/staging/zram/zram_sysfs.c @@ -35,7 +35,7 @@ static struct zram *dev_to_zram(struct device *dev) struct zram *zram = NULL; for (i = 0; i < num_devices; i++) { - zram = &zram_devices[i]; + zram = &devices[i]; if (disk_to_dev(zram->disk) == dev) break; } @@ -80,41 +80,12 @@ static ssize_t initstate_show(struct device *dev, return sprintf(buf, "%u\n", zram->init_done); } -#ifdef CONFIG_ZRAM_FOR_ANDROID -extern int swapon(const char*specialfile, int swap_flags); - -static ssize_t initstate_store(struct device *dev, - struct device_attribute *attr, const char *buf, - size_t len) -{ - int ret; - unsigned long do_init; - struct zram *zram = dev_to_zram(dev); - - if (zram->init_done) { - pr_info("the device is initialized device\n"); - return -EBUSY; - } - - ret = strict_strtoul(buf, 10, &do_init); - if (ret) - return ret; - if (!do_init) - return -EINVAL; - - zram_init_device(zram); - swapon("/dev/block/zram0", 0); - return len; -} -#else static inline ssize_t initstate_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { return 0; } -#endif /* CONFIG_ZRAM_FOR_ANDROID */ - static ssize_t reset_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) |