firmware: introduce device_cache/uncache_fw_images
authorMing Lei <ming.lei@canonical.com>
Sat, 4 Aug 2012 04:01:27 +0000 (12:01 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Aug 2012 20:44:44 +0000 (13:44 -0700)
commit37276a51f803ef63be988e26293ac85188475556
tree86c3daf910f4eb175d42c94e9bb58a9840d366e3
parentbddb1b9078505bb0e430c87c5015c0963f7a594f
firmware: introduce device_cache/uncache_fw_images

This patch introduces the three helpers below:

void device_cache_fw_images(void)
void device_uncache_fw_images(void)
void device_uncache_fw_images_delay(unsigned long)

so we can use device_cache_fw_images() to cache firmware for
all devices which need firmware to work, and the device driver
can get the firmware easily from kernel memory when system isn't
ready for completing requests of loading firmware.

After system is ready for completing firmware loading, driver core
will call device_uncache_fw_images() or its delay version to free
the cached firmware.

The above helpers will be used to cache device firmware during
system suspend/resume cycle in the following patches.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/firmware_class.c