spi: New support and problem adjustment of SPI rockchip
[linux-2.6-microblaze.git] / mm / zswap.c
index 7944e3e..cdf6950 100644 (file)
@@ -1378,7 +1378,7 @@ static void zswap_frontswap_init(unsigned type)
        zswap_trees[type] = tree;
 }
 
-static struct frontswap_ops zswap_frontswap_ops = {
+static const struct frontswap_ops zswap_frontswap_ops = {
        .store = zswap_frontswap_store,
        .load = zswap_frontswap_load,
        .invalidate_page = zswap_frontswap_invalidate_page,
@@ -1475,11 +1475,15 @@ static int __init init_zswap(void)
        if (!shrink_wq)
                goto fallback_fail;
 
-       frontswap_register_ops(&zswap_frontswap_ops);
+       ret = frontswap_register_ops(&zswap_frontswap_ops);
+       if (ret)
+               goto destroy_wq;
        if (zswap_debugfs_init())
                pr_warn("debugfs initialization failed\n");
        return 0;
 
+destroy_wq:
+       destroy_workqueue(shrink_wq);
 fallback_fail:
        if (pool)
                zswap_pool_destroy(pool);