[PATCH 10/13] virtio: Set the log-category for all drivers

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Wed May 27 20:43:58 CEST 2026


On 5/27/26 18:10, Simon Glass wrote:
> Most drivers have the log-category set but not all. Fill this in for
> the rest.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>

I can't find any use of logging functions in the changed drivers.
So why change them?

Better remove unused #include <log.h>.

Best regards

Heinrich

> ---
> 
>   drivers/virtio/virtio_mmio.c       | 2 ++
>   drivers/virtio/virtio_net.c        | 2 ++
>   drivers/virtio/virtio_pci_legacy.c | 2 ++
>   drivers/virtio/virtio_pci_modern.c | 2 ++
>   drivers/virtio/virtio_ring.c       | 2 ++
>   drivers/virtio/virtio_sandbox.c    | 2 ++
>   6 files changed, 12 insertions(+)
> 
> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> index e66b8d244fb..496d26b4dd4 100644
> --- a/drivers/virtio/virtio_mmio.c
> +++ b/drivers/virtio/virtio_mmio.c
> @@ -7,6 +7,8 @@
>    * Ported from Linux drivers/virtio/virtio_mmio.c
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <dm.h>
>   #include <log.h>
>   #include <virtio_types.h>
> diff --git a/drivers/virtio/virtio_net.c b/drivers/virtio/virtio_net.c
> index 71e4d251396..7a94c8a528f 100644
> --- a/drivers/virtio/virtio_net.c
> +++ b/drivers/virtio/virtio_net.c
> @@ -4,6 +4,8 @@
>    * Copyright (C) 2018, Bin Meng <bmeng.cn at gmail.com>
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <dm.h>
>   #include <net.h>
>   #include <virtio_types.h>
> diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
> index fe3e3b475ea..4713c12e7ac 100644
> --- a/drivers/virtio/virtio_pci_legacy.c
> +++ b/drivers/virtio/virtio_pci_legacy.c
> @@ -6,6 +6,8 @@
>    * Ported from Linux drivers/virtio/virtio_pci*.c
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <dm.h>
>   #include <log.h>
>   #include <virtio_types.h>
> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
> index 5850e0c18c6..4ce68920c6d 100644
> --- a/drivers/virtio/virtio_pci_modern.c
> +++ b/drivers/virtio/virtio_pci_modern.c
> @@ -6,6 +6,8 @@
>    * Ported from Linux drivers/virtio/virtio_pci*.c
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <dm.h>
>   #include <log.h>
>   #include <virtio_types.h>
> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
> index 3a40b12f6e5..17e351ca2be 100644
> --- a/drivers/virtio/virtio_ring.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -6,6 +6,8 @@
>    * virtio ring implementation
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <bouncebuf.h>
>   #include <dm.h>
>   #include <log.h>
> diff --git a/drivers/virtio/virtio_sandbox.c b/drivers/virtio/virtio_sandbox.c
> index 0f1ebef22e5..6767e5bd5fe 100644
> --- a/drivers/virtio/virtio_sandbox.c
> +++ b/drivers/virtio/virtio_sandbox.c
> @@ -5,6 +5,8 @@
>    * VirtIO Sandbox transport driver, for testing purpose only
>    */
>   
> +#define LOG_CATEGORY	UCLASS_VIRTIO
> +
>   #include <dm.h>
>   #include <virtio_types.h>
>   #include <virtio.h>



More information about the U-Boot mailing list