diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 23:41:13 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-01-11 23:41:13 +0300 |
commit | 4aa1b8257fba5931511a7e152bcbbb3dd673c6c1 (patch) | |
tree | 3397acac34b441d04724774de7b253c5b0a0c87f /drivers/pcmcia/ds.c | |
parent | c288ea679840de4dee2ce6da5d0f139e3774ad86 (diff) | |
parent | fbb3485f1f931102d8ba606f1c28123f5b48afa3 (diff) | |
download | linux-4aa1b8257fba5931511a7e152bcbbb3dd673c6c1.tar.xz |
Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux
Pull pcmcia updates from Dominik Brodowski:
"A number of odd cleanups and fixes, including one for a small race in
the handling of the pccardd kernel thread"
* 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
pcmcia: fix setting of kthread task states
MAINTAINERS: update PCMCIA tree
pcmcia: use sysfs_emit{,_at} for sysfs output
pcmcia: make pcmcia_release_io() void, as no-one is interested in return value
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region()
pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region()
pcmcia: comment out unused exca_readw() function
pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()
pcmcia: clean up dead drivers for CompuLab CM-X255/CM-X270 boards
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 5bd1b80424e7..ace133b9f7d4 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -998,7 +998,7 @@ static int runtime_resume(struct device *dev) static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ - return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \ + return p_dev->test ? sysfs_emit(buf, format, p_dev->field) : -ENODEV; \ } \ static DEVICE_ATTR_RO(field); @@ -1006,7 +1006,7 @@ static DEVICE_ATTR_RO(field); static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ - return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \ + return p_dev->field ? sysfs_emit(buf, "%s\n", p_dev->field) : -ENODEV; \ } \ static DEVICE_ATTR_RO(name); @@ -1022,7 +1022,7 @@ static ssize_t function_show(struct device *dev, struct device_attribute *attr, char *buf) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); - return p_dev->socket ? sprintf(buf, "0x%02x\n", p_dev->func) : -ENODEV; + return p_dev->socket ? sysfs_emit(buf, "0x%02x\n", p_dev->func) : -ENODEV; } static DEVICE_ATTR_RO(function); @@ -1030,13 +1030,12 @@ static ssize_t resources_show(struct device *dev, struct device_attribute *attr, char *buf) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); - char *str = buf; - int i; + int i, at = 0; for (i = 0; i < PCMCIA_NUM_RESOURCES; i++) - str += sprintf(str, "%pr\n", p_dev->resource[i]); + at += sysfs_emit_at(buf, at, "%pr\n", p_dev->resource[i]); - return str - buf; + return at; } static DEVICE_ATTR_RO(resources); @@ -1045,9 +1044,9 @@ static ssize_t pm_state_show(struct device *dev, struct device_attribute *attr, struct pcmcia_device *p_dev = to_pcmcia_dev(dev); if (p_dev->suspended) - return sprintf(buf, "off\n"); + return sysfs_emit(buf, "off\n"); else - return sprintf(buf, "on\n"); + return sysfs_emit(buf, "on\n"); } static ssize_t pm_state_store(struct device *dev, struct device_attribute *attr, @@ -1081,8 +1080,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i])); } - return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X" - "pa%08Xpb%08Xpc%08Xpd%08X\n", + return sysfs_emit(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02Xpa%08Xpb%08Xpc%08Xpd%08X\n", p_dev->has_manf_id ? p_dev->manf_id : 0, p_dev->has_card_id ? p_dev->card_id : 0, p_dev->has_func_id ? p_dev->func_id : 0, |