]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ipmi: Move bmc find routing to below bmc device type
authorCorey Minyard <cminyard@mvista.com>
Fri, 1 Sep 2017 15:43:49 +0000 (10:43 -0500)
committerCorey Minyard <cminyard@mvista.com>
Wed, 27 Sep 2017 21:03:45 +0000 (16:03 -0500)
No functional change, this is for a later change that uses the
bmc device type.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_msghandler.c

index dbf8c6ac8c7337f1a45fb39ad288e1bc4e08f13b..5780fdf6bc7a5572b3f37096f6d9644cc56dd09b 100644 (file)
@@ -2276,56 +2276,6 @@ static void remove_proc_entries(ipmi_smi_t smi)
 #endif /* CONFIG_PROC_FS */
 }
 
-static int __find_bmc_guid(struct device *dev, void *data)
-{
-       unsigned char *id = data;
-       struct bmc_device *bmc = to_bmc_device(dev);
-       return memcmp(bmc->guid, id, 16) == 0;
-}
-
-static struct bmc_device *ipmi_find_bmc_guid(struct device_driver *drv,
-                                            unsigned char *guid)
-{
-       struct device *dev;
-
-       dev = driver_find_device(drv, NULL, guid, __find_bmc_guid);
-       if (dev)
-               return to_bmc_device(dev);
-       else
-               return NULL;
-}
-
-struct prod_dev_id {
-       unsigned int  product_id;
-       unsigned char device_id;
-};
-
-static int __find_bmc_prod_dev_id(struct device *dev, void *data)
-{
-       struct prod_dev_id *id = data;
-       struct bmc_device *bmc = to_bmc_device(dev);
-
-       return (bmc->id.product_id == id->product_id
-               && bmc->id.device_id == id->device_id);
-}
-
-static struct bmc_device *ipmi_find_bmc_prod_dev_id(
-       struct device_driver *drv,
-       unsigned int product_id, unsigned char device_id)
-{
-       struct prod_dev_id id = {
-               .product_id = product_id,
-               .device_id = device_id,
-       };
-       struct device *dev;
-
-       dev = driver_find_device(drv, NULL, &id, __find_bmc_prod_dev_id);
-       if (dev)
-               return to_bmc_device(dev);
-       else
-               return NULL;
-}
-
 static ssize_t device_id_show(struct device *dev,
                              struct device_attribute *attr,
                              char *buf)
@@ -2480,6 +2430,57 @@ static const struct device_type bmc_device_type = {
        .groups         = bmc_dev_attr_groups,
 };
 
+static int __find_bmc_guid(struct device *dev, void *data)
+{
+       unsigned char *id = data;
+       struct bmc_device *bmc = to_bmc_device(dev);
+
+       return memcmp(bmc->guid, id, 16) == 0;
+}
+
+static struct bmc_device *ipmi_find_bmc_guid(struct device_driver *drv,
+                                            unsigned char *guid)
+{
+       struct device *dev;
+
+       dev = driver_find_device(drv, NULL, guid, __find_bmc_guid);
+       if (dev)
+               return to_bmc_device(dev);
+       else
+               return NULL;
+}
+
+struct prod_dev_id {
+       unsigned int  product_id;
+       unsigned char device_id;
+};
+
+static int __find_bmc_prod_dev_id(struct device *dev, void *data)
+{
+       struct prod_dev_id *id = data;
+       struct bmc_device *bmc = to_bmc_device(dev);
+
+       return (bmc->id.product_id == id->product_id
+               && bmc->id.device_id == id->device_id);
+}
+
+static struct bmc_device *ipmi_find_bmc_prod_dev_id(
+       struct device_driver *drv,
+       unsigned int product_id, unsigned char device_id)
+{
+       struct prod_dev_id id = {
+               .product_id = product_id,
+               .device_id = device_id,
+       };
+       struct device *dev;
+
+       dev = driver_find_device(drv, NULL, &id, __find_bmc_prod_dev_id);
+       if (dev)
+               return to_bmc_device(dev);
+       else
+               return NULL;
+}
+
 static void
 release_bmc_device(struct device *dev)
 {