]> rtime.felk.cvut.cz Git - linux-imx.git/commit
Driver core: Introduce offline/online callbacks for memory blocks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 8 May 2013 12:18:37 +0000 (14:18 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 12 May 2013 12:14:45 +0000 (14:14 +0200)
commit4960e05e22604ee270a023f968e0e4f9bd0c6fef
treeabdc39a81c6ab9868bc75f0f50ddedb7fcb10f9b
parente2ff39400d81233374e780b133496a2296643d7d
Driver core: Introduce offline/online callbacks for memory blocks

Introduce .offline() and .online() callbacks for memory_subsys
that will allow the generic device_offline() and device_online()
to be used with device objects representing memory blocks.  That,
in turn, allows the ACPI subsystem to use device_offline() to put
removable memory blocks offline, if possible, before removing
memory modules holding them.

The 'online' sysfs attribute of memory block devices will attempt to
put them offline if 0 is written to it and will attempt to apply the
previously used online type when onlining them (i.e. when 1 is
written to it).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
drivers/base/memory.c
include/linux/memory.h