mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rodríguez Barbarin, José Javier" <josejavier.rodriguez@duagon.com>
To: "morbidrsa@gmail.com" <morbidrsa@gmail.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"jth@kernel.org" <jth@kernel.org>,
	"Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>,
	"Rodríguez Barbarin,
	José Javier" <josejavier.rodriguez@duagon.com>,
	"Sanjuán García, Jorge" <Jorge.SanjuanGarcia@duagon.com>
Subject: [PATCH 1/1] mcb: Use the actual bus passed to init and release functions
Date: Fri, 20 Oct 2023 12:44:32 +0000	[thread overview]
Message-ID: <20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com> (raw)
In-Reply-To: <20231020124324.54692-1-JoseJavier.Rodriguez@duagon.com>

The functions mcb_bus_add_devices() and mcb_devices_unregister()
take a mcb_bus as argument that is never being used. This implies
that there is only one bus.

Do not ignore mcb_bus parameter and get the actual bus_type from
the device related to this mcb_bus.

Co-developed-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com>
---
 drivers/mcb/mcb-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index 5c6157b0db75..2a4a5e71ad4e 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -311,7 +311,7 @@ static int __mcb_devices_unregister(struct device *dev, void *data)
 
 static void mcb_devices_unregister(struct mcb_bus *bus)
 {
-	bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_devices_unregister);
+	bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_devices_unregister);
 }
 /**
  * mcb_release_bus() - Free a @mcb_bus
@@ -406,7 +406,7 @@ static int __mcb_bus_add_devices(struct device *dev, void *data)
  */
 void mcb_bus_add_devices(const struct mcb_bus *bus)
 {
-	bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_bus_add_devices);
+	bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_bus_add_devices);
 }
 EXPORT_SYMBOL_NS_GPL(mcb_bus_add_devices, MCB);
 
-- 
2.34.1

      reply	other threads:[~2023-10-20 12:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 12:44 [PATCH 0/1] mcb: better use of buses when registering mcb devices Rodríguez Barbarin, José Javier
2023-10-20 12:44 ` Rodríguez Barbarin, José Javier [this message]

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=20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com \
    --to=josejavier.rodriguez@duagon.com \
    --cc=Jorge.SanjuanGarcia@duagon.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jth@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=morbidrsa@gmail.com \
    /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

all inboxes | Powered by JetHome®