diff options
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 09d06b082f8b..ace133b9f7d4 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -83,7 +83,7 @@ struct pcmcia_dynid { }; /** - * pcmcia_store_new_id - add a new PCMCIA device ID to this driver and re-probe devices + * new_id_store() - add a new PCMCIA device ID to this driver and re-probe devices * @driver: target device driver * @buf: buffer for scanning device ID data * @count: input size @@ -350,7 +350,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le return; } -static int pcmcia_device_remove(struct device *dev) +static void pcmcia_device_remove(struct device *dev) { struct pcmcia_device *p_dev; struct pcmcia_driver *p_drv; @@ -371,9 +371,6 @@ static int pcmcia_device_remove(struct device *dev) pcmcia_card_remove(p_dev->socket, p_dev); /* detach the "instance" */ - if (!p_drv) - return 0; - if (p_drv->remove) p_drv->remove(p_dev); @@ -389,11 +386,9 @@ static int pcmcia_device_remove(struct device *dev) "pcmcia: driver %s did not release window properly\n", p_drv->name); - /* references from pcmcia_probe_device */ + /* references from pcmcia_device_probe */ pcmcia_put_dev(p_dev); module_put(p_drv->owner); - - return 0; } @@ -516,7 +511,7 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, p_dev->dev.parent = s->dev.parent; p_dev->dev.release = pcmcia_release_dev; /* by default don't allow DMA */ - p_dev->dma_mask = DMA_MASK_NONE; + p_dev->dma_mask = 0; p_dev->dev.dma_mask = &p_dev->dma_mask; dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no); if (!dev_name(&p_dev->dev)) @@ -1003,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); @@ -1011,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); @@ -1027,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); @@ -1035,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); @@ -1050,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, @@ -1086,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, |