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
37 scmdrv->remove(scmdev); in scmdev_remove()
79 struct scm_device *scmdev = aobrq->scmdev; in scm_irq_handler() local
80 struct scm_driver *scmdrv = to_scm_drv(scmdev->dev.driver); in scm_irq_handler()
82 scmdrv->handler(scmdev, aobrq->data, error); in scm_irq_handler()
90 struct scm_device *scmdev = to_scm_dev(dev); \
94 ret = sprintf(buf, "%u\n", scmdev->attrs.name); \
129 struct scm_device *scmdev = to_scm_dev(dev); in scmdev_release() local
131 kfree(scmdev); in scmdev_release()
134 static void scmdev_setup(struct scm_device *scmdev, struct sale *sale, in scmdev_setup() argument
137 dev_set_name(&scmdev->dev, "%016llx", (unsigned long long) sale->sa); in scmdev_setup()
138 scmdev->nr_max_block = max_blk_count; in scmdev_setup()
139 scmdev->address = sale->sa; in scmdev_setup()
140 scmdev->size = 1UL << size; in scmdev_setup()
141 scmdev->attrs.rank = sale->rank; in scmdev_setup()
142 scmdev->attrs.persistence = sale->p; in scmdev_setup()
143 scmdev->attrs.oper_state = sale->op_state; in scmdev_setup()
144 scmdev->attrs.data_state = sale->data_state; in scmdev_setup()
145 scmdev->attrs.rank = sale->rank; in scmdev_setup()
146 scmdev->attrs.release = sale->r; in scmdev_setup()
147 scmdev->attrs.res_id = sale->rid; in scmdev_setup()
148 scmdev->dev.parent = scm_root; in scmdev_setup()
149 scmdev->dev.bus = &scm_bus_type; in scmdev_setup()
150 scmdev->dev.release = scmdev_release; in scmdev_setup()
151 scmdev->dev.groups = scmdev_attr_groups; in scmdev_setup()
157 static void scmdev_update(struct scm_device *scmdev, struct sale *sale) in scmdev_update() argument
162 device_lock(&scmdev->dev); in scmdev_update()
163 changed = scmdev->attrs.rank != sale->rank || in scmdev_update()
164 scmdev->attrs.oper_state != sale->op_state; in scmdev_update()
165 scmdev->attrs.rank = sale->rank; in scmdev_update()
166 scmdev->attrs.oper_state = sale->op_state; in scmdev_update()
167 if (!scmdev->dev.driver) in scmdev_update()
169 scmdrv = to_scm_drv(scmdev->dev.driver); in scmdev_update()
171 scmdrv->notify(scmdev, SCM_CHANGE); in scmdev_update()
173 device_unlock(&scmdev->dev); in scmdev_update()
175 kobject_uevent(&scmdev->dev.kobj, KOBJ_CHANGE); in scmdev_update()
180 struct scm_device *scmdev = to_scm_dev(dev); in check_address() local
183 return scmdev->address == sale->sa; in check_address()
198 struct scm_device *scmdev; in scm_add() local
202 scmdev = scmdev_find(sale); in scm_add()
203 if (scmdev) { in scm_add()
204 scmdev_update(scmdev, sale); in scm_add()
206 put_device(&scmdev->dev); in scm_add()
209 scmdev = kzalloc(sizeof(*scmdev), GFP_KERNEL); in scm_add()
210 if (!scmdev) in scm_add()
212 scmdev_setup(scmdev, sale, scm_info->is, scm_info->mbc); in scm_add()
213 ret = device_register(&scmdev->dev); in scm_add()
216 put_device(&scmdev->dev); in scm_add()
260 struct scm_device *scmdev = to_scm_dev(dev); in scm_dev_avail() local
263 scmdrv->notify(scmdev, SCM_AVAIL); in scm_dev_avail()