Skip to content

Commit 35fc265

Browse files
robherringgregkh
authored andcommitted
cxl: Drop printing of DT properties
There's little reason to dump DT property values when they can be read at any time from the DT in /proc/device-tree. If such a feature is needed, then it really should be implemented in the DT core such that any module/driver can use it. Signed-off-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 83a1b57 commit 35fc265

File tree

1 file changed

+3
-98
lines changed
  • drivers/misc/cxl

1 file changed

+3
-98
lines changed

drivers/misc/cxl/of.c

Lines changed: 3 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ static const __be32 *read_prop_string(const struct device_node *np,
1919
const __be32 *prop;
2020

2121
prop = of_get_property(np, prop_name, NULL);
22-
if (cxl_verbose && prop)
23-
pr_info("%s: %s\n", prop_name, (char *) prop);
2422
return prop;
2523
}
2624

@@ -32,8 +30,6 @@ static const __be32 *read_prop_dword(const struct device_node *np,
3230
prop = of_get_property(np, prop_name, NULL);
3331
if (prop)
3432
*val = be32_to_cpu(prop[0]);
35-
if (cxl_verbose && prop)
36-
pr_info("%s: %#x (%u)\n", prop_name, *val, *val);
3733
return prop;
3834
}
3935

@@ -45,8 +41,6 @@ static const __be64 *read_prop64_dword(const struct device_node *np,
4541
prop = of_get_property(np, prop_name, NULL);
4642
if (prop)
4743
*val = be64_to_cpu(prop[0]);
48-
if (cxl_verbose && prop)
49-
pr_info("%s: %#llx (%llu)\n", prop_name, *val, *val);
5044
return prop;
5145
}
5246

@@ -100,9 +94,6 @@ static int read_phys_addr(struct device_node *np, char *prop_name,
10094
type, prop_name);
10195
return -EINVAL;
10296
}
103-
if (cxl_verbose)
104-
pr_info("%s: %#x %#llx (size %#llx)\n",
105-
prop_name, type, addr, size);
10697
}
10798
}
10899
return 0;
@@ -139,27 +130,13 @@ int cxl_of_read_afu_handle(struct cxl_afu *afu, struct device_node *afu_np)
139130

140131
int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np)
141132
{
142-
int i, len, rc;
143-
char *p;
133+
int i, rc;
144134
const __be32 *prop;
145135
u16 device_id, vendor_id;
146136
u32 val = 0, class_code;
147137

148138
/* Properties are read in the same order as listed in PAPR */
149139

150-
if (cxl_verbose) {
151-
pr_info("Dump of the 'ibm,coherent-platform-function' node properties:\n");
152-
153-
prop = of_get_property(np, "compatible", &len);
154-
i = 0;
155-
while (i < len) {
156-
p = (char *) prop + i;
157-
pr_info("compatible: %s\n", p);
158-
i += strlen(p) + 1;
159-
}
160-
read_prop_string(np, "name");
161-
}
162-
163140
rc = read_phys_addr(np, "reg", afu);
164141
if (rc)
165142
return rc;
@@ -173,19 +150,10 @@ int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np)
173150
else
174151
afu->psa = true;
175152

176-
if (cxl_verbose) {
177-
read_prop_string(np, "ibm,loc-code");
178-
read_prop_string(np, "device_type");
179-
}
180-
181153
read_prop_dword(np, "ibm,#processes", &afu->max_procs_virtualised);
182154

183-
if (cxl_verbose) {
184-
read_prop_dword(np, "ibm,scratchpad-size", &val);
185-
read_prop_dword(np, "ibm,programmable", &val);
186-
read_prop_string(np, "ibm,phandle");
155+
if (cxl_verbose)
187156
read_vpd(NULL, afu);
188-
}
189157

190158
read_prop_dword(np, "ibm,max-ints-per-process", &afu->guest->max_ints);
191159
afu->irqs_max = afu->guest->max_ints;
@@ -199,17 +167,9 @@ int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np)
199167
afu->pp_irqs--;
200168
}
201169

202-
if (cxl_verbose) {
203-
read_prop_dword(np, "ibm,max-ints", &val);
204-
read_prop_dword(np, "ibm,vpd-size", &val);
205-
}
206-
207170
read_prop64_dword(np, "ibm,error-buffer-size", &afu->eb_len);
208171
afu->eb_offset = 0;
209172

