diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2021-10-15 10:13:23 +0300 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2022-01-06 11:15:52 +0300 |
commit | 78e0185c25af8d1e20d3bb390c6c1e6b69ae3a52 (patch) | |
tree | 52768f5267ce5a80786895ecec0380a2f84fd2f1 /drivers/pcmcia/yenta_socket.c | |
parent | fffbcee9335ccf97adf2b5b342099b6430e8dbfd (diff) | |
download | linux-78e0185c25af8d1e20d3bb390c6c1e6b69ae3a52.tar.xz |
pcmcia: use sysfs_emit{,_at} for sysfs output
Convert the PCMCIA core and yenta_socket.c to use sysfs_emit or
sysfs_emit_at when providing output in sysfs.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/yenta_socket.c')
-rw-r--r-- | drivers/pcmcia/yenta_socket.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index e7ec3ea23db9..837877daed62 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -178,16 +178,16 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri struct yenta_socket *socket = dev_get_drvdata(yentadev); int offset = 0, i; - offset = snprintf(buf, PAGE_SIZE, "CB registers:"); + offset = sysfs_emit(buf, "CB registers:"); for (i = 0; i < 0x24; i += 4) { unsigned val; if (!(i & 15)) - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); + offset += sysfs_emit_at(buf, offset, "\n%02x:", i); val = cb_readl(socket, i); - offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %08x", val); + offset += sysfs_emit_at(buf, offset, " %08x", val); } - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n\nExCA registers:"); + offset += sysfs_emit_at(buf, offset, "\n\nExCA registers:"); for (i = 0; i < 0x45; i++) { unsigned char val; if (!(i & 7)) { @@ -195,12 +195,12 @@ static ssize_t show_yenta_registers(struct device *yentadev, struct device_attri memcpy(buf + offset, " -", 2); offset += 2; } else - offset += scnprintf(buf + offset, PAGE_SIZE - offset, "\n%02x:", i); + offset += sysfs_emit_at(buf, offset, "\n%02x:", i); } val = exca_readb(socket, i); - offset += scnprintf(buf + offset, PAGE_SIZE - offset, " %02x", val); + offset += sysfs_emit_at(buf, offset, " %02x", val); } - buf[offset++] = '\n'; + sysfs_emit_at(buf, offset, "\n"); return offset; } |