Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11711
b: refs/heads/master
c: dcb34ab
h: refs/heads/master
i:
  11709: db7718d
  11707: d268c33
  11703: 9707ede
  11695: 9e1e04f
  11679: f90e42b
  11647: c8c2704
v: v3
  • Loading branch information
scwhab@suse.de authored and Paul Mackerras committed Oct 29, 2005
1 parent fc3cda0 commit f9d255f
Show file tree
Hide file tree
Showing 2 changed files with 27 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: 35e95e63995f3e52178db4b769120ce60deb6b54
refs/heads/master: dcb34abb4d9bae0588c5c11101ed6afcee71f895
26 changes: 26 additions & 0 deletions trunk/drivers/macintosh/macio_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,38 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf)
return length;
}

static ssize_t modalias_show (struct device *dev, struct device_attribute *attr,
char *buf)
{
struct of_device *of;
char *compat;
int cplen;
int length;

of = &to_macio_device (dev)->ofdev;
compat = (char *) get_property (of->node, "compatible", &cplen);
if (!compat) compat = "", cplen = 1;
length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type);
buf += length;
while (cplen > 0) {
int l;
length += sprintf (buf, "C%s", compat);
buf += length;
l = strlen (compat) + 1;
compat += l;
cplen -= l;
}

return length;
}

macio_config_of_attr (name, "%s\n");
macio_config_of_attr (type, "%s\n");

struct device_attribute macio_dev_attrs[] = {
__ATTR_RO(name),
__ATTR_RO(type),
__ATTR_RO(compatible),
__ATTR_RO(modalias),
__ATTR_NULL
};

0 comments on commit f9d255f

Please sign in to comment.