aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-device.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2012-06-17 10:40:36 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-06-30 04:49:06 -0400
commitbaedee177e6c553af455865718971d9a9c75e537 (patch)
treefcbb65716517292b6cd6a37b35c83d10a5e33c82 /drivers/firewire/core-device.c
parente18907cc8a3cd6e09510632b753b8b6fefa1752a (diff)
firewire: core: add is_local sysfs device attribute
Making this information available in sysfs allows to differentiate between controllers in the local and remote Linux PCs, and thus is useful for servers that are started with udev rules. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-device.c')
-rw-r--r--drivers/firewire/core-device.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/firewire/core-device.c b/drivers/firewire/core-device.c
index 4d460ef87161..7a05fd24d68b 100644
--- a/drivers/firewire/core-device.c
+++ b/drivers/firewire/core-device.c
@@ -398,6 +398,14 @@ static ssize_t guid_show(struct device *dev,
398 return ret; 398 return ret;
399} 399}
400 400
401static ssize_t is_local_show(struct device *dev,
402 struct device_attribute *attr, char *buf)
403{
404 struct fw_device *device = fw_device(dev);
405
406 return sprintf(buf, "%u\n", device->is_local);
407}
408
401static int units_sprintf(char *buf, const u32 *directory) 409static int units_sprintf(char *buf, const u32 *directory)
402{ 410{
403 struct fw_csr_iterator ci; 411 struct fw_csr_iterator ci;
@@ -447,6 +455,7 @@ static ssize_t units_show(struct device *dev,
447static struct device_attribute fw_device_attributes[] = { 455static struct device_attribute fw_device_attributes[] = {
448 __ATTR_RO(config_rom), 456 __ATTR_RO(config_rom),
449 __ATTR_RO(guid), 457 __ATTR_RO(guid),
458 __ATTR_RO(is_local),
450 __ATTR_RO(units), 459 __ATTR_RO(units),
451 __ATTR_NULL, 460 __ATTR_NULL,
452}; 461};