Lines Matching refs:elog

32 	ssize_t (*show)(struct elog_obj *elog, struct elog_attribute *attr,
34 ssize_t (*store)(struct elog_obj *elog, struct elog_attribute *attr,
100 struct elog_obj *elog; in elog_attr_show() local
103 elog = to_elog_obj(kobj); in elog_attr_show()
108 return attribute->show(elog, attribute, buf); in elog_attr_show()
116 struct elog_obj *elog; in elog_attr_store() local
119 elog = to_elog_obj(kobj); in elog_attr_store()
124 return attribute->store(elog, attribute, buf, len); in elog_attr_store()
134 struct elog_obj *elog; in elog_release() local
136 elog = to_elog_obj(kobj); in elog_release()
137 kfree(elog->buffer); in elog_release()
138 kfree(elog); in elog_release()
164 struct elog_obj *elog = to_elog_obj(kobj); in raw_attr_read() local
167 if (!elog->buffer) { in raw_attr_read()
168 elog->buffer = kzalloc(elog->size, GFP_KERNEL); in raw_attr_read()
169 if (!elog->buffer) in raw_attr_read()
172 opal_rc = opal_read_elog(__pa(elog->buffer), in raw_attr_read()
173 elog->size, elog->id); in raw_attr_read()
176 elog->id); in raw_attr_read()
177 kfree(elog->buffer); in raw_attr_read()
178 elog->buffer = NULL; in raw_attr_read()
183 memcpy(buffer, elog->buffer + pos, count); in raw_attr_read()
190 struct elog_obj *elog; in create_elog_obj() local
193 elog = kzalloc(sizeof(*elog), GFP_KERNEL); in create_elog_obj()
194 if (!elog) in create_elog_obj()
197 elog->kobj.kset = elog_kset; in create_elog_obj()
199 kobject_init(&elog->kobj, &elog_ktype); in create_elog_obj()
201 sysfs_bin_attr_init(&elog->raw_attr); in create_elog_obj()
203 elog->raw_attr.attr.name = "raw"; in create_elog_obj()
204 elog->raw_attr.attr.mode = 0400; in create_elog_obj()
205 elog->raw_attr.size = size; in create_elog_obj()
206 elog->raw_attr.read = raw_attr_read; in create_elog_obj()
208 elog->id = id; in create_elog_obj()
209 elog->size = size; in create_elog_obj()
210 elog->type = type; in create_elog_obj()
212 elog->buffer = kzalloc(elog->size, GFP_KERNEL); in create_elog_obj()
214 if (elog->buffer) { in create_elog_obj()
215 rc = opal_read_elog(__pa(elog->buffer), in create_elog_obj()
216 elog->size, elog->id); in create_elog_obj()
219 elog->id); in create_elog_obj()
220 kfree(elog->buffer); in create_elog_obj()
221 elog->buffer = NULL; in create_elog_obj()
225 rc = kobject_add(&elog->kobj, NULL, "0x%llx", id); in create_elog_obj()
227 kobject_put(&elog->kobj); in create_elog_obj()
246 kobject_get(&elog->kobj); in create_elog_obj()
247 rc = sysfs_create_bin_file(&elog->kobj, &elog->raw_attr); in create_elog_obj()
249 kobject_uevent(&elog->kobj, KOBJ_ADD); in create_elog_obj()
252 kobject_put(&elog->kobj); in create_elog_obj()
256 kobject_put(&elog->kobj); in create_elog_obj()