aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-10-28 08:34:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-28 20:02:16 -0400
commit213dd193fab8288e2b0b96dc93f974ec33ba2298 (patch)
tree159ccde5068c4bafab199d9db1e241383ee3f7a2
parent2da55cfd603d1c08dd1a396f943d6205eca47227 (diff)
mei: bus: set the device name before running fixup
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>
-rw-r--r--drivers/misc/mei/bus.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 46403e48be4f..0b05aa938799 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -742,6 +742,19 @@ static struct device_type mei_cl_device_type = {
742}; 742};
743 743
744/** 744/**
745 * mei_cl_bus_set_name - set device name for me client device
746 *
747 * @cldev: me client device
748 */
749static inline void mei_cl_bus_set_name(struct mei_cl_device *cldev)
750{
751 dev_set_name(&cldev->dev, "mei:%s:%pUl:%02X",
752 cldev->name,
753 mei_me_cl_uuid(cldev->me_cl),
754 mei_me_cl_ver(cldev->me_cl));
755}
756
757/**
745 * mei_cl_bus_dev_alloc - initialize and allocate mei client device 758 * mei_cl_bus_dev_alloc - initialize and allocate mei client device
746 * 759 *
747 * @bus: mei device 760 * @bus: mei device
@@ -764,6 +777,7 @@ static struct mei_cl_device *mei_cl_bus_dev_alloc(struct mei_device *bus,
764 cldev->dev.type = &mei_cl_device_type; 777 cldev->dev.type = &mei_cl_device_type;
765 cldev->bus = mei_dev_bus_get(bus); 778 cldev->bus = mei_dev_bus_get(bus);
766 cldev->me_cl = mei_me_cl_get(me_cl); 779 cldev->me_cl = mei_me_cl_get(me_cl);
780 mei_cl_bus_set_name(cldev);
767 cldev->is_added = 0; 781 cldev->is_added = 0;
768 INIT_LIST_HEAD(&cldev->bus_list); 782 INIT_LIST_HEAD(&cldev->bus_list);
769 783
@@ -785,11 +799,9 @@ static bool mei_cl_bus_dev_setup(struct mei_device *bus,
785 cldev->do_match = 1; 799 cldev->do_match = 1;
786 mei_cl_bus_dev_fixup(cldev); 800 mei_cl_bus_dev_fixup(cldev);
787 801
802 /* the device name can change during fix up */
788 if (cldev->do_match) 803 if (cldev->do_match)
789 dev_set_name(&cldev->dev, "mei:%s:%pUl:%02X", 804 mei_cl_bus_set_name(cldev);
790 cldev->name,
791 mei_me_cl_uuid(cldev->me_cl),
792 mei_me_cl_ver(cldev->me_cl));
793 805
794 return cldev->do_match == 1; 806 return cldev->do_match == 1;
795} 807}