*参照元 [#x3585975]
#backlinks

*説明 [#i79b42be]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/v4l2-device.c]]

-FIXME: これは何?
--説明


**引数 [#p3443a9f]
-struct device *dev
--
--[[linux-4.4.1/device]]
-struct v4l2_device *v4l2_dev
--
--[[linux-4.4.1/v4l2_device]]


**返り値 [#v6327543]
-int
--


**参考 [#j3152f28]


*実装 [#eaa632c4]
 int v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev)
 {
         if (v4l2_dev == NULL)
                 return -EINVAL;
 
         INIT_LIST_HEAD(&v4l2_dev->subdevs);
         spin_lock_init(&v4l2_dev->lock);
         v4l2_prio_init(&v4l2_dev->prio);
         kref_init(&v4l2_dev->ref);
         get_device(dev);
         v4l2_dev->dev = dev;
         if (dev == NULL) {
                 /* If dev == NULL, then name must be filled in by the caller */
                 if (WARN_ON(!v4l2_dev->name[0]))
                         return -EINVAL;
                 return 0;
         }
 
-
--[[linux-4.4.1/INIT_LIST_HEAD()]]
--[[linux-4.4.1/spin_lock_init()]]
--[[linux-4.4.1/v4l2_prio_init()]]
--[[linux-4.4.1/kref_init()]]
--[[linux-4.4.1/get_device()]]
--[[linux-4.4.1/WARN_ON()]]

         /* Set name to driver name + device name if it is empty. */
         if (!v4l2_dev->name[0])
                 snprintf(v4l2_dev->name, sizeof(v4l2_dev->name), "%s %s",
                         dev->driver->name, dev_name(dev));
         if (!dev_get_drvdata(dev))
                 dev_set_drvdata(dev, v4l2_dev);
-
--[[linux-4.4.1/snprintf()]]
--[[linux-4.4.1/dev_name()]]
--[[linux-4.4.1/dev_get_drvdata()]]
--[[linux-4.4.1/dev_set_drvdata()]]

         return 0;
 }
 EXPORT_SYMBOL_GPL(v4l2_device_register);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]


*コメント [#s95d7e5b]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS