Skip to contentSkip to conversation

moxtet: remove unused moxtet_type declaration

PATCH New Greg Kroah-Hartman 1 participant 2 messages Dec 19, 2023 Arm/cz.nic turris support

lore
Share & tools
lore
#1 lore raw

PATCH 2/2 moxtet: mark moxtet_bus_type as const

In reply to Greg Kroah-Hartman

Now that the driver core can properly handle constant struct bus_type, move the moxtet_bus_type to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.

---
 drivers/bus/moxtet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/moxtet.c +1 -1
index 5eb0fe73ddc4..5e71b4c29992 100644
@@ -102,7 +102,7 @@ static int moxtet_match(struct device *dev, struct device_driver *drv)
 	return 0;
 }
 
-static struct bus_type moxtet_bus_type = {
+static const struct bus_type moxtet_bus_type = {
 	.name		= "moxtet",
 	.dev_groups	= moxtet_dev_groups,
 	.match		= moxtet_match,
Signature · 1 line
2.43.0
#0 lore raw

PATCH 1/2 moxtet: remove unused moxtet_type declaration

For some reason, moxtet_type was defined in moxtet.h, but never actually used. Looks like a left-over from the original commit that was exporting the moxtet bus type, but that wasn't needed, and it was a different variable name, so no one noticed this one dangling around.

---
 include/linux/moxtet.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/moxtet.h +0 -2
index 79184948fab4..ac577699edfd 100644
@@ -35,8 +35,6 @@ enum turris_mox_module_id {
 
 #define MOXTET_NIRQS	16
 
-extern struct bus_type moxtet_type;
-
 struct moxtet {
 	struct device			*dev;
 	struct mutex			lock;
Signature · 1 line
2.43.0