Skip to content

Commit 7b1a015

Browse files
committed
Merge branch 'master' into devel
2 parents eb0603b + e459e54 commit 7b1a015

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

switchtec.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static ssize_t device_version_show(struct device *dev,
328328

329329
ver = ioread32(&stdev->mmio_sys_info->device_version);
330330

331-
return sprintf(buf, "%x\n", ver);
331+
return sysfs_emit(buf, "%x\n", ver);
332332
}
333333
static DEVICE_ATTR_RO(device_version);
334334

@@ -340,7 +340,7 @@ static ssize_t fw_version_show(struct device *dev,
340340

341341
ver = ioread32(&stdev->mmio_sys_info->firmware_version);
342342

343-
return sprintf(buf, "%08x\n", ver);
343+
return sysfs_emit(buf, "%08x\n", ver);
344344
}
345345
static DEVICE_ATTR_RO(fw_version);
346346

@@ -392,7 +392,7 @@ static ssize_t component_vendor_show(struct device *dev,
392392

393393
/* component_vendor field not supported after gen3 */
394394
if (stdev->gen != SWITCHTEC_GEN3)
395-
return sprintf(buf, "none\n");
395+
return sysfs_emit(buf, "none\n");
396396

397397
return io_string_show(buf, &si->gen3.component_vendor,
398398
sizeof(si->gen3.component_vendor));
@@ -407,9 +407,9 @@ static ssize_t component_id_show(struct device *dev,
407407

408408
/* component_id field not supported after gen3 */
409409
if (stdev->gen != SWITCHTEC_GEN3)
410-
return sprintf(buf, "none\n");
410+
return sysfs_emit(buf, "none\n");
411411

412-
return sprintf(buf, "PM%04X\n", id);
412+
return sysfs_emit(buf, "PM%04X\n", id);
413413
}
414414
static DEVICE_ATTR_RO(component_id);
415415

@@ -421,9 +421,9 @@ static ssize_t component_revision_show(struct device *dev,
421421

422422
/* component_revision field not supported after gen3 */
423423
if (stdev->gen != SWITCHTEC_GEN3)
424-
return sprintf(buf, "255\n");
424+
return sysfs_emit(buf, "255\n");
425425

426-
return sprintf(buf, "%d\n", rev);
426+
return sysfs_emit(buf, "%d\n", rev);
427427
}
428428
static DEVICE_ATTR_RO(component_revision);
429429

@@ -432,7 +432,7 @@ static ssize_t partition_show(struct device *dev,
432432
{
433433
struct switchtec_dev *stdev = to_stdev(dev);
434434

435-
return sprintf(buf, "%d\n", stdev->partition);
435+
return sysfs_emit(buf, "%d\n", stdev->partition);
436436
}
437437
static DEVICE_ATTR_RO(partition);
438438

@@ -441,7 +441,7 @@ static ssize_t partition_count_show(struct device *dev,
441441
{
442442
struct switchtec_dev *stdev = to_stdev(dev);
443443

444-
return sprintf(buf, "%d\n", stdev->partition_count);
444+
return sysfs_emit(buf, "%d\n", stdev->partition_count);
445445
}
446446
static DEVICE_ATTR_RO(partition_count);
447447

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6
1+
1.8

0 commit comments

Comments
 (0)