Thread (37 messages) 37 messages, 9 authors, 2024-03-31

Re: [PATCH 01/22] virtio: store owner from modules with register_virtio_driver()

From: Stefano Garzarella <sgarzare@redhat.com>
Date: 2024-03-29 13:28:40
Also in: alsa-devel, dri-devel, kvm, linux-block, linux-bluetooth, linux-crypto, linux-doc, linux-fsdevel, linux-gpio, linux-iommu, linux-remoteproc, linux-scsi, linux-sound, linux-um, linux-wireless, lkml, nvdimm, v9fs, virtualization

On Fri, Mar 29, 2024 at 01:07:31PM +0100, Krzysztof Kozlowski wrote:
On 29/03/2024 12:42, Stefano Garzarella wrote:
quoted
quoted
};

-int register_virtio_driver(struct virtio_driver *driver)
+int __register_virtio_driver(struct virtio_driver *driver, struct module *owner)
{
	/* Catch this early. */
	BUG_ON(driver->feature_table_size && !driver->feature_table);
	driver->driver.bus = &virtio_bus;
+	driver->driver.owner = owner;
+
`.driver.name =  KBUILD_MODNAME` also seems very common, should we put
that in the macro as well?
This is a bit different thing. Every driver is expected to set owner to
itself (THIS_MODULE), but is every driver name KBUILD_MODNAME?
Nope, IIUC we have 2 exceptions:
- drivers/firmware/arm_scmi/virtio.c
- arch/um/drivers/virt-pci.c
Remember that this overrides whatever driver actually put there.
They can call __register_virtio_driver() where we can add the `name`
parameter. That said, I don't have a strong opinion, we can leave it
as it is.

Thanks,
Stefano
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help