summaryrefslogtreecommitdiffstats
path: root/drivers/block/efi-block-io.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-06-07 14:07:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-06-12 14:59:54 +0200
commit76cb48c89147763ceb634d69141a28c9261254cb (patch)
treebf3242c811b2666bd1810d0a52683054e2a16579 /drivers/block/efi-block-io.c
parentec34c2f5333adfee4724a53f23a0e82c4dd3bef2 (diff)
downloadbarebox-76cb48c89147763ceb634d69141a28c9261254cb.tar.gz
barebox-76cb48c89147763ceb634d69141a28c9261254cb.tar.xz
block: parse partition table on block device registration
Every instance of block device registration is followed by an attempt to parse the partition table. Thus move partition table parsing into blockdevice_register. We do away with the warning print as it's superfluous: parse_partition_table doesn't return an error if partition table is missing and all other errors already result in an error message. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230607120714.3083182-13-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.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/block/efi-block-io.c b/drivers/block/efi-block-io.c
index eb4981e862..79a62d53d3 100644
--- a/drivers/block/efi-block-io.c
+++ b/drivers/block/efi-block-io.c
@@ -12,7 +12,6 @@
#include <fcntl.h>
#include <efi.h>
#include <block.h>
-#include <disks.h>
#include <efi/efi-payload.h>
#include <efi/efi-device.h>
#include <bootsource.h>
@@ -147,7 +146,6 @@ static bool is_bio_usbdev(struct efi_device *efidev)
static int efi_bio_probe(struct efi_device *efidev)
{
- int ret;
int instance;
struct efi_bio_priv *priv;
struct efi_block_io_media *media;
@@ -184,16 +182,10 @@ static int efi_bio_probe(struct efi_device *efidev)
priv->media_id = media->media_id;
- ret = blockdevice_register(&priv->blk);
- if (ret)
- return ret;
-
if (efi_get_bootsource() == efidev)
bootsource_set_raw_instance(instance);
- parse_partition_table(&priv->blk);
-
- return 0;
+ return blockdevice_register(&priv->blk);
}
static struct efi_driver efi_bio_driver = {