aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firewire/fw-device.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index 71bb9d1e8196..2bf86aa1c9bc 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -348,8 +348,7 @@ static struct device_attribute fw_unit_attributes[] = {
348}; 348};
349 349
350static ssize_t 350static ssize_t
351config_rom_show(struct device *dev, 351config_rom_show(struct device *dev, struct device_attribute *attr, char *buf)
352 struct device_attribute *attr, char *buf)
353{ 352{
354 struct fw_device *device = fw_device(dev); 353 struct fw_device *device = fw_device(dev);
355 354
@@ -358,8 +357,20 @@ config_rom_show(struct device *dev,
358 return device->config_rom_length * 4; 357 return device->config_rom_length * 4;
359} 358}
360 359
360static ssize_t
361guid_show(struct device *dev, struct device_attribute *attr, char *buf)
362{
363 struct fw_device *device = fw_device(dev);
364 u64 guid;
365
366 guid = ((u64)device->config_rom[3] << 32) | device->config_rom[4];
367
368 return snprintf(buf, PAGE_SIZE, "0x%016llx\n", guid);
369}
370
361static struct device_attribute fw_device_attributes[] = { 371static struct device_attribute fw_device_attributes[] = {
362 __ATTR_RO(config_rom), 372 __ATTR_RO(config_rom),
373 __ATTR_RO(guid),
363 __ATTR_NULL, 374 __ATTR_NULL,
364}; 375};
365 376