| #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 = of_get_property(of->node, "compatible", &cplen); |
| length += sprintf (buf, "%s\n", compat); |
| static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, |
| struct of_device *ofdev = to_of_device(dev); |
| len = of_device_get_modalias(ofdev, buf, PAGE_SIZE); |
| macio_config_of_attr (name, "%s\n"); |
| macio_config_of_attr (type, "%s\n"); |
| struct device_attribute macio_dev_attrs[] = { |