]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ipmi:ssif: Remove dynamic platform device handing
authorCorey Minyard <cminyard@mvista.com>
Wed, 27 May 2020 23:25:56 +0000 (18:25 -0500)
committerCorey Minyard <cminyard@mvista.com>
Wed, 27 May 2020 23:25:56 +0000 (18:25 -0500)
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 <cminyard@mvista.com>
drivers/char/ipmi/ipmi_ssif.c

index 6fffeb241f45f894bef7d8d8523976db794dbb4a..198b65d45c5e68a45790433179f25022db055e4b 100644 (file)
@@ -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);