/* cmm_memory_cb - Handle memory hotplug notifier calls @self: notifier block struct @action: action to take  */
static int cmm_memory_cb(struct notifier_block *self, unsigned long action, void *arg)
/* cmm_memory_cb - Handle memory hotplug notifier calls @self: notifier block struct @action: action to take  */
static int cmm_memory_cb(struct notifier_block *self, unsigned long action, void *arg)
{
	int ret = 0;
	switch (action) {
	case MEM_GOING_OFFLINE:
		mutex_lock(&hotplug_mutex);
		hotplug_occurred = 1;
		ret = cmm_mem_going_offline(arg);
		break;
	case MEM_OFFLINE:
	case MEM_CANCEL_OFFLINE:
		mutex_unlock(&hotplug_mutex);
		cmm_dbg("Memory offline operation complete.\n");
		break;
	case MEM_GOING_ONLINE:
	case MEM_ONLINE:
	case MEM_CANCEL_ONLINE:
		break;
	}
	if (ret)
		ret = notifier_from_errno(ret);
	else
		ret = NOTIFY_OK;
	return ret;
}