[PATCH] Print some info into ring-buffer during loading

From: root
Date: Sun Jun 19 2022 - 04:32:21 EST


---
drivers/i2c/i2c-core-base.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index d43db2c3876e..8e127ff3e32e 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -469,6 +469,8 @@ static int i2c_device_probe(struct device *dev)
struct i2c_driver *driver;
int status;

+ pr_info("I have changed i2c device driver\n");
+
if (!client)
return 0;

@@ -1829,6 +1831,7 @@ int i2c_for_each_dev(void *data, int (*fn)(struct device *dev, void *data))
int res;

mutex_lock(&core_lock);
+ pr_info("i2c_for_each_dev: before bus_for_each_dev\n");
res = bus_for_each_dev(&i2c_bus_type, NULL, data, fn);
mutex_unlock(&core_lock);

@@ -1838,8 +1841,10 @@ EXPORT_SYMBOL_GPL(i2c_for_each_dev);

static int __process_new_driver(struct device *dev, void *data)
{
+ pr_info("Enter process_new_driver\n");
if (dev->type != &i2c_adapter_type)
return 0;
+ pr_info("__process_new_driver, before i2c_do_add_adapter\n");
return i2c_do_add_adapter(data, to_i2c_adapter(dev));
}

@@ -1860,13 +1865,16 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
driver->driver.owner = owner;
driver->driver.bus = &i2c_bus_type;
INIT_LIST_HEAD(&driver->clients);
-
+ pr_info("i2c driver name is [%s] before driver_register\n", driver->driver.name);
/* When registration returns, the driver core
* will have called probe() for all matching-but-unbound devices.
*/
res = driver_register(&driver->driver);
- if (res)
+ if (res){
+ pr_info("i2c driver name is [%s], res is [%d]\n", driver->driver.name, res);
return res;
+ }
+ pr_info("i2c driver name is [%s], after driver_register\n", driver->driver.name);

pr_debug("driver [%s] registered\n", driver->driver.name);

@@ -1933,7 +1941,7 @@ EXPORT_SYMBOL(i2c_clients_command);
static int __init i2c_init(void)
{
int retval;
-
+ pr_info("Jason-Lee: Entering i2c_init\n");
retval = of_alias_get_highest_id("i2c");

down_write(&__i2c_board_lock);
--
2.25.1