]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mei: bus: set the device name before running fixup
authorTomas Winkler <tomas.winkler@intel.com>
Wed, 28 Oct 2015 12:34:35 +0000 (14:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2015 00:02:16 +0000 (09:02 +0900)
The mei bus fixup use dev_xxx services for printing
to kernel log so we need to setup the device name
prior to running fixup hooks.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus.c

index 46403e48be4fa146205571feff77ca3dae589e3f..0b05aa9387996484759e748831eba5304ac3a409 100644 (file)
@@ -741,6 +741,19 @@ static struct device_type mei_cl_device_type = {
        .release        = mei_cl_bus_dev_release,
 };
 
+/**
+ * mei_cl_bus_set_name - set device name for me client device
+ *
+ * @cldev: me client device
+ */
+static inline void mei_cl_bus_set_name(struct mei_cl_device *cldev)
+{
+       dev_set_name(&cldev->dev, "mei:%s:%pUl:%02X",
+                    cldev->name,
+                    mei_me_cl_uuid(cldev->me_cl),
+                    mei_me_cl_ver(cldev->me_cl));
+}
+
 /**
  * mei_cl_bus_dev_alloc - initialize and allocate mei client device
  *
@@ -764,6 +777,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus,
        cldev->dev.type   = &mei_cl_device_type;
        cldev->bus        = mei_dev_bus_get(bus);
        cldev->me_cl      = mei_me_cl_get(me_cl);
+       mei_cl_bus_set_name(cldev);
        cldev->is_added   = 0;
        INIT_LIST_HEAD(&cldev->bus_list);
 
@@ -785,11 +799,9 @@ static bool mei_cl_bus_dev_setup(struct mei_device *bus,
        cldev->do_match = 1;
        mei_cl_bus_dev_fixup(cldev);
 
+       /* the device name can change during fix up */
        if (cldev->do_match)
-               dev_set_name(&cldev->dev, "mei:%s:%pUl:%02X",
-                            cldev->name,
-                            mei_me_cl_uuid(cldev->me_cl),
-                            mei_me_cl_ver(cldev->me_cl));
+               mei_cl_bus_set_name(cldev);
 
        return cldev->do_match == 1;
 }