25 Sep
2012
25 Sep
'12
1:26 p.m.
On Thu, Sep 20, 2012 at 08:29:17PM -0700, Ian Minett wrote:
+static int request_firmware_cached(const struct firmware **firmware_p,
- const char *name, struct device *device)
+{
- if (*firmware_p)
return 0; /* already loaded */
- return request_firmware(firmware_p, name, device);
+}
This looks *awfully* like it should be a part of the generic firmware loading infrastructure rather than driver local (the name of the function is even likely to collide with something in the core code).
More generally, why is this driver different to other Linux drivers which don't normally cache the firmware? There's some uses for this (see all the hassle with suspend and resume on USB devices...) so it seems like it'd be useful to have in the framework, possibly as the default behaviour and probably with a mechanism to discard the firmware.