diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2019-12-04 13:56:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-12-09 10:27:35 +0100 |
commit | ca79508e0f717a62e5302330b4a62b2f28a1b032 (patch) | |
tree | db0f027a5668d6a03213241e8df9bb4ed2713cc0 /drivers/block/efi-block-io.c | |
parent | a62aab160e1f380c94972273a6347aa5a07f0809 (diff) | |
download | barebox-ca79508e0f717a62e5302330b4a62b2f28a1b032.tar.gz barebox-ca79508e0f717a62e5302330b4a62b2f28a1b032.tar.xz |
efi: add and use new efi_device_has_guid helper
We have at least two places where we check if a efidev has a particular
guid and a follow-up commit will introduce a third place.
So lets factor it out into a helper.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/block/efi-block-io.c')
-rw-r--r-- | drivers/block/efi-block-io.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/block/efi-block-io.c b/drivers/block/efi-block-io.c index 39dbfb0f7a..30db486876 100644 --- a/drivers/block/efi-block-io.c +++ b/drivers/block/efi-block-io.c @@ -131,16 +131,9 @@ static void efi_bio_print_info(struct efi_bio_priv *priv) media->optimal_transfer_length_granularity); } -static int is_bio_usbdev(struct efi_device *efidev) +static bool is_bio_usbdev(struct efi_device *efidev) { - int i; - - for (i = 0; i < efidev->num_guids; i++) { - if (!efi_guidcmp(efidev->guids[i], EFI_USB_IO_PROTOCOL_GUID)) - return 1; - } - - return 0; + return efi_device_has_guid(efidev, EFI_USB_IO_PROTOCOL_GUID); } static int efi_bio_probe(struct efi_device *efidev) |