Skip to content

Commit e1be24b

Browse files
committed
platform/surface: aggregator: make ssam_bus_type constant and static
Now that the driver core can properly handle constant struct bus_type, move the ssam_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. It's also never used outside of drivers/platform/surface/aggregator/bus.c so make it static and don't export it as no one is using it. Cc: Maximilian Luz <luzmaximilian@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Cc: <platform-driver-x86@vger.kernel.org> Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/2023121957-tapered-upswing-8326@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e68f487 commit e1be24b

File tree

2 files changed

+3
-3
lines changed
  • drivers/platform/surface/aggregator
  • include/linux/surface_aggregator

2 files changed

+3
-3
lines changed

drivers/platform/surface/aggregator/bus.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ static struct attribute *ssam_device_attrs[] = {
3535
};
3636
ATTRIBUTE_GROUPS(ssam_device);
3737

38+
static const struct bus_type ssam_bus_type;
39+
3840
static int ssam_device_uevent(const struct device *dev, struct kobj_uevent_env *env)
3941
{
4042
const struct ssam_device *sdev = to_ssam_device(dev);
@@ -329,13 +331,12 @@ static void ssam_bus_remove(struct device *dev)
329331
sdrv->remove(to_ssam_device(dev));
330332
}
331333

332-
struct bus_type ssam_bus_type = {
334+
static const struct bus_type ssam_bus_type = {
333335
.name = "surface_aggregator",
334336
.match = ssam_bus_match,
335337
.probe = ssam_bus_probe,
336338
.remove = ssam_bus_remove,
337339
};
338-
EXPORT_SYMBOL_GPL(ssam_bus_type);
339340

340341
/**
341342
* __ssam_device_driver_register() - Register a SSAM client device driver.

include/linux/surface_aggregator/device.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ struct ssam_device_driver {
193193

194194
#ifdef CONFIG_SURFACE_AGGREGATOR_BUS
195195

196-
extern struct bus_type ssam_bus_type;
197196
extern const struct device_type ssam_device_type;
198197

199198
/**

0 commit comments

Comments
 (0)