[PATCH 0/5] driver core: class: allow struct class to be static

From: Greg Kroah-Hartman
Date: Sun Apr 02 2023 - 13:59:38 EST


There's been a semi-slow drip of driver core struct class changes
recently, and here's the final bit to the core that makes it possible
for 'struct class' to be moved into read-only memory. And as proof, the
last patch in the series does just that for the tty classes.

After this series, there's some tree-wide cleanups needed to move away
from the class_create() api back to class_register() to move the
structures into read-only memory. The class_create() api was a good
idea when it was created (as struct class was a dynamic structure), but
that got changed a long time ago and that's not necessary anymore. But
that can wait for after 6.4-rc1 is out as they can all go through the
different relevant subsystems if wanted.

All of these apply on top of my latest driver-core.git driver-core-next
branch (or linux-next), as they require the current set of struct class
and struct bus_type reworks and have been tested locally (I'm typing
this and will send them out on a kernel running these changes).

Greg Kroah-Hartman (5):
driver core: class: mark class_release() as taking a const *
driver core: class: make class_register() take a const *
driver core: class: mark the struct class in struct class_interface
constant
driver core: class: remove struct class_interface * from callbacks
tty: make tty_class a static const structure

drivers/base/base.h | 2 +-
drivers/base/class.c | 14 +++++++-------
drivers/base/core.c | 10 ++++------
drivers/hwmon/drivetemp.c | 4 ++--
drivers/net/rionet.c | 3 +--
drivers/ntb/hw/mscc/ntb_hw_switchtec.c | 6 ++----
drivers/pcmcia/cs.c | 2 +-
drivers/pcmcia/ds.c | 6 ++----
drivers/pcmcia/rsrc_nonstatic.c | 6 ++----
drivers/rapidio/devices/rio_mport_cdev.c | 7 ++-----
drivers/rapidio/rio_cm.c | 8 ++------
drivers/scsi/ses.c | 6 ++----
drivers/scsi/sg.c | 8 ++++----
drivers/tty/pty.c | 2 +-
drivers/tty/tty_io.c | 24 +++++++++++-------------
drivers/tty/vt/vt.c | 2 +-
include/linux/device/class.h | 10 +++++-----
include/linux/tty.h | 2 +-
kernel/time/alarmtimer.c | 3 +--
19 files changed, 52 insertions(+), 73 deletions(-)

--
2.40.0