From 92d8eb861c8ab4f11b18aa4e535fb21e7997fc13 Mon Sep 17 00:00:00 2001 From: Corey Minyard Date: Wed, 27 May 2020 18:25:56 -0500 Subject: [PATCH] ipmi:ssif: Remove dynamic platform device handing Platform devices can only come in through the DMI interface, and that will get done before initialization is complete. Therefore there is no reason to hande getting a device in new_ssif_client after initialization. Dynamic entries can still come in through the i2c interfaces, but that's handled differently. Signed-off-by: Corey Minyard --- drivers/char/ipmi/ipmi_ssif.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 6fffeb241f45f..198b65d45c5e6 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -189,8 +189,6 @@ struct ssif_addr_info { struct device *dev; struct i2c_client *client; - struct i2c_client *added_client; - struct mutex clients_mutex; struct list_head clients; @@ -1941,21 +1939,6 @@ out_remove_attr: goto out; } -static int ssif_adapter_handler(struct device *adev, void *opaque) -{ - struct ssif_addr_info *addr_info = opaque; - - if (adev->type != &i2c_adapter_type) - return 0; - - addr_info->added_client = i2c_new_client_device(to_i2c_adapter(adev), - &addr_info->binfo); - - if (!addr_info->adapter_name) - return 1; /* Only try the first I2C adapter by default. */ - return 0; -} - static int new_ssif_client(int addr, char *adapter_name, int debug, int slave_addr, enum ipmi_addr_src addr_src, @@ -1999,9 +1982,7 @@ static int new_ssif_client(int addr, char *adapter_name, list_add_tail(&addr_info->link, &ssif_infos); - if (initialized) - i2c_for_each_dev(addr_info, ssif_adapter_handler); - /* Otherwise address list will get it */ + /* Address list will get it */ out_unlock: mutex_unlock(&ssif_infos_mutex); @@ -2121,8 +2102,6 @@ static int ssif_platform_remove(struct platform_device *dev) return 0; mutex_lock(&ssif_infos_mutex); - i2c_unregister_device(addr_info->added_client); - list_del(&addr_info->link); kfree(addr_info); mutex_unlock(&ssif_infos_mutex); -- 2.39.5