imamnurby/smpl_train_seed8 huggingface dataset:
--- initial
+++ final
@@ -1,74 +1,74 @@
 int __init pcpu_page_first_chunk(size_t reserved_size, pcpu_fc_alloc_fn_t alloc_fn, pcpu_fc_free_fn_t free_fn, pcpu_fc_populate_pte_fn_t populate_pte_fn) {
   static struct vm_struct vm;
   struct pcpu_alloc_info *ai;
   char psize_str[16];
   int unit_pages;
   size_t pages_size;
   struct page **pages;
   int unit, i, j, rc;
   int upa;
   int nr_g0_units;
   snprintf(psize_str, sizeof(psize_str), "%luK", PAGE_SIZE >> 10);
   ai = pcpu_build_alloc_info(reserved_size, 0, PAGE_SIZE, NULL);
   if (IS_ERR(ai)) return PTR_ERR(ai);
   BUG_ON(ai->nr_groups != 1);
   upa = ai->alloc_size / ai->unit_size;
   nr_g0_units = roundup(num_possible_cpus(), upa);
   if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) {
     pcpu_free_alloc_info(ai);
     return -EINVAL;
   }
   unit_pages = ai->unit_size >> PAGE_SHIFT;
   /* unaligned allocations can't be freed, round up to page size */
   pages_size = PFN_ALIGN(unit_pages * num_possible_cpus() * sizeof(pages[0]));
-  pages = memblock_virt_alloc(pages_size, 0);
+  pages = memblock_alloc(pages_size, 0);
   /* allocate pages */
   j = 0;
   for (unit = 0; unit < num_possible_cpus(); unit++) {
     unsigned int cpu = ai->groups[0].cpu_map[unit];
     for (i = 0; i < unit_pages; i++) {
       void *ptr;
       ptr = alloc_fn(cpu, PAGE_SIZE, PAGE_SIZE);
       if (!ptr) {
         pr_warn("failed to allocate %s page for cpu%u\n", psize_str, cpu);
         goto enomem;
       }
       /* kmemleak tracks the percpu allocations separately */
       kmemleak_free(ptr);
       pages[j++] = virt_to_page(ptr);
     }
   }
   /* allocate vm area, map the pages and copy static data */
   vm.flags = VM_ALLOC;
   vm.size = num_possible_cpus() * ai->unit_size;
   vm_area_register_early(&vm, PAGE_SIZE);
   for (unit = 0; unit < num_possible_cpus(); unit++) {
     unsigned long unit_addr = (unsigned long)vm.addr + unit * ai->unit_size;
     for (i = 0; i < unit_pages; i++)
       populate_pte_fn(unit_addr + (i << PAGE_SHIFT));
     /* pte already populated, the following shouldn't fail */
     rc = __pcpu_map_pages(unit_addr, &pages[unit * unit_pages], unit_pages);
     if (rc < 0) panic("failed to map percpu area, err=%d\n", rc);
     /*
      * FIXME: Archs with virtual cache should flush local
      * cache for the linear mapping here - something
      * equivalent to flush_cache_vmap() on the local cpu.
      * flush_cache_vmap() can't be used as most supporting
      * data structures are not set up yet.
      */
     /* copy static data */
     memcpy((void *)unit_addr, __per_cpu_load, ai->static_size);
   }
   /* we're ready, commit */
   pr_info("%d %s pages/cpu @%p s%zu r%zu d%zu\n", unit_pages, psize_str, vm.addr, ai->static_size, ai->reserved_size, ai->dyn_size);
   rc = pcpu_setup_first_chunk(ai, vm.addr);
   goto out_free_ar;
 enomem:
   while (--j >= 0)
     free_fn(page_address(pages[j]), PAGE_SIZE);
   rc = -ENOMEM;
 out_free_ar:
   memblock_free_early(__pa(pages), pages_size);
   pcpu_free_alloc_info(ai);
   return rc;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,26 +1,26 @@
 void __init setup_log_buf(int early) {
   unsigned long flags;
   char *new_log_buf;
   unsigned int free;
   if (log_buf != __log_buf) return;
   if (!early && !new_log_buf_len) log_buf_add_cpu();
   if (!new_log_buf_len) return;
   if (early) {
-    new_log_buf = memblock_virt_alloc(new_log_buf_len, LOG_ALIGN);
+    new_log_buf = memblock_alloc(new_log_buf_len, LOG_ALIGN);
   } else {
-    new_log_buf = memblock_virt_alloc_nopanic(new_log_buf_len, LOG_ALIGN);
+    new_log_buf = memblock_alloc_nopanic(new_log_buf_len, LOG_ALIGN);
   }
   if (unlikely(!new_log_buf)) {
     pr_err("log_buf_len: %lu bytes not available\n", new_log_buf_len);
     return;
   }
   logbuf_lock_irqsave(flags);
   log_buf_len = new_log_buf_len;
   log_buf = new_log_buf;
   new_log_buf_len = 0;
   free = __LOG_BUF_LEN - log_next_idx;
   memcpy(log_buf, __log_buf, __LOG_BUF_LEN);
   logbuf_unlock_irqrestore(flags);
   pr_info("log_buf_len: %u bytes\n", log_buf_len);
   pr_info("early log buf free: %u(%u%%)\n", free, (free * 100) / __LOG_BUF_LEN);
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)

