9 #include <linux/module.h>
11 #include <linux/stat.h>
12 #include <linux/slab.h>
31 static struct bus_type soc_bus_type = {
52 if ((attr == &dev_attr_machine.attr)
55 if ((attr == &dev_attr_family.attr)
58 if ((attr == &dev_attr_revision.attr)
59 && (soc_dev->
attr->revision !=
NULL))
61 if ((attr == &dev_attr_soc_id.attr)
75 if (attr == &dev_attr_machine)
76 return sprintf(buf,
"%s\n", soc_dev->
attr->machine);
77 if (attr == &dev_attr_family)
79 if (attr == &dev_attr_revision)
80 return sprintf(buf,
"%s\n", soc_dev->
attr->revision);
81 if (attr == &dev_attr_soc_id)
89 &dev_attr_machine.attr,
90 &dev_attr_family.attr,
91 &dev_attr_soc_id.attr,
92 &dev_attr_revision.attr,
98 .is_visible = soc_attribute_mode,
106 static void soc_release(
struct device *dev)
118 soc_dev = kzalloc(
sizeof(*soc_dev),
GFP_KERNEL);
131 spin_lock(&soc_lock);
133 spin_unlock(&soc_lock);
140 soc_dev->
attr = soc_dev_attr;
141 soc_dev->
dev.bus = &soc_bus_type;
142 soc_dev->
dev.groups = soc_attr_groups;
143 soc_dev->
dev.release = soc_release;
169 static int __init soc_bus_register(
void)
175 static void __exit soc_bus_unregister(
void)