mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH master 2/3] efi: acpi: add SDT resource before registering device
Date: Mon,  9 Jan 2023 09:35:59 +0100	[thread overview]
Message-ID: <20230109083600.1820078-2-ahmad@a3f.at> (raw)
In-Reply-To: <20230109083600.1820078-1-ahmad@a3f.at>

Registering a device may end up probing the device if a driver is
readily available. This necessitates the device having its resources
assigned before doing the registration.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/bus/acpi.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/bus/acpi.c b/drivers/bus/acpi.c
index 354a6119b92f..f69789200633 100644
--- a/drivers/bus/acpi.c
+++ b/drivers/bus/acpi.c
@@ -122,18 +122,12 @@ static void acpi_devinfo(struct device *dev)
 
 static int acpi_register_device(struct device *dev, struct acpi_sdt *sdt)
 {
-	int ret;
-
-	ret = register_device(dev);
-	if (ret)
-		return ret;
-
 	device_add_resource(dev, "SDT", (resource_size_t)sdt, sdt->len,
 		IORESOURCE_MEM | IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY);
 
-	dev_dbg(dev, "registered as ACPI device\n");
+	dev_dbg(dev, "registering as ACPI device\n");
 
-	return 0;
+	return register_device(dev);
 }
 
 static struct device *acpi_add_device(struct bus_type *bus,
-- 
2.38.1




  reply	other threads:[~2023-01-09  8:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  8:35 [PATCH master 1/3] driver: have dev_name(unregistered device) behave as expected Ahmad Fatoum
2023-01-09  8:35 ` Ahmad Fatoum [this message]
2023-01-09  8:36 ` [PATCH master 3/3] reset: core: support deep probe with resets registered in CLK_OF_DECLARE Ahmad Fatoum
2023-01-09  9:12 ` [PATCH master 1/3] driver: have dev_name(unregistered device) behave as expected Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230109083600.1820078-2-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox