From d03adb4a78d18b5506350b3ac72ab2f18f1ed160 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 16 Dec 2020 21:20:08 -0700 Subject: dm: core: Update uclass_find_next_free_req_seq() args At present this is passed a uclass ID and it has to do a lookup. The callers all have the uclass pointer, except for the I2C uclass where the code will soon be deleted. Update the argument to a uclass * instead of an ID since it is more efficient. Signed-off-by: Simon Glass --- drivers/i2c/designware_i2c_pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/designware_i2c_pci.c b/drivers/i2c/designware_i2c_pci.c index 8d7b1fe6df..3c15320674 100644 --- a/drivers/i2c/designware_i2c_pci.c +++ b/drivers/i2c/designware_i2c_pci.c @@ -90,7 +90,9 @@ static int designware_i2c_pci_probe(struct udevice *dev) static int designware_i2c_pci_bind(struct udevice *dev) { + struct uclass *uc; char name[20]; + int ret; if (dev_of_valid(dev)) return 0; @@ -108,7 +110,11 @@ static int designware_i2c_pci_bind(struct udevice *dev) * be possible. We cannot use static data in drivers since they may be * used in SPL or before relocation. */ - dev->req_seq = uclass_find_next_free_req_seq(UCLASS_I2C); + ret = uclass_get(UCLASS_I2C, &uc); + if (ret) + return ret; + + dev->req_seq = uclass_find_next_free_req_seq(uc); sprintf(name, "i2c_designware#%u", dev->req_seq); device_set_name(dev, name); -- cgit v1.2.3