Now that the driver code has been refactored to not rely on the pointer
from a struct bus_type to the private structure it can be safely removed
from the structure entirely.
This will allow most bus_type structures to now be marked as const.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230208111330.439504-18-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static void bus_release(struct kobject *kobj)
{
struct subsys_private *priv = to_subsys_private(kobj);
- struct bus_type *bus = priv->bus;
lockdep_unregister_key(&priv->lock_key);
kfree(priv);
- bus->p = NULL;
}
static const struct kobj_type bus_ktype = {
return -ENOMEM;
priv->bus = bus;
- bus->p = priv;
BLOCKING_INIT_NOTIFIER_HEAD(&priv->bus_notifier);
kset_unregister(&priv->subsys);
out:
kfree(priv);
- bus->p = NULL;
return retval;
}
EXPORT_SYMBOL_GPL(bus_register);
* @iommu_ops: IOMMU specific operations for this bus, used to attach IOMMU
* driver implementations to a bus and allow the driver to do
* bus-specific setup
- * @p: The private data of the driver core, only the driver core can
- * touch this.
* @lock_key: Lock class key for use by the lock validator
* @need_parent_lock: When probing or removing a device on this bus, the
* device core should lock the device's parent.
const struct iommu_ops *iommu_ops;
- struct subsys_private *p;
-
bool need_parent_lock;
};