Bug 17703

Summary: /usr/share/examples/kld/cdev won't compile
Product: Base System Reporter: bryan <bryan>
Component: miscAssignee: dfr
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description bryan 2000-03-31 06:50:00 UTC
/usr/share/examples/kld/cdev is out of date and will no longer
compile under FreeBSD 4.0-STABLE.

Fix: this is my first experience with KLDs, so i used the vn
device as an example.  apologies if that was a poor choice
of example.. i don't know any better yet. ;)

see patch below or at:
  http://www.barmetta.com/freebsd/examples-kld-cdev.patch
How-To-Repeat: 
cd /usr/share/examples/kld/cdev
make
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-03-31 10:58:54 UTC
Responsible Changed
From-To: freebsd-bugs->dfr

Doug's baby. 

Comment 2 Bruce Evans 2000-03-31 11:06:12 UTC
On Thu, 30 Mar 2000 bryan@barmetta.com wrote:

> this is my first experience with KLDs, so i used the vn
> device as an example.  apologies if that was a poor choice
> of example.. i don't know any better yet. ;)

It was a poor choice :-).

vn gives many bad examples, in particular its use of an event handler,
cdevsw_add() and cdevsw_remove().  Event handlers are not necessary 
for at least most drivers (the newbus framework is more convenient),
and cdevsw_add() and cdevsw_remove() are deprecated (passing the devsw
via make_dev() should be sufficient).

The joy driver is a much better example of a simple driver.

Bruce
Comment 3 Maxim Sobolev freebsd_committer freebsd_triage 2000-10-02 15:28:20 UTC
State Changed
From-To: open->closed

Similar fix committed. Anyway thank you for submission!