Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224891
b: refs/heads/master
c: aa3bf28
h: refs/heads/master
i:
  224889: f806e00
  224887: a60ea01
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Dec 2, 2010
1 parent c0f287c commit bb9e42b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 172c69a47675dc1ca9c7243c031d8d77701bccc0
refs/heads/master: aa3bf280dd3214db5b9e1f8cad7c5868ccbe71b7
30 changes: 30 additions & 0 deletions trunk/drivers/ssb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,35 @@ static int ssb_device_uevent(struct device *dev, struct kobj_uevent_env *env)
ssb_dev->id.revision);
}

#define ssb_config_attr(attrib, field, format_string) \
static ssize_t \
attrib##_show(struct device *dev, struct device_attribute *attr, char *buf) \
{ \
return sprintf(buf, format_string, dev_to_ssb_dev(dev)->field); \
}

ssb_config_attr(core_num, core_index, "%u\n")
ssb_config_attr(coreid, id.coreid, "0x%04x\n")
ssb_config_attr(vendor, id.vendor, "0x%04x\n")
ssb_config_attr(revision, id.revision, "%u\n")
ssb_config_attr(irq, irq, "%u\n")
static ssize_t
name_show(struct device *dev, struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%s\n",
ssb_core_name(dev_to_ssb_dev(dev)->id.coreid));
}

static struct device_attribute ssb_device_attrs[] = {
__ATTR_RO(name),
__ATTR_RO(core_num),
__ATTR_RO(coreid),
__ATTR_RO(vendor),
__ATTR_RO(revision),
__ATTR_RO(irq),
__ATTR_NULL,
};

static struct bus_type ssb_bustype = {
.name = "ssb",
.match = ssb_bus_match,
Expand All @@ -392,6 +421,7 @@ static struct bus_type ssb_bustype = {
.suspend = ssb_device_suspend,
.resume = ssb_device_resume,
.uevent = ssb_device_uevent,
.dev_attrs = ssb_device_attrs,
};

static void ssb_buses_lock(void)
Expand Down

0 comments on commit bb9e42b

Please sign in to comment.