Lines Matching defs:soc_dev

42 struct device *soc_device_to_device(struct soc_device *soc_dev)
44 return &soc_dev->dev;
52 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
54 if ((attr == &dev_attr_machine.attr) && soc_dev->attr->machine)
56 if ((attr == &dev_attr_family.attr) && soc_dev->attr->family)
58 if ((attr == &dev_attr_revision.attr) && soc_dev->attr->revision)
60 if ((attr == &dev_attr_serial_number.attr) && soc_dev->attr->serial_number)
62 if ((attr == &dev_attr_soc_id.attr) && soc_dev->attr->soc_id)
72 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
76 output = soc_dev->attr->machine;
78 output = soc_dev->attr->family;
80 output = soc_dev->attr->revision;
82 output = soc_dev->attr->serial_number;
84 output = soc_dev->attr->soc_id;
107 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
109 ida_free(&soc_ida, soc_dev->soc_dev_num);
110 kfree(soc_dev->dev.groups);
111 kfree(soc_dev);
130 struct soc_device *soc_dev;
143 soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
144 if (!soc_dev) {
161 soc_dev->soc_dev_num = ret;
163 soc_dev->attr = soc_dev_attr;
164 soc_dev->dev.bus = &soc_bus_type;
165 soc_dev->dev.groups = soc_attr_groups;
166 soc_dev->dev.release = soc_release;
168 dev_set_name(&soc_dev->dev, "soc%d", soc_dev->soc_dev_num);
170 ret = device_register(&soc_dev->dev);
172 put_device(&soc_dev->dev);
176 return soc_dev;
181 kfree(soc_dev);
187 /* Ensure soc_dev->attr is freed after calling soc_device_unregister. */
188 void soc_device_unregister(struct soc_device *soc_dev)
190 device_unregister(&soc_dev->dev);
235 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
237 return soc_device_match_attr(soc_dev->attr, arg);