| #include <linux/config.h> |
| #include <linux/kernel.h> |
| #define macio_config_of_attr(field, format_string) \ |
| field##_show (struct device *dev, struct device_attribute *attr, \ |
| struct macio_dev *mdev = to_macio_device (dev); \ |
| return sprintf (buf, format_string, mdev->ofdev.node->field); \ |
| compatible_show (struct device *dev, struct device_attribute *attr, char *buf) |
| of = &to_macio_device (dev)->ofdev; |
| compat = (char *) get_property(of->node, "compatible", &cplen); |
| length += sprintf (buf, "%s\n", compat); |
| macio_config_of_attr (name, "%s\n"); |
| macio_config_of_attr (type, "%s\n"); |
| struct device_attribute macio_dev_attrs[] = { |