]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcma: don't register devices disabled in OF
authorRafał Miłecki <rafal@milecki.pl>
Fri, 3 Oct 2025 12:51:26 +0000 (14:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Dec 2025 21:12:39 +0000 (06:12 +0900)
[ Upstream commit a2a69add80411dd295c9088c1bcf925b1f4e53d7 ]

Some bus devices can be marked as disabled for specific SoCs or models.
Those should not be registered to avoid probing them.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20251003125126.27950-1-zajec5@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bcma/main.c

index 44392b624b200c01b69a84d1ea4f3e5b0e686ab6..11fbae15a78848472d29cf60152557ecf0d6503a 100644 (file)
@@ -293,6 +293,8 @@ static int bcma_register_devices(struct bcma_bus *bus)
        int err;
 
        list_for_each_entry(core, &bus->cores, list) {
+               struct device_node *np;
+
                /* We support that core ourselves */
                switch (core->id.id) {
                case BCMA_CORE_4706_CHIPCOMMON:
@@ -310,6 +312,10 @@ static int bcma_register_devices(struct bcma_bus *bus)
                if (bcma_is_core_needed_early(core->id.id))
                        continue;
 
+               np = core->dev.of_node;
+               if (np && !of_device_is_available(np))
+                       continue;
+
                /* Only first GMAC core on BCM4706 is connected and working */
                if (core->id.id == BCMA_CORE_4706_MAC_GBIT &&
                    core->core_unit > 0)