[PATCH] drivers: core: Add more print info for bus remove and driver remove

Angus Chen posted 1 patch 1 year, 3 months ago
drivers/base/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] drivers: core: Add more print info for bus remove and driver remove
Posted by Angus Chen 1 year, 3 months ago
When enable initcall_debug,some devices call bus remove,
Some devices call driver remove.

Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
---
 drivers/base/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 8c0733d3aad8..ff965cd51bcf 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4833,11 +4833,11 @@ void device_shutdown(void)
 		}
 		if (dev->bus && dev->bus->shutdown) {
 			if (initcall_debug)
-				dev_info(dev, "shutdown\n");
+				dev_info(dev, "call bus shutdown\n");
 			dev->bus->shutdown(dev);
 		} else if (dev->driver && dev->driver->shutdown) {
 			if (initcall_debug)
-				dev_info(dev, "shutdown\n");
+				dev_info(dev, "call driver shutdown\n");
 			dev->driver->shutdown(dev);
 		}
 
-- 
2.34.1
Re: [PATCH] drivers: core: Add more print info for bus remove and driver remove
Posted by Greg KH 1 year, 3 months ago
On Tue, Aug 27, 2024 at 08:52:44PM +0800, Angus Chen wrote:
> When enable initcall_debug,some devices call bus remove,
> Some devices call driver remove.
> 
> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
> ---
>  drivers/base/core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 8c0733d3aad8..ff965cd51bcf 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -4833,11 +4833,11 @@ void device_shutdown(void)
>  		}
>  		if (dev->bus && dev->bus->shutdown) {
>  			if (initcall_debug)
> -				dev_info(dev, "shutdown\n");
> +				dev_info(dev, "call bus shutdown\n");
>  			dev->bus->shutdown(dev);
>  		} else if (dev->driver && dev->driver->shutdown) {
>  			if (initcall_debug)
> -				dev_info(dev, "shutdown\n");
> +				dev_info(dev, "call driver shutdown\n");

I do not understand, why is this needed?  Who needs it and what is going
to rely on it?

Really, this should be moved to dev_dbg() instead, right?

thanks,

greg k-h