m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/char.c
diff options
context:
space:
mode:
Diffstat (limited to 'char.c')
-rw-r--r--char.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/char.c b/char.c
index 881c3d0..a4ba095 100644
--- a/char.c
+++ b/char.c
@@ -19,8 +19,9 @@ int next_minor = 0;
long doom_create_surface(struct file *filp, unsigned long arg)
{
struct doomdev_ioctl_create_surface *params;
+
params = (struct doomdev_ioctl_create_surface *)arg;
- return new_surface(params);
+ return new_surface(filp, params);
}
long doom_create_texture(struct file *filp, unsigned long arg)
@@ -81,33 +82,27 @@ int new_doomdev(struct pci_dev *dev)
doom_data = pci_get_drvdata(dev);
- doom_data->cdev = cdev_alloc();
- if (doom_data->cdev == NULL) {
- err = -ENOMEM;
- goto error_cdev;
- }
- cdev_init(doom_data->cdev, &doomdev_fops);
- ORFAIL(cdev_add(doom_data->cdev, first, 1), error_add);
+ cdev_init(&doom_data->cdev, &doomdev_fops);
+ ORFAIL(cdev_add(&doom_data->cdev, first, 1), error_add);
minor = next_minor++;
devt = MKDEV(major, minor);
doom_data->device = device_create(doom_class, &dev->dev, devt, NULL,
- "doom%d", minor),
+ "doom%d", minor);
ORFAIL_PTR(doom_data->device, error_create);
return 0;
error_create:
- cdev_del(doom_data->cdev);
+ cdev_del(&doom_data->cdev);
error_add:
-error_cdev:
return err;
}
void destroy_doomdev(struct doom_data *doom_data)
{
device_destroy(doom_class, doom_data->device->devt);
- cdev_del(doom_data->cdev);
+ cdev_del(&doom_data->cdev);
}
int char_init(void)