### Method

# FwupdPlugin Device prepare_firmware

#### Declaration [src]

    FuFirmware*
    fu_device_prepare_firmware (
      FuDevice* self,
      GInputStream* stream,
      FuProgress* progress,
      guint64 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

`stream` | `GInputStream`
| A `GInputStream`.
| The data is owned by the caller of the function.
`progress` | `FuProgress`
| No description available.
| The data is owned by the caller of the function.
`flags` | `guint64`
| `FuFirmwareParseFlags`, 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.