aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/memory.c11
-rw-r--r--include/linux/memory.h1
2 files changed, 2 insertions, 10 deletions
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index c8f3b63fcacd..c7092bc3c01e 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -291,13 +291,7 @@ static int __memory_block_change_state(struct memory_block *mem,
291 mem->state = MEM_GOING_OFFLINE; 291 mem->state = MEM_GOING_OFFLINE;
292 292
293 ret = memory_block_action(mem->start_section_nr, to_state, online_type); 293 ret = memory_block_action(mem->start_section_nr, to_state, online_type);
294 if (ret) { 294 mem->state = ret ? from_state_req : to_state;
295 mem->state = from_state_req;
296 } else {
297 mem->state = to_state;
298 if (to_state == MEM_ONLINE)
299 mem->last_online = online_type;
300 }
301 return ret; 295 return ret;
302} 296}
303 297
@@ -310,7 +304,7 @@ static int memory_subsys_online(struct device *dev)
310 304
311 ret = mem->state == MEM_ONLINE ? 0 : 305 ret = mem->state == MEM_ONLINE ? 0 :
312 __memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE, 306 __memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE,
313 mem->last_online); 307 ONLINE_KEEP);
314 308
315 mutex_unlock(&mem->state_mutex); 309 mutex_unlock(&mem->state_mutex);
316 return ret; 310 return ret;
@@ -618,7 +612,6 @@ static int init_memory_block(struct memory_block **memory,
618 base_memory_block_id(scn_nr) * sections_per_block; 612 base_memory_block_id(scn_nr) * sections_per_block;
619 mem->end_section_nr = mem->start_section_nr + sections_per_block - 1; 613 mem->end_section_nr = mem->start_section_nr + sections_per_block - 1;
620 mem->state = state; 614 mem->state = state;
621 mem->last_online = ONLINE_KEEP;
622 mem->section_count++; 615 mem->section_count++;
623 mutex_init(&mem->state_mutex); 616 mutex_init(&mem->state_mutex);
624 start_pfn = section_nr_to_pfn(mem->start_section_nr); 617 start_pfn = section_nr_to_pfn(mem->start_section_nr);
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 3d5346583022..85c31a8e2904 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -26,7 +26,6 @@ struct memory_block {
26 unsigned long start_section_nr; 26 unsigned long start_section_nr;
27 unsigned long end_section_nr; 27 unsigned long end_section_nr;
28 unsigned long state; 28 unsigned long state;
29 int last_online;
30 int section_count; 29 int section_count;
31 30
32 /* 31 /*