1

pcmcia: ds: make pcmcia_bus_type const

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

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Ricardo B. Marliere 2024-02-13 11:48:45 -03:00 committed by Dominik Brodowski
parent c02197fc90
commit 1bec7691b3
2 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ void pcmcia_put_socket(struct pcmcia_socket *skt);
* Stuff internal to module "pcmcia".
*/
/* ds.c */
extern struct bus_type pcmcia_bus_type;
extern const struct bus_type pcmcia_bus_type;
struct pcmcia_device;

View File

@ -1406,7 +1406,7 @@ static const struct dev_pm_ops pcmcia_bus_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pcmcia_dev_suspend, pcmcia_dev_resume)
};
struct bus_type pcmcia_bus_type = {
const struct bus_type pcmcia_bus_type = {
.name = "pcmcia",
.uevent = pcmcia_bus_uevent,
.match = pcmcia_bus_match,