aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>2017-08-30 13:36:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-31 12:17:40 -0400
commite25201d667b36783500904585a74c7381394fcd1 (patch)
tree51ce4f6b4316736e3a0cd7db71c04b2bdd6bcbf7
parent13fe0c8f72b9ff46f0052a074ce57ca5edd23472 (diff)
staging: unisys: change pr_err to dev_err in visor_check_channel
Changing pr_err to dev_err in visor_check_channel. Added device as an argument to visor_check_channel to pass into dev_err. Signed-off-by: Sameer Wadgaonkar <sameer.wadgaonkar@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Reviewed-by: Tim Sell <timothy.sell@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/unisys/include/visorbus.h7
-rw-r--r--drivers/staging/unisys/visorbus/visorbus_main.c33
-rw-r--r--drivers/staging/unisys/visorbus/visorchipset.c1
3 files changed, 23 insertions, 18 deletions
diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h
index d7fa27be5a12..e4ee38c3dbe4 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -166,9 +166,10 @@ struct visor_device {
166 166
167#define to_visor_device(x) container_of(x, struct visor_device, device) 167#define to_visor_device(x) container_of(x, struct visor_device, device)
168 168
169int visor_check_channel(struct channel_header *ch, const guid_t *expected_guid, 169int visor_check_channel(struct channel_header *ch, struct device *dev,
170 char *chname, u64 expected_min_bytes, 170 const guid_t *expected_uuid, char *chname,
171 u32 expected_version, u64 expected_signature); 171 u64 expected_min_bytes, u32 expected_version,
172 u64 expected_signature);
172 173
173int visorbus_register_visor_driver(struct visor_driver *drv); 174int visorbus_register_visor_driver(struct visor_driver *drv);
174void visorbus_unregister_visor_driver(struct visor_driver *drv); 175void visorbus_unregister_visor_driver(struct visor_driver *drv);
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index ab47bbcad858..2bc7ff7bb96a 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -70,6 +70,7 @@ static LIST_HEAD(list_all_device_instances);
70 * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages. 70 * is used to pass the EFI_DIAG_CAPTURE_PROTOCOL needed to log messages.
71 */ 71 */
72int visor_check_channel(struct channel_header *ch, 72int visor_check_channel(struct channel_header *ch,
73 struct device *dev,
73 const guid_t *expected_guid, 74 const guid_t *expected_guid,
74 char *chname, 75 char *chname,
75 u64 expected_min_bytes, 76 u64 expected_min_bytes,
@@ -79,38 +80,38 @@ int visor_check_channel(struct channel_header *ch,
79 if (!guid_is_null(expected_guid)) { 80 if (!guid_is_null(expected_guid)) {
80 /* caller wants us to verify type GUID */ 81 /* caller wants us to verify type GUID */
81 if (!guid_equal(&ch->chtype, expected_guid)) { 82 if (!guid_equal(&ch->chtype, expected_guid)) {
82 pr_err("Channel mismatch on channel=%s(%pUL) field=type expected=%pUL actual=%pUL\n", 83 dev_err(dev, "Channel mismatch on channel=%s(%pUL) field=type expected=%pUL actual=%pUL\n",
83 chname, expected_guid, 84 chname, expected_guid, expected_guid,
84 expected_guid, &ch->chtype); 85 &ch->chtype);
85 return 0; 86 return 0;
86 } 87 }
87 } 88 }
88 /* verify channel size */ 89 /* verify channel size */
89 if (expected_min_bytes > 0) { 90 if (expected_min_bytes > 0) {
90 if (ch->size < expected_min_bytes) { 91 if (ch->size < expected_min_bytes) {
91 pr_err("Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n", 92 dev_err(dev, "Channel mismatch on channel=%s(%pUL) field=size expected=0x%-8.8Lx actual=0x%-8.8Lx\n",
92 chname, expected_guid, 93 chname, expected_guid,
93 (unsigned long long)expected_min_bytes, 94 (unsigned long long)expected_min_bytes,
94 ch->size); 95 ch->size);
95 return 0; 96 return 0;
96 } 97 }
97 } 98 }
98 /* verify channel version */ 99 /* verify channel version */
99 if (expected_version > 0) { 100 if (expected_version > 0) {
100 if (ch->version_id != expected_version) { 101 if (ch->version_id != expected_version) {
101 pr_err("Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8x\n", 102 dev_err(dev, "Channel mismatch on channel=%s(%pUL) field=version expected=0x%-8.8lx actual=0x%-8.8x\n",
102 chname, expected_guid, 103 chname, expected_guid,
103 (unsigned long)expected_version, 104 (unsigned long)expected_version,
104 ch->version_id); 105 ch->version_id);
105 return 0; 106 return 0;
106 } 107 }
107 } 108 }
108 /* verify channel signature */ 109 /* verify channel signature */
109 if (expected_signature > 0) { 110 if (expected_signature > 0) {
110 if (ch->signature != expected_signature) { 111 if (ch->signature != expected_signature) {
111 pr_err("Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8Lx actual=0x%-8.8Lx\n", 112 dev_err(dev, "Channel mismatch on channel=%s(%pUL) field=signature expected=0x%-8.8Lx actual=0x%-8.8Lx\n",
112 chname, expected_guid, 113 chname, expected_guid, expected_signature,
113 expected_signature, ch->signature); 114 ch->signature);
114 return 0; 115 return 0;
115 } 116 }
116 } 117 }
@@ -699,11 +700,13 @@ void remove_visor_device(struct visor_device *dev)
699} 700}
700 701
701static int get_vbus_header_info(struct visorchannel *chan, 702static int get_vbus_header_info(struct visorchannel *chan,
703 struct device *dev,
702 struct visor_vbus_headerinfo *hdr_info) 704 struct visor_vbus_headerinfo *hdr_info)
703{ 705{
704 int err; 706 int err;
705 707
706 if (!visor_check_channel(visorchannel_get_header(chan), 708 if (!visor_check_channel(visorchannel_get_header(chan),
709 dev,
707 &visor_vbus_channel_guid, 710 &visor_vbus_channel_guid,
708 "vbus", 711 "vbus",
709 sizeof(struct visor_vbus_channel), 712 sizeof(struct visor_vbus_channel),
@@ -1030,7 +1033,7 @@ int visorbus_create_instance(struct visor_device *dev)
1030 &client_bus_info_debugfs_fops); 1033 &client_bus_info_debugfs_fops);
1031 1034
1032 dev_set_drvdata(&dev->device, dev); 1035 dev_set_drvdata(&dev->device, dev);
1033 err = get_vbus_header_info(dev->visorchannel, hdr_info); 1036 err = get_vbus_header_info(dev->visorchannel, &dev->device, hdr_info);
1034 if (err < 0) 1037 if (err < 0)
1035 goto err_debugfs_dir; 1038 goto err_debugfs_dir;
1036 1039
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 82b3bf76868e..74cce4f1a7bd 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1736,6 +1736,7 @@ static int visorchipset_init(struct acpi_device *acpi_device)
1736 1736
1737 controlvm_channel = chipset_dev->controlvm_channel; 1737 controlvm_channel = chipset_dev->controlvm_channel;
1738 if (!visor_check_channel(visorchannel_get_header(controlvm_channel), 1738 if (!visor_check_channel(visorchannel_get_header(controlvm_channel),
1739 &chipset_dev->acpi_device->dev,
1739 &visor_controlvm_channel_guid, 1740 &visor_controlvm_channel_guid,
1740 "controlvm", 1741 "controlvm",
1741 sizeof(struct visor_controlvm_channel), 1742 sizeof(struct visor_controlvm_channel),