*参照元 [#m8ea9c65]
#backlinks

*説明 [#oee20690]
-パス: [[linux-4.4.1/fs/char_dev.c]]

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


**引数 [#qfb25079]
-struct cdev *p
--
--[[linux-4.4.1/cdev]]
-dev_t dev
--
--[[linux-4.4.1/dev_t]]
-unsigned count
--


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


**参考 [#gcec26d2]


*実装 [#u40bbedc]
 /**
  * cdev_add() - add a char device to the system
  * @p: the cdev structure for the device
  * @dev: the first device number for which this device is responsible
  * @count: the number of consecutive minor numbers corresponding to this
  *         device
  *
  * cdev_add() adds the device represented by @p to the system, making it
  * live immediately.  A negative error code is returned on failure.
  */
 int cdev_add(struct cdev *p, dev_t dev, unsigned count)
 {
         int error;
 
         p->dev = dev;
         p->count = count;
 
         error = kobj_map(cdev_map, dev, count, NULL,
                          exact_match, exact_lock, p);
         if (error)
                 return error;
 
-
--[[linux-4.4.1/kobj_map()]]
--[[linux-4.4.1/cdev_map(global)]]
--[[linux-4.4.1/exact_match()]]
--[[linux-4.4.1/exact_lock()]]

         kobject_get(p->kobj.parent);
 
-
--[[linux-4.4.1/kobject_get()]]

         return 0;
 }
 
 ...
 
 EXPORT_SYMBOL(cdev_add);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]


*コメント [#uf9574a4]

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