@@
expression e1,e2;
@@

-                       memblock_virt_alloc_nopanic
+                       memblock_alloc_nopanic
				(e1,e2)
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void __init prealloc(struct ps3_prealloc *p) {
   if (!p->size) return;
-  p->address = memblock_virt_alloc(p->size, p->align);
+  p->address = memblock_alloc(p->size, p->align);
   printk(KERN_INFO "%s: %lu bytes at %p\n", p->name, p->size, p->address);
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,46 +1,46 @@
 static void __init setup_resources(void) {
   struct resource *res, *std_res, *sub_res;
   struct memblock_region *reg;
   int j;
   code_resource.start = (unsigned long)_text;
   code_resource.end = (unsigned long)_etext - 1;
   data_resource.start = (unsigned long)_etext;
   data_resource.end = (unsigned long)_edata - 1;
   bss_resource.start = (unsigned long)__bss_start;
   bss_resource.end = (unsigned long)__bss_stop - 1;
   for_each_memblock(memory, reg) {
-    res = memblock_virt_alloc(sizeof(*res), 8);
+    res = memblock_alloc(sizeof(*res), 8);
     res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
     res->name = "System RAM";
     res->start = reg->base;
     res->end = reg->base + reg->size - 1;
     request_resource(&iomem_resource, res);
     for (j = 0; j < ARRAY_SIZE(standard_resources); j++) {
       std_res = standard_resources[j];
       if (std_res->start < res->start || std_res->start > res->end) continue;
       if (std_res->end > res->end) {
-        sub_res = memblock_virt_alloc(sizeof(*sub_res), 8);
+        sub_res = memblock_alloc(sizeof(*sub_res), 8);
         *sub_res = *std_res;
         sub_res->end = res->end;
         std_res->start = res->end + 1;
         request_resource(res, sub_res);
       } else {
         request_resource(res, std_res);
       }
     }
   }
 #ifdef CONFIG_CRASH_DUMP
   /*
    * Re-add removed crash kernel memory as reserved memory. This makes
    * sure it will be mapped with the identity mapping and struct pages
    * will be created, so it can be resized later on.
    * However add it later since the crash kernel resource should not be
    * part of the System RAM resource.
    */
   if (crashk_res.end) {
     memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0);
     memblock_reserve(crashk_res.start, resource_size(&crashk_res));
     insert_resource(&iomem_resource, &crashk_res);
   }
 #endif
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,38 +1,38 @@
 void __init smp_detect_cpus(void) {
   unsigned int cpu, mtid, c_cpus, s_cpus;
   struct sclp_core_info *info;
   u16 address;
   /* Get CPU information */
-  info = memblock_virt_alloc(sizeof(*info), 8);
+  info = memblock_alloc(sizeof(*info), 8);
   smp_get_core_info(info, 1);
   /* Find boot CPU type */
   if (sclp.has_core_type) {
     address = stap();
     for (cpu = 0; cpu < info->combined; cpu++)
       if (info->core[cpu].core_id == address) {
         /* The boot cpu dictates the cpu type. */
         boot_core_type = info->core[cpu].type;
         break;
       }
     if (cpu >= info->combined) panic("Could not find boot CPU type");
   }
   /* Set multi-threading state for the current system */
   mtid = boot_core_type ? sclp.mtid : sclp.mtid_cp;
   mtid = (mtid < smp_max_threads) ? mtid : smp_max_threads - 1;
   pcpu_set_smt(mtid);
   /* Print number of CPUs */
   c_cpus = s_cpus = 0;
   for (cpu = 0; cpu < info->combined; cpu++) {
     if (sclp.has_core_type && info->core[cpu].type != boot_core_type) continue;
     if (cpu < info->configured)
       c_cpus += smp_cpu_mtid + 1;
     else
       s_cpus += smp_cpu_mtid + 1;
   }
   pr_info("%d configured CPUs, %d standby CPUs\n", c_cpus, s_cpus);
   /* Add CPUs present at boot */
   get_online_cpus();
   __smp_rescan_cpus(info, 0);
   put_online_cpus();
   memblock_free_early((unsigned long)info, sizeof(*info));
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,25 +1,25 @@
 void __init __register_nosave_region(unsigned long start_pfn, unsigned long end_pfn, int use_kmalloc) {
   struct nosave_region *region;
   if (start_pfn >= end_pfn) return;
   if (!list_empty(&nosave_regions)) {
     /* Try to extend the previous region (they should be sorted) */
     region = list_entry(nosave_regions.prev, struct nosave_region, list);
     if (region->end_pfn == start_pfn) {
       region->end_pfn = end_pfn;
       goto Report;
     }
   }
   if (use_kmalloc) {
     /* During init, this shouldn't fail */
     region = kmalloc(sizeof(struct nosave_region), GFP_KERNEL);
     BUG_ON(!region);
   } else {
     /* This allocation cannot fail */
-    region = memblock_virt_alloc(sizeof(struct nosave_region), 0);
+    region = memblock_alloc(sizeof(struct nosave_region), 0);
   }
   region->start_pfn = start_pfn;
   region->end_pfn = end_pfn;
   list_add_tail(&region->list, &nosave_regions);
 Report:
   pr_info("Registered nosave memory: [mem %#010llx-%#010llx]\n", (unsigned long long)start_pfn << PAGE_SHIFT, ((unsigned long long)end_pfn << PAGE_SHIFT) - 1);
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1 +1 @@
-static void *__ref __earlyonly_bootmem_alloc(int node, unsigned long size, unsigned long align, unsigned long goal) { return memblock_virt_alloc_try_nid_raw(size, align, goal, BOOTMEM_ALLOC_ACCESSIBLE, node); }
+static void *__ref __earlyonly_bootmem_alloc(int node, unsigned long size, unsigned long align, unsigned long goal) { return memblock_alloc_try_nid_raw(size, align, goal, BOOTMEM_ALLOC_ACCESSIBLE, node); }<sep>@@
expression e1,e2,e3,e4,e5;
@@

-       memblock_virt_alloc_try_nid_raw
+       memblock_alloc_try_nid_raw
		(e1,e2,e3,e4,e5)
--- initial
+++ final
@@ -1,24 +1,24 @@
 void __init memory_present(int nid, unsigned long start, unsigned long end) {
   unsigned long pfn;
 #ifdef CONFIG_SPARSEMEM_EXTREME
   if (unlikely(!mem_section)) {
     unsigned long size, align;
     size = sizeof(struct mem_section *) * NR_SECTION_ROOTS;
     align = 1 << (INTERNODE_CACHE_SHIFT);
-    mem_section = memblock_virt_alloc(size, align);
+    mem_section = memblock_alloc(size, align);
   }
 #endif
   start &= PAGE_SECTION_MASK;
   mminit_validate_memmodel_limits(&start, &end);
   for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
     unsigned long section = pfn_to_section_nr(pfn);
     struct mem_section *ms;
     sparse_index_init(section, nid);
     set_section_nid(section, nid);
     ms = __nr_to_section(section);
     if (!ms->section_mem_map) {
       ms->section_mem_map = sparse_encode_early_nid(nid) | SECTION_IS_ONLINE;
       section_mark_present(ms);
     }
   }
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,5 +1,5 @@
 static void __init sparse_buffer_init(unsigned long size, int nid) {
   WARN_ON(sparsemap_buf); /* forgot to call sparse_buffer_fini()? */
-  sparsemap_buf = memblock_virt_alloc_try_nid_raw(size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
+  sparsemap_buf = memblock_alloc_try_nid_raw(size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
   sparsemap_buf_end = sparsemap_buf + size;
 }<sep>@@
expression e1,e2,e3,e4,e5;
@@

-       memblock_virt_alloc_try_nid_raw
+       memblock_alloc_try_nid_raw
		(e1,e2,e3,e4,e5)
--- initial
+++ final
@@ -1,9 +1,9 @@
 mem_section __ref *sparse_index_alloc(int nid) {
   struct mem_section *section = NULL;
   unsigned long array_size = SECTIONS_PER_ROOT * sizeof(struct mem_section);
   if (slab_is_available())
     section = kzalloc_node(array_size, GFP_KERNEL, nid);
   else
-    section = memblock_virt_alloc_node(array_size, nid);
+    section = memblock_alloc_node(array_size, nid);
   return section;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc_node
+                       memblock_alloc_node
				(e1,e2)
--- initial
+++ final
@@ -1,7 +1,7 @@
 struct page __init *sparse_mem_map_populate(unsigned long pnum, int nid, struct vmem_altmap *altmap) {
   unsigned long size = section_map_size();
   struct page *map = sparse_buffer_alloc(size);
   if (map) return map;
-  map = memblock_virt_alloc_try_nid(size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
+  map = memblock_alloc_try_nid(size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS), BOOTMEM_ALLOC_ACCESSIBLE, nid);
   return map;
 }<sep>@@
expression e1,e2,e3,e4,e5;
@@

-       memblock_virt_alloc_try_nid
+       memblock_alloc_try_nid
		(e1,e2,e3,e4,e5)
--- initial
+++ final
@@ -1,16 +1,16 @@
 void __init swiotlb_init(int verbose) {
   size_t default_size = IO_TLB_DEFAULT_SIZE;
   unsigned char *vstart;
   unsigned long bytes;
   if (!io_tlb_nslabs) {
     io_tlb_nslabs = (default_size >> IO_TLB_SHIFT);
     io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
   }
   bytes = io_tlb_nslabs << IO_TLB_SHIFT;
   /* Get IO TLB memory from the low pages */
-  vstart = memblock_virt_alloc_low_nopanic(PAGE_ALIGN(bytes), PAGE_SIZE);
+  vstart = memblock_alloc_low_nopanic(PAGE_ALIGN(bytes), PAGE_SIZE);
   if (vstart && !swiotlb_init_with_tbl(vstart, io_tlb_nslabs, verbose)) return;
   if (io_tlb_start) memblock_free_early(io_tlb_start, PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT));
   pr_warn("Cannot allocate buffer");
   no_iotlb_memory = true;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc_low_nopanic
+                       memblock_alloc_low_nopanic
				(e1,e2)
--- initial
+++ final
@@ -1,22 +1,22 @@
 int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) {
   unsigned long i, bytes;
   bytes = nslabs << IO_TLB_SHIFT;
   io_tlb_nslabs = nslabs;
   io_tlb_start = __pa(tlb);
   io_tlb_end = io_tlb_start + bytes;
   /*
    * Allocate and initialize the free list array.  This array is used
    * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
    * between io_tlb_start and io_tlb_end.
    */
-  io_tlb_list = memblock_virt_alloc(PAGE_ALIGN(io_tlb_nslabs * sizeof(int)), PAGE_SIZE);
-  io_tlb_orig_addr = memblock_virt_alloc(PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t)), PAGE_SIZE);
+  io_tlb_list = memblock_alloc(PAGE_ALIGN(io_tlb_nslabs * sizeof(int)), PAGE_SIZE);
+  io_tlb_orig_addr = memblock_alloc(PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t)), PAGE_SIZE);
   for (i = 0; i < io_tlb_nslabs; i++) {
     io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
     io_tlb_orig_addr[i] = INVALID_PHYS_ADDR;
   }
   io_tlb_index = 0;
   if (verbose) swiotlb_print_info();
   swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT);
   return 0;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,11 +1,11 @@
 static void __init alloc_masks(struct sysinfo_15_1_x *info, struct mask_info *mask, int offset) {
   int i, nr_masks;
   nr_masks = info->mag[TOPOLOGY_NR_MAG - offset];
   for (i = 0; i < info->mnest - offset; i++)
     nr_masks *= info->mag[TOPOLOGY_NR_MAG - offset - 1 - i];
   nr_masks = max(nr_masks, 1);
   for (i = 0; i < nr_masks; i++) {
-    mask->next = memblock_virt_alloc(sizeof(*mask->next), 8);
+    mask->next = memblock_alloc(sizeof(*mask->next), 8);
     mask = mask->next;
   }
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,21 +1,21 @@
 void __init topology_init_early(void) {
   struct sysinfo_15_1_x *info;
   set_sched_topology(s390_topology);
   if (topology_mode == TOPOLOGY_MODE_UNINITIALIZED) {
     if (MACHINE_HAS_TOPOLOGY)
       topology_mode = TOPOLOGY_MODE_HW;
     else
       topology_mode = TOPOLOGY_MODE_SINGLE;
   }
   if (!MACHINE_HAS_TOPOLOGY) goto out;
-  tl_info = memblock_virt_alloc(PAGE_SIZE, PAGE_SIZE);
+  tl_info = memblock_alloc(PAGE_SIZE, PAGE_SIZE);
   info = tl_info;
   store_topology(info);
   pr_info("The CPU configuration topology of the machine is: %d %d %d %d %d %d / %d\n", info->mag[0], info->mag[1], info->mag[2], info->mag[3], info->mag[4], info->mag[5], info->mnest);
   alloc_masks(info, &socket_info, 1);
   alloc_masks(info, &book_info, 2);
   alloc_masks(info, &drawer_info, 3);
 out:
   __arch_update_cpu_topology();
   __arch_update_dedicated_flag(NULL);
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,14 +1,14 @@
 struct toptree __ref *toptree_alloc(int level, int id) {
   struct toptree *res;
   if (slab_is_available())
     res = kzalloc(sizeof(*res), GFP_KERNEL);
   else
-    res = memblock_virt_alloc(sizeof(*res), 8);
+    res = memblock_alloc(sizeof(*res), 8);
   if (!res) return res;
   INIT_LIST_HEAD(&res->children);
   INIT_LIST_HEAD(&res->sibling);
   cpumask_clear(&res->mask);
   res->level = level;
   res->id = id;
   return res;
 }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1 +1 @@
-static void *__init dt_alloc_memory(u64 size, u64 align) { return memblock_virt_alloc(size, align); }
+static void *__init dt_alloc_memory(u64 size, u64 align) { return memblock_alloc(size, align); }<sep>@@
expression e1,e2;
@@

-                       memblock_virt_alloc
+                       memblock_alloc
				(e1,e2)
--- initial
+++ final
@@ -1,64 +1,64 @@
 static int ams_delta_init(struct platform_device *pdev) {
   struct nand_chip *this;
   struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   void __iomem *io_base;
   int err = 0;
   if (!res) return -ENXIO;
   /* Allocate memory for MTD device structure and private data */
   this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
   if (!this) {
     pr_warn("Unable to allocate E3 NAND MTD device structure.\n");
     err = -ENOMEM;
     goto out;
   }
   ams_delta_mtd = nand_to_mtd(this);
   ams_delta_mtd->owner = THIS_MODULE;
   /*
    * Don't try to request the memory region from here,
    * it should have been already requested from the
    * gpio-omap driver and requesting it again would fail.
    */
   io_base = ioremap(res->start, resource_size(res));
   if (io_base == NULL) {
     dev_err(&pdev->dev, "ioremap failed\n");
     err = -EIO;
     goto out_free;
   }
   nand_set_controller_data(this, (void *)io_base);
   /* Set address of NAND IO lines */
   this->IO_ADDR_R = io_base + OMAP_MPUIO_INPUT_LATCH;
   this->IO_ADDR_W = io_base + OMAP_MPUIO_OUTPUT;
   this->read_byte = ams_delta_read_byte;
   this->write_buf = ams_delta_write_buf;
   this->read_buf = ams_delta_read_buf;
   this->cmd_ctrl = ams_delta_hwcontrol;
   if (gpio_request(AMS_DELTA_GPIO_PIN_NAND_RB, "nand_rdy") == 0) {
     this->dev_ready = ams_delta_nand_ready;
   } else {
     this->dev_ready = NULL;
     pr_notice("Couldn't request gpio for Delta NAND ready.\n");
   }
   /* 25 us command delay time */
   this->chip_delay = 30;
   this->ecc.mode = NAND_ECC_SOFT;
   this->ecc.algo = NAND_ECC_HAMMING;
   platform_set_drvdata(pdev, io_base);
   /* Set chip enabled, but  */
   err = gpio_request_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
   if (err) goto out_gpio;
   /* Scan to find existence of the device */
-  err = nand_scan(ams_delta_mtd, 1);
+  err = nand_scan(this, 1);
   if (err) goto out_mtd;
   /* Register the partitions */
   mtd_device_register(ams_delta_mtd, partition_info, ARRAY_SIZE(partition_info));
   goto out;
 out_mtd:
   gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
 out_gpio:
   gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
   iounmap(io_base);
 out_free:
   kfree(this);
 out:
   return err;
 }<sep>@@
expression board_mtd,this;
@@
board_mtd = nand_to_mtd(this)
...
-        nand_scan (board_mtd, 1)
+        nand_scan (this, 1)
--- initial
+++ final
@@ -1,70 +1,70 @@
 static int au1550nd_probe(struct platform_device *pdev) {
   struct au1550nd_platdata *pd;
   struct au1550nd_ctx *ctx;
   struct nand_chip *this;
   struct mtd_info *mtd;
   struct resource *r;
   int ret, cs;
   pd = dev_get_platdata(&pdev->dev);
   if (!pd) {
     dev_err(&pdev->dev, "missing platform data\n");
     return -ENODEV;
   }
   ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
   if (!ctx) return -ENOMEM;
   r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   if (!r) {
     dev_err(&pdev->dev, "no NAND memory resource\n");
     ret = -ENODEV;
     goto out1;
   }
   if (request_mem_region(r->start, resource_size(r), "au1550-nand")) {
     dev_err(&pdev->dev, "cannot claim NAND memory area\n");
     ret = -ENOMEM;
     goto out1;
   }
   ctx->base = ioremap_nocache(r->start, 0x1000);
   if (!ctx->base) {
     dev_err(&pdev->dev, "cannot remap NAND memory area\n");
     ret = -ENODEV;
     goto out2;
   }
   this = &ctx->chip;
   mtd = nand_to_mtd(this);
   mtd->dev.parent = &pdev->dev;
   /* figure out which CS# r->start belongs to */
   cs = find_nand_cs(r->start);
   if (cs < 0) {
     dev_err(&pdev->dev, "cannot detect NAND chipselect\n");
     ret = -ENODEV;
     goto out3;
   }
   ctx->cs = cs;
   this->dev_ready = au1550_device_ready;
   this->select_chip = au1550_select_chip;
   this->cmdfunc = au1550_command;
   /* 30 us command delay time */
   this->chip_delay = 30;
   this->ecc.mode = NAND_ECC_SOFT;
   this->ecc.algo = NAND_ECC_HAMMING;
   if (pd->devwidth) this->options |= NAND_BUSWIDTH_16;
   this->read_byte = (pd->devwidth) ? au_read_byte16 : au_read_byte;
   ctx->write_byte = (pd->devwidth) ? au_write_byte16 : au_write_byte;
   this->write_buf = (pd->devwidth) ? au_write_buf16 : au_write_buf;
   this->read_buf = (pd->devwidth) ? au_read_buf16 : au_read_buf;
-  ret = nand_scan(mtd, 1);
+  ret = nand_scan(this, 1);
   if (ret) {
     dev_err(&pdev->dev, "NAND scan failed with %d\n", ret);
     goto out3;
   }
   mtd_device_register(mtd, pd->parts, pd->num_parts);
   platform_set_drvdata(pdev, ctx);
   return 0;
 out3:
   iounmap(ctx->base);
 out2:
   release_mem_region(r->start, resource_size(r));
 out1:
   kfree(ctx);
   return ret;
 }<sep>@@
expression board_mtd,this;
@@
board_mtd = nand_to_mtd(this)
...
-        nand_scan (board_mtd, 1)
+        nand_scan (this, 1)