@@ -83,9 +83,6 @@ enum driver_data_priv_reqs {
* @mode: mode of operation
* @priv_reqs: private set of &enum driver_data_reqs, private requirements for
* the driver data request
- * @alloc_buf: buffer area allocated by the caller so we can place the
- * respective driver data
- * @alloc_buf_size: size of the @alloc_buf
* @old_async_cb: used only for request_firmware_nowait() since we won't change
* all async callbacks to get the return value on failure
* @api: used internally for keeping track of the currently evaluated API
@@ -98,8 +95,6 @@ enum driver_data_priv_reqs {
struct driver_data_priv_params {
enum driver_data_mode mode;
u64 priv_reqs;
- void *alloc_buf;
- size_t alloc_buf_size;
void (*old_async_cb)(const struct firmware *driver_data, void *context);
u8 api;
bool retry_api;
@@ -149,12 +144,12 @@ struct driver_data_params {
#define __DATA_REQ_FIRMWARE_BUF(buf, size) \
.req_params = { \
.reqs = DRIVER_DATA_REQ_NO_CACHE, \
+ .alloc_buf = &buf, \
+ .alloc_buf_size = size, \
}, \
.priv_params = { \
.priv_reqs = DRIVER_DATA_PRIV_REQ_FALLBACK | \
DRIVER_DATA_PRIV_REQ_FALLBACK_UEVENT, \
- .alloc_buf = buf, \
- .alloc_buf_size = size, \
}
#define __DATA_REQ_FIRMWARE_NOWAIT(module, uevent, gfp, async_cb, async_ctx) \
@@ -265,9 +260,9 @@ static bool fw_get_builtin_firmware(struct firmware *fw, const char *name,
void *buf;
size_t size;
- if (data_params) {
- buf = data_params->priv_params.alloc_buf;
- size = data_params->priv_params.alloc_buf_size;
+ if (data_params && data_params->req_params.alloc_buf) {
+ buf = *data_params->req_params.alloc_buf;
+ size = data_params->req_params.alloc_buf_size;
} else {
buf = NULL;
size = 0;
@@ -507,9 +502,9 @@ static struct firmware_buf *__allocate_fw_buf(const char *fw_name,
void *dbuf;
size_t size;
- if (data_params) {
- dbuf = data_params->priv_params.alloc_buf;
- size = data_params->priv_params.alloc_buf_size;
+ if (data_params && data_params->req_params.alloc_buf) {
+ dbuf = *data_params->req_params.alloc_buf;
+ size = data_params->req_params.alloc_buf_size;
} else {
dbuf = NULL;
size = 0;
@@ -144,6 +144,9 @@ enum driver_data_reqs {
* highest version of API supported by the caller.
* @api_name_postfix: optional, indicates to use this as the driver data name
* postfix when %DRIVER_DATA_REQ_USE_API_VERSIONING is enabled.
+ * @alloc_buf: pointer of pointer to the buffer area allocated by the caller
+ * so we can place the respective driver data
+ * @alloc_buf_size: size of the @alloc_buf
*
* This data structure is intended to carry all requirements and specifications
* required to complete the task to get the requested driver date file to the
@@ -157,6 +160,8 @@ struct driver_data_req_params {
u8 api_max;
const char *api_name_postfix;
const union driver_data_cbs cbs;
+ void **alloc_buf;
+ size_t alloc_buf_size;
};
/*