Lines Matching refs:scmdev

25 	struct scm_device *scmdev = to_scm_dev(dev);  in scmdev_probe()  local
28 return scmdrv->probe ? scmdrv->probe(scmdev) : -ENODEV; in scmdev_probe()
33 struct scm_device *scmdev = to_scm_dev(dev); in scmdev_remove() local
36 return scmdrv->remove ? scmdrv->remove(scmdev) : -ENODEV; in scmdev_remove()
78 struct scm_device *scmdev = aobrq->scmdev; in scm_irq_handler() local
79 struct scm_driver *scmdrv = to_scm_drv(scmdev->dev.driver); in scm_irq_handler()
81 scmdrv->handler(scmdev, aobrq->data, error); in scm_irq_handler()
89 struct scm_device *scmdev = to_scm_dev(dev); \
93 ret = sprintf(buf, "%u\n", scmdev->attrs.name); \
128 struct scm_device *scmdev = to_scm_dev(dev); in scmdev_release() local
130 kfree(scmdev); in scmdev_release()
133 static void scmdev_setup(struct scm_device *scmdev, struct sale *sale, in scmdev_setup() argument
136 dev_set_name(&scmdev->dev, "%016llx", (unsigned long long) sale->sa); in scmdev_setup()
137 scmdev->nr_max_block = max_blk_count; in scmdev_setup()
138 scmdev->address = sale->sa; in scmdev_setup()
139 scmdev->size = 1UL << size; in scmdev_setup()
140 scmdev->attrs.rank = sale->rank; in scmdev_setup()
141 scmdev->attrs.persistence = sale->p; in scmdev_setup()
142 scmdev->attrs.oper_state = sale->op_state; in scmdev_setup()
143 scmdev->attrs.data_state = sale->data_state; in scmdev_setup()
144 scmdev->attrs.rank = sale->rank; in scmdev_setup()
145 scmdev->attrs.release = sale->r; in scmdev_setup()
146 scmdev->attrs.res_id = sale->rid; in scmdev_setup()
147 scmdev->dev.parent = scm_root; in scmdev_setup()
148 scmdev->dev.bus = &scm_bus_type; in scmdev_setup()
149 scmdev->dev.release = scmdev_release; in scmdev_setup()
150 scmdev->dev.groups = scmdev_attr_groups; in scmdev_setup()
156 static void scmdev_update(struct scm_device *scmdev, struct sale *sale) in scmdev_update() argument
161 device_lock(&scmdev->dev); in scmdev_update()
162 changed = scmdev->attrs.rank != sale->rank || in scmdev_update()
163 scmdev->attrs.oper_state != sale->op_state; in scmdev_update()
164 scmdev->attrs.rank = sale->rank; in scmdev_update()
165 scmdev->attrs.oper_state = sale->op_state; in scmdev_update()
166 if (!scmdev->dev.driver) in scmdev_update()
168 scmdrv = to_scm_drv(scmdev->dev.driver); in scmdev_update()
170 scmdrv->notify(scmdev, SCM_CHANGE); in scmdev_update()
172 device_unlock(&scmdev->dev); in scmdev_update()
174 kobject_uevent(&scmdev->dev.kobj, KOBJ_CHANGE); in scmdev_update()
179 struct scm_device *scmdev = to_scm_dev(dev); in check_address() local
182 return scmdev->address == sale->sa; in check_address()
197 struct scm_device *scmdev; in scm_add() local
201 scmdev = scmdev_find(sale); in scm_add()
202 if (scmdev) { in scm_add()
203 scmdev_update(scmdev, sale); in scm_add()
205 put_device(&scmdev->dev); in scm_add()
208 scmdev = kzalloc(sizeof(*scmdev), GFP_KERNEL); in scm_add()
209 if (!scmdev) in scm_add()
211 scmdev_setup(scmdev, sale, scm_info->is, scm_info->mbc); in scm_add()
212 ret = device_register(&scmdev->dev); in scm_add()
215 put_device(&scmdev->dev); in scm_add()
259 struct scm_device *scmdev = to_scm_dev(dev); in scm_dev_avail() local
262 scmdrv->notify(scmdev, SCM_AVAIL); in scm_dev_avail()