FwupdPlugin.Device.prepare_firmware

### Method

# FwupdPlugin Deviceprepare_firmware

#### Declaration [src]

    FuFirmware*
    fu_device_prepare_firmware (
      FuDevice* self,
      GBytes* fw,
      FwupdInstallFlags flags,
      GError** error
    )

#### Description [src]

Prepares the firmware by calling an optional device-specific vfunc for the device, which can do things like decompressing or parsing of the firmware data.

For all firmware, this checks the size of the firmware if limits have been set using fu_device_set_firmware_size_min(), `fu_device_set_firmware_size_max()` or using a quirk entry.

Available since: | 1.1.2

#### Parameters

`fw` | `GBytes`
| Firmware blob.
| The data is owned by the caller of the function.
`flags` | `FwupdInstallFlags`
| Install flags, e.g. `FWUPD_INSTALL_FLAG_FORCE`.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `FuFirmware`
| A new `GBytes`, or `NULL` for error.
| The caller of the method takes ownership of the data, and is responsible for freeing it.