Skip to content

Commit

Permalink
Bluetooth: constify the struct device_type usage
Browse files Browse the repository at this point in the history
Since commit aed65af ("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>
  • Loading branch information
Ricardo B. Marliere authored and Luiz Augusto von Dentz committed Mar 6, 2024
1 parent f9183ea commit 412b894
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/bluetooth/6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};

Expand Down
2 changes: 1 addition & 1 deletion net/bluetooth/bnep/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};

Expand Down

0 comments on commit 412b894

Please sign in to comment.