usb: gadget: UMS: support multiple sector sizes
UFS storage often uses a 4096-byte sector size, add support for dynamic sector sizes based loosely on the Linux implementation. Support for dynamic sector sizes changes the types used in some divisions, resulting in the compiler attempting to use libgcc helpers (__aeabi_ldivmod). Replace these divisions with calls to lldiv() to handle this correctly. Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Link: https://lore.kernel.org/r/20240320-b4-qcom-usb-v4-4-41be480172e1@linaro.org [mkorpershoek: squashed the lldiv() fix from caleb] Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
committed by
Mattijs Korpershoek
parent
341a172ef7
commit
304fa0aa44
@@ -88,10 +88,6 @@ static int ums_init(const char *devtype, const char *devnums_part_str)
|
||||
if (!strchr(devnum_part_str, ':'))
|
||||
partnum = 0;
|
||||
|
||||
/* f_mass_storage.c assumes SECTOR_SIZE sectors */
|
||||
if (block_dev->blksz != SECTOR_SIZE)
|
||||
goto cleanup;
|
||||
|
||||
ums_new = realloc(ums, (ums_count + 1) * sizeof(*ums));
|
||||
if (!ums_new)
|
||||
goto cleanup;
|
||||
|
||||
Reference in New Issue
Block a user