210-
if (cxl_verbose)
211-
read_prop_dword(np, "ibm,config-record-type", &val);
212-
213173
read_prop64_dword(np, "ibm,config-record-size", &afu->crs_len);
214174
afu->crs_offset = 0;
215175

@@ -235,15 +195,6 @@ int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np)
235195
i, class_code);
236196
}
237197
}
238-
239-
read_prop_dword(np, "ibm,function-number", &val);
240-
read_prop_dword(np, "ibm,privileged-function", &val);
241-
read_prop_dword(np, "vendor-id", &val);
242-
read_prop_dword(np, "device-id", &val);
243-
read_prop_dword(np, "revision-id", &val);
244-
read_prop_dword(np, "class-code", &val);
245-
read_prop_dword(np, "subsystem-vendor-id", &val);
246-
read_prop_dword(np, "subsystem-id", &val);
247198
}
248199
/*
249200
* if "ibm,process-mmio" doesn't exist then per-process mmio is
@@ -256,12 +207,6 @@ int cxl_of_read_afu_properties(struct cxl_afu *afu, struct device_node *np)
256207
else
257208
afu->pp_psa = false;
258209

259-
if (cxl_verbose) {
260-
read_prop_dword(np, "ibm,supports-aur", &val);
261-
read_prop_dword(np, "ibm,supports-csrp", &val);
262-
read_prop_dword(np, "ibm,supports-prr", &val);
263-
}
264-
265210
prop = read_prop_dword(np, "ibm,function-error-interrupt", &val);
266211
if (prop)
267212
afu->serr_hwirq = val;
@@ -343,49 +288,15 @@ int cxl_of_read_adapter_handle(struct cxl *adapter, struct device_node *np)
343288

344289
int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np)
345290
{
346-
int rc, len, naddr, i;
347-
char *p;
291+
int rc;
348292
const __be32 *prop;
349293
u32 val = 0;
350294

351295
/* Properties are read in the same order as listed in PAPR */
352296

353-
naddr = of_n_addr_cells(np);
354-
355-
if (cxl_verbose) {
356-
pr_info("Dump of the 'ibm,coherent-platform-facility' node properties:\n");
357-
358-
read_prop_dword(np, "#address-cells", &val);
359-
read_prop_dword(np, "#size-cells", &val);
360-
361-
prop = of_get_property(np, "compatible", &len);
362-
i = 0;
363-
while (i < len) {
364-
p = (char *) prop + i;
365-
pr_info("compatible: %s\n", p);
366-
i += strlen(p) + 1;
367-
}
368-
read_prop_string(np, "name");
369-
read_prop_string(np, "model");
370-
371-
prop = of_get_property(np, "reg", NULL);
372-
if (prop) {
373-
pr_info("reg: addr:%#llx size:%#x\n",
374-
of_read_number(prop, naddr),
375-
be32_to_cpu(prop[naddr]));
376-
}
377-
378-
read_prop_string(np, "ibm,loc-code");
379-
}
380-
381297
if ((rc = read_adapter_irq_config(adapter, np)))
382298
return rc;
383299

384-
if (cxl_verbose) {
385-
read_prop_string(np, "device_type");
386-
read_prop_string(np, "ibm,phandle");
387-
}
388-
389300
prop = read_prop_dword(np, "ibm,caia-version", &val);
390301
if (prop) {
391302
adapter->caia_major = (val & 0xFF00) >> 8;
@@ -411,12 +322,6 @@ int cxl_of_read_adapter_properties(struct cxl *adapter, struct device_node *np)
411322
if (prop)
412323
adapter->guest->device = val;
413324

414-
if (cxl_verbose) {
415-
read_prop_dword(np, "ibm,privileged-facility", &val);
416-
read_prop_dword(np, "revision-id", &val);
417-
read_prop_dword(np, "class-code", &val);
418-
}
419-
420325
prop = read_prop_dword(np, "subsystem-vendor-id", &val);
421326
if (prop)
422327
adapter->guest->subsystem_vendor = val;

0 commit comments

Comments
 (0)