Lines Matching full:fm
164 struct tifm_adapter *fm = container_of(dev, struct tifm_adapter, dev); in tifm_free() local
166 kfree(fm); in tifm_free()
177 struct tifm_adapter *fm; in tifm_alloc_adapter() local
179 fm = kzalloc(sizeof(struct tifm_adapter) in tifm_alloc_adapter()
181 if (fm) { in tifm_alloc_adapter()
182 fm->dev.class = &tifm_adapter_class; in tifm_alloc_adapter()
183 fm->dev.parent = dev; in tifm_alloc_adapter()
184 device_initialize(&fm->dev); in tifm_alloc_adapter()
185 spin_lock_init(&fm->lock); in tifm_alloc_adapter()
186 fm->num_sockets = num_sockets; in tifm_alloc_adapter()
188 return fm; in tifm_alloc_adapter()
192 int tifm_add_adapter(struct tifm_adapter *fm) in tifm_add_adapter() argument
198 rc = idr_alloc(&tifm_adapter_idr, fm, 0, 0, GFP_NOWAIT); in tifm_add_adapter()
200 fm->id = rc; in tifm_add_adapter()
206 dev_set_name(&fm->dev, "tifm%u", fm->id); in tifm_add_adapter()
207 rc = device_add(&fm->dev); in tifm_add_adapter()
210 idr_remove(&tifm_adapter_idr, fm->id); in tifm_add_adapter()
218 void tifm_remove_adapter(struct tifm_adapter *fm) in tifm_remove_adapter() argument
223 for (cnt = 0; cnt < fm->num_sockets; ++cnt) { in tifm_remove_adapter()
224 if (fm->sockets[cnt]) in tifm_remove_adapter()
225 device_unregister(&fm->sockets[cnt]->dev); in tifm_remove_adapter()
229 idr_remove(&tifm_adapter_idr, fm->id); in tifm_remove_adapter()
231 device_del(&fm->dev); in tifm_remove_adapter()
235 void tifm_free_adapter(struct tifm_adapter *fm) in tifm_free_adapter() argument
237 put_device(&fm->dev); in tifm_free_adapter()
248 struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, in tifm_alloc_device() argument
264 sock->dev.parent = fm->dev.parent; in tifm_alloc_device()
266 sock->dev.dma_mask = fm->dev.parent->dma_mask; in tifm_alloc_device()
270 tifm_media_type_name(type, 2), fm->id, id); in tifm_alloc_device()
273 tifm_media_type_name(type, 0), fm->id, id); in tifm_alloc_device()
281 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_eject() local
282 fm->eject(fm, sock); in tifm_eject()
288 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_has_ms_pif() local
289 return fm->has_ms_pif(fm, sock); in tifm_has_ms_pif()