PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions
[linux-2.6-microblaze.git] / drivers / pci / slot.c
index d627dd9..751a266 100644 (file)
@@ -39,19 +39,19 @@ static const struct sysfs_ops pci_slot_sysfs_ops = {
 static ssize_t address_read_file(struct pci_slot *slot, char *buf)
 {
        if (slot->number == 0xff)
-               return sprintf(buf, "%04x:%02x\n",
-                               pci_domain_nr(slot->bus),
-                               slot->bus->number);
-       else
-               return sprintf(buf, "%04x:%02x:%02x\n",
-                               pci_domain_nr(slot->bus),
-                               slot->bus->number,
-                               slot->number);
+               return sysfs_emit(buf, "%04x:%02x\n",
+                                 pci_domain_nr(slot->bus),
+                                 slot->bus->number);
+
+       return sysfs_emit(buf, "%04x:%02x:%02x\n",
+                         pci_domain_nr(slot->bus),
+                         slot->bus->number,
+                         slot->number);
 }
 
 static ssize_t bus_speed_read(enum pci_bus_speed speed, char *buf)
 {
-       return sprintf(buf, "%s\n", pci_speed_string(speed));
+       return sysfs_emit(buf, "%s\n", pci_speed_string(speed));
 }
 
 static ssize_t max_speed_read_file(struct pci_slot *slot, char *buf)