From f9d255fa7de98a245d9b13cf7299299589ee1244 Mon Sep 17 00:00:00 2001 From: "scwhab@suse.de" Date: Fri, 28 Oct 2005 17:46:20 -0700 Subject: [PATCH] --- yaml --- r: 11711 b: refs/heads/master c: dcb34abb4d9bae0588c5c11101ed6afcee71f895 h: refs/heads/master i: 11709: db7718d070a0e01d122600a996df529ab7d25c26 11707: d268c33ae8e30f7d53fad2a6720975715a89b752 11703: 9707ede119454e03eab3ea51c4f9a3860d20a03f 11695: 9e1e04fbcbe42b1da5dbb0465f93e928bc3667df 11679: f90e42ba3bf4521c680b38517385f52e50edf046 11647: c8c27044708343057f88aa9e9eb79f20c80df0f6 v: v3 --- [refs] | 2 +- trunk/drivers/macintosh/macio_sysfs.c | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 2c40397713e8..801ddd852539 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 35e95e63995f3e52178db4b769120ce60deb6b54 +refs/heads/master: dcb34abb4d9bae0588c5c11101ed6afcee71f895 diff --git a/trunk/drivers/macintosh/macio_sysfs.c b/trunk/drivers/macintosh/macio_sysfs.c index 97d22bb4516a..7f7d4eaca870 100644 --- a/trunk/drivers/macintosh/macio_sysfs.c +++ b/trunk/drivers/macintosh/macio_sysfs.c @@ -39,6 +39,31 @@ 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"); @@ -46,5 +71,6 @@ struct device_attribute macio_dev_attrs[] = { __ATTR_RO(name), __ATTR_RO(type), __ATTR_RO(compatible), + __ATTR_RO(modalias), __ATTR_NULL };