diff options
| author | Simon Glass <[email protected]> | 2024-08-22 07:55:02 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2024-08-23 15:58:42 -0600 |
| commit | 3fd11278ff43a5039e33a8cf04dc822711ea9694 (patch) | |
| tree | 62818649b8a5605cefe4795c0fb4a24b8a087e39 /drivers | |
| parent | 50a1ed4335045c57d9073a3fcd265edd89da924a (diff) | |
spl: Create a function to init spl_load_info
Rather than having every caller set this up individually, create a
common init function. This allows new fields to be added without the
risk of them being left uninited.
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Michael Trimarchi <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/gadget/f_sdp.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index 514c097591b..5d62eb475d0 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -842,9 +842,7 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image, struct spl_load_info load; debug("Found FIT\n"); - load.priv = header; - spl_set_bl_len(&load, 1); - load.read = sdp_load_read; + spl_load_init(&load, sdp_load_read, header, 1); spl_load_simple_fit(spl_image, &load, 0, header); @@ -855,9 +853,7 @@ static int sdp_handle_in_ep(struct spl_image_info *spl_image, valid_container_hdr((void *)header)) { struct spl_load_info load; - load.priv = header; - spl_set_bl_len(&load, 1); - load.read = sdp_load_read; + spl_load_init(&load, sdp_load_read, header, 1); spl_load_imx_container(spl_image, &load, 0); return SDP_EXIT; } |
