Lines Matching refs:soc_dev
40 struct device *soc_device_to_device(struct soc_device *soc_dev)
42 return &soc_dev->dev;
50 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
52 if ((attr == &dev_attr_machine.attr) && soc_dev->attr->machine)
54 if ((attr == &dev_attr_family.attr) && soc_dev->attr->family)
56 if ((attr == &dev_attr_revision.attr) && soc_dev->attr->revision)
58 if ((attr == &dev_attr_serial_number.attr) && soc_dev->attr->serial_number)
60 if ((attr == &dev_attr_soc_id.attr) && soc_dev->attr->soc_id)
70 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
74 output = soc_dev->attr->machine;
76 output = soc_dev->attr->family;
78 output = soc_dev->attr->revision;
80 output = soc_dev->attr->serial_number;
82 output = soc_dev->attr->soc_id;
105 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
107 ida_simple_remove(&soc_ida, soc_dev->soc_dev_num);
108 kfree(soc_dev->dev.groups);
109 kfree(soc_dev);
116 struct soc_device *soc_dev;
127 soc_dev = kzalloc(sizeof(*soc_dev), GFP_KERNEL);
128 if (!soc_dev) {
145 soc_dev->soc_dev_num = ret;
147 soc_dev->attr = soc_dev_attr;
148 soc_dev->dev.bus = &soc_bus_type;
149 soc_dev->dev.groups = soc_attr_groups;
150 soc_dev->dev.release = soc_release;
152 dev_set_name(&soc_dev->dev, "soc%d", soc_dev->soc_dev_num);
154 ret = device_register(&soc_dev->dev);
156 put_device(&soc_dev->dev);
160 return soc_dev;
165 kfree(soc_dev);
171 /* Ensure soc_dev->attr is freed prior to calling soc_device_unregister. */
172 void soc_device_unregister(struct soc_device *soc_dev)
174 device_unregister(&soc_dev->dev);
218 struct soc_device *soc_dev = container_of(dev, struct soc_device, dev);
220 return soc_device_match_attr(soc_dev->attr, arg);