Lines Matching refs:fm

165 	struct tifm_adapter *fm = container_of(dev, struct tifm_adapter, dev);  in tifm_free()  local
167 kfree(fm); in tifm_free()
178 struct tifm_adapter *fm; in tifm_alloc_adapter() local
180 fm = kzalloc(sizeof(struct tifm_adapter) in tifm_alloc_adapter()
182 if (fm) { in tifm_alloc_adapter()
183 fm->dev.class = &tifm_adapter_class; in tifm_alloc_adapter()
184 fm->dev.parent = dev; in tifm_alloc_adapter()
185 device_initialize(&fm->dev); in tifm_alloc_adapter()
186 spin_lock_init(&fm->lock); in tifm_alloc_adapter()
187 fm->num_sockets = num_sockets; in tifm_alloc_adapter()
189 return fm; in tifm_alloc_adapter()
193 int tifm_add_adapter(struct tifm_adapter *fm) in tifm_add_adapter() argument
199 rc = idr_alloc(&tifm_adapter_idr, fm, 0, 0, GFP_NOWAIT); in tifm_add_adapter()
201 fm->id = rc; in tifm_add_adapter()
207 dev_set_name(&fm->dev, "tifm%u", fm->id); in tifm_add_adapter()
208 rc = device_add(&fm->dev); in tifm_add_adapter()
211 idr_remove(&tifm_adapter_idr, fm->id); in tifm_add_adapter()
219 void tifm_remove_adapter(struct tifm_adapter *fm) in tifm_remove_adapter() argument
224 for (cnt = 0; cnt < fm->num_sockets; ++cnt) { in tifm_remove_adapter()
225 if (fm->sockets[cnt]) in tifm_remove_adapter()
226 device_unregister(&fm->sockets[cnt]->dev); in tifm_remove_adapter()
230 idr_remove(&tifm_adapter_idr, fm->id); in tifm_remove_adapter()
232 device_del(&fm->dev); in tifm_remove_adapter()
236 void tifm_free_adapter(struct tifm_adapter *fm) in tifm_free_adapter() argument
238 put_device(&fm->dev); in tifm_free_adapter()
249 struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, in tifm_alloc_device() argument
265 sock->dev.parent = fm->dev.parent; in tifm_alloc_device()
267 sock->dev.dma_mask = fm->dev.parent->dma_mask; in tifm_alloc_device()
271 tifm_media_type_name(type, 2), fm->id, id); in tifm_alloc_device()
274 tifm_media_type_name(type, 0), fm->id, id); in tifm_alloc_device()
282 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_eject() local
283 fm->eject(fm, sock); in tifm_eject()
289 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_has_ms_pif() local
290 return fm->has_ms_pif(fm, sock); in tifm_has_ms_pif()