Lines Matching refs:fm

169 	struct tifm_adapter *fm = container_of(dev, struct tifm_adapter, dev);  in tifm_free()  local
171 kfree(fm); in tifm_free()
182 struct tifm_adapter *fm; in tifm_alloc_adapter() local
184 fm = kzalloc(sizeof(struct tifm_adapter) in tifm_alloc_adapter()
186 if (fm) { in tifm_alloc_adapter()
187 fm->dev.class = &tifm_adapter_class; in tifm_alloc_adapter()
188 fm->dev.parent = dev; in tifm_alloc_adapter()
189 device_initialize(&fm->dev); in tifm_alloc_adapter()
190 spin_lock_init(&fm->lock); in tifm_alloc_adapter()
191 fm->num_sockets = num_sockets; in tifm_alloc_adapter()
193 return fm; in tifm_alloc_adapter()
197 int tifm_add_adapter(struct tifm_adapter *fm) in tifm_add_adapter() argument
203 rc = idr_alloc(&tifm_adapter_idr, fm, 0, 0, GFP_NOWAIT); in tifm_add_adapter()
205 fm->id = rc; in tifm_add_adapter()
211 dev_set_name(&fm->dev, "tifm%u", fm->id); in tifm_add_adapter()
212 rc = device_add(&fm->dev); in tifm_add_adapter()
215 idr_remove(&tifm_adapter_idr, fm->id); in tifm_add_adapter()
223 void tifm_remove_adapter(struct tifm_adapter *fm) in tifm_remove_adapter() argument
228 for (cnt = 0; cnt < fm->num_sockets; ++cnt) { in tifm_remove_adapter()
229 if (fm->sockets[cnt]) in tifm_remove_adapter()
230 device_unregister(&fm->sockets[cnt]->dev); in tifm_remove_adapter()
234 idr_remove(&tifm_adapter_idr, fm->id); in tifm_remove_adapter()
236 device_del(&fm->dev); in tifm_remove_adapter()
240 void tifm_free_adapter(struct tifm_adapter *fm) in tifm_free_adapter() argument
242 put_device(&fm->dev); in tifm_free_adapter()
253 struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id, in tifm_alloc_device() argument
269 sock->dev.parent = fm->dev.parent; in tifm_alloc_device()
271 sock->dev.dma_mask = fm->dev.parent->dma_mask; in tifm_alloc_device()
275 tifm_media_type_name(type, 2), fm->id, id); in tifm_alloc_device()
278 tifm_media_type_name(type, 0), fm->id, id); in tifm_alloc_device()
286 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_eject() local
287 fm->eject(fm, sock); in tifm_eject()
293 struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); in tifm_has_ms_pif() local
294 return fm->has_ms_pif(fm, sock); in tifm_has_ms_pif()