Bluetooth: constify the struct device_type usage

Since commit aed65af1cc ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the bt_type and
bnep_type variables to be constant structures as well, placing it into
read-only memory which can not be modified at runtime.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Ricardo B. Marliere 2024-02-19 16:46:57 -03:00 committed by Luiz Augusto von Dentz
parent f9183eaad9
commit 412b894a18
2 changed files with 2 additions and 2 deletions

View File

@ -572,7 +572,7 @@ static void netdev_setup(struct net_device *dev)
dev->needs_free_netdev = true;
}
static struct device_type bt_type = {
static const struct device_type bt_type = {
.name = "bluetooth",
};

View File

@ -549,7 +549,7 @@ static struct device *bnep_get_device(struct bnep_session *session)
return &conn->hcon->dev;
}
static struct device_type bnep_type = {
static const struct device_type bnep_type = {
.name = "bluetooth",
};