diff options
author | phk <phk@FreeBSD.org> | 2003-09-26 10:41:44 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-09-26 10:41:44 +0000 |
commit | 30f60296f2c4a04dd8a71dee1209c14403ee5503 (patch) | |
tree | 8795ecabad50a2e053eed8460ee25684d138a2af /sys/dev/fb | |
parent | 6e7e1fbcfa621fca4d4d70560a1b2850c1f2c800 (diff) | |
download | FreeBSD-src-30f60296f2c4a04dd8a71dee1209c14403ee5503.zip FreeBSD-src-30f60296f2c4a04dd8a71dee1209c14403ee5503.tar.gz |
Change fb_attach() and fb_detach() to take a integer unit number rather
than a dev_t.
All of the dev_t's passed were bogusly created with makedev()
Diffstat (limited to 'sys/dev/fb')
-rw-r--r-- | sys/dev/fb/fb.c | 84 | ||||
-rw-r--r-- | sys/dev/fb/fbreg.h | 4 |
2 files changed, 5 insertions, 83 deletions
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c index d25de42..c47bd12 100644 --- a/sys/dev/fb/fb.c +++ b/sys/dev/fb/fb.c @@ -399,7 +399,7 @@ static moduledata_t fb_mod = { DECLARE_MODULE(fb, fb_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); int -fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) +fb_attach(int unit, video_adapter_t *adp, struct cdevsw *cdevsw) { int s; @@ -409,7 +409,7 @@ fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) return EINVAL; s = spltty(); - adp->va_minor = minor(dev); + adp->va_minor = unit; vidcdevsw[adp->va_index] = cdevsw; splx(s); @@ -418,7 +418,7 @@ fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) } int -fb_detach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) +fb_detach(int unit, video_adapter_t *adp, struct cdevsw *cdevsw) { int s; @@ -435,84 +435,6 @@ fb_detach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) return 0; } -#if experimental -static int -fbopen(dev_t dev, int flag, int mode, struct thread *td) -{ - int unit; - - unit = FB_UNIT(dev); - if (unit >= adapters) - return ENXIO; - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_open)(makedev(0, adapter[unit]->va_minor), - flag, mode, td); -} - -static int -fbclose(dev_t dev, int flag, int mode, struct thread *td) -{ - int unit; - - unit = FB_UNIT(dev); - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_close)(makedev(0, adapter[unit]->va_minor), - flag, mode, td); -} - -static int -fbread(dev_t dev, struct uio *uio, int flag) -{ - int unit; - - unit = FB_UNIT(dev); - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_read)(makedev(0, adapter[unit]->va_minor), - uio, flag); -} - -static int -fbwrite(dev_t dev, struct uio *uio, int flag) -{ - int unit; - - unit = FB_UNIT(dev); - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_write)(makedev(0, adapter[unit]->va_minor), - uio, flag); -} - -static int -fbioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct thread *td) -{ - int unit; - - unit = FB_UNIT(dev); - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_ioctl)(makedev(0, adapter[unit]->va_minor), - cmd, arg, flag, td); -} - -static int -fbmmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) -{ - int unit; - - unit = FB_UNIT(dev); - if (vidcdevsw[unit] == NULL) - return ENXIO; - return (*vidcdevsw[unit]->d_mmap)(makedev(0, adapter[unit]->va_minor), - offset, paddr, nprot); -} - -DEV_DRIVER_MODULE(fb, foo, fb_driver, fb_devclass, fb_cdevsw, 0, 0); -#endif - /* * Generic frame buffer cdev driver functions * Frame buffer subdrivers may call these functions to implement common diff --git a/sys/dev/fb/fbreg.h b/sys/dev/fb/fbreg.h index cf9116f..e7c91b6 100644 --- a/sys/dev/fb/fbreg.h +++ b/sys/dev/fb/fbreg.h @@ -222,9 +222,9 @@ int vid_configure(int flags); #ifdef FB_INSTALL_CDEV /* virtual frame buffer driver functions */ -int fb_attach(dev_t dev, video_adapter_t *adp, +int fb_attach(int unit, video_adapter_t *adp, struct cdevsw *cdevsw); -int fb_detach(dev_t dev, video_adapter_t *adp, +int fb_detach(int unit, video_adapter_t *adp, struct cdevsw *cdevsw); /* generic frame buffer cdev driver functions */ |