Lines Matching refs:ddev
251 dfl_match_one_device(const struct dfl_device_id *id, struct dfl_device *ddev) in dfl_match_one_device() argument
253 if (id->type == ddev->type && id->feature_id == ddev->feature_id) in dfl_match_one_device()
261 struct dfl_device *ddev = to_dfl_dev(dev); in dfl_bus_match() local
268 if (dfl_match_one_device(id_entry, ddev)) { in dfl_bus_match()
269 ddev->id_entry = id_entry; in dfl_bus_match()
282 struct dfl_device *ddev = to_dfl_dev(dev); in dfl_bus_probe() local
284 return ddrv->probe(ddev); in dfl_bus_probe()
290 struct dfl_device *ddev = to_dfl_dev(dev); in dfl_bus_remove() local
293 ddrv->remove(ddev); in dfl_bus_remove()
298 struct dfl_device *ddev = to_dfl_dev(dev); in dfl_bus_uevent() local
301 ddev->type, ddev->feature_id); in dfl_bus_uevent()
307 struct dfl_device *ddev = to_dfl_dev(dev); in type_show() local
309 return sprintf(buf, "0x%x\n", ddev->type); in type_show()
316 struct dfl_device *ddev = to_dfl_dev(dev); in feature_id_show() local
318 return sprintf(buf, "0x%x\n", ddev->feature_id); in feature_id_show()
340 struct dfl_device *ddev = to_dfl_dev(dev); in release_dfl_dev() local
342 if (ddev->mmio_res.parent) in release_dfl_dev()
343 release_resource(&ddev->mmio_res); in release_dfl_dev()
345 ida_simple_remove(&dfl_device_ida, ddev->id); in release_dfl_dev()
346 kfree(ddev->irqs); in release_dfl_dev()
347 kfree(ddev); in release_dfl_dev()
356 struct dfl_device *ddev; in dfl_dev_add() local
359 ddev = kzalloc(sizeof(*ddev), GFP_KERNEL); in dfl_dev_add()
360 if (!ddev) in dfl_dev_add()
366 kfree(ddev); in dfl_dev_add()
371 device_initialize(&ddev->dev); in dfl_dev_add()
372 ddev->dev.parent = &pdev->dev; in dfl_dev_add()
373 ddev->dev.bus = &dfl_bus_type; in dfl_dev_add()
374 ddev->dev.release = release_dfl_dev; in dfl_dev_add()
375 ddev->id = id; in dfl_dev_add()
376 ret = dev_set_name(&ddev->dev, "dfl_dev.%d", id); in dfl_dev_add()
380 ddev->type = feature_dev_id_type(pdev); in dfl_dev_add()
381 ddev->feature_id = feature->id; in dfl_dev_add()
382 ddev->revision = feature->revision; in dfl_dev_add()
383 ddev->cdev = pdata->dfl_cdev; in dfl_dev_add()
387 ddev->mmio_res.flags = IORESOURCE_MEM; in dfl_dev_add()
388 ddev->mmio_res.start = parent_res->start; in dfl_dev_add()
389 ddev->mmio_res.end = parent_res->end; in dfl_dev_add()
390 ddev->mmio_res.name = dev_name(&ddev->dev); in dfl_dev_add()
391 ret = insert_resource(parent_res, &ddev->mmio_res); in dfl_dev_add()
394 dev_name(&ddev->dev), &ddev->mmio_res); in dfl_dev_add()
400 ddev->irqs = kcalloc(feature->nr_irqs, in dfl_dev_add()
401 sizeof(*ddev->irqs), GFP_KERNEL); in dfl_dev_add()
402 if (!ddev->irqs) { in dfl_dev_add()
408 ddev->irqs[i] = feature->irq_ctx[i].irq; in dfl_dev_add()
410 ddev->num_irqs = feature->nr_irqs; in dfl_dev_add()
413 ret = device_add(&ddev->dev); in dfl_dev_add()
417 dev_dbg(&pdev->dev, "add dfl_dev: %s\n", dev_name(&ddev->dev)); in dfl_dev_add()
418 return ddev; in dfl_dev_add()
422 put_device(&ddev->dev); in dfl_dev_add()
431 if (feature->ddev) { in dfl_devs_remove()
432 device_unregister(&feature->ddev->dev); in dfl_devs_remove()
433 feature->ddev = NULL; in dfl_devs_remove()
441 struct dfl_device *ddev; in dfl_devs_add() local
448 if (feature->ddev) { in dfl_devs_add()
453 ddev = dfl_dev_add(pdata, feature); in dfl_devs_add()
454 if (IS_ERR(ddev)) { in dfl_devs_add()
455 ret = PTR_ERR(ddev); in dfl_devs_add()
459 feature->ddev = ddev; in dfl_devs_add()