X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fblock%2Fparide%2Fpg.c;h=d89e7d32a3b604716a63a03edf7ad0fd3492f6a5;hb=fbeb1f19229baa9ee80f315e9d24635045455082;hp=79b868254032a68505abb3140b8918f8395ee4e2;hpb=79072f38909e3d9883317238887460c39ddcc4cb;p=powerpc.git diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 79b8682540..d89e7d32a3 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c @@ -156,7 +156,6 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY}; #include #include #include -#include #include #include #include @@ -228,7 +227,7 @@ static struct class *pg_class; /* kernel glue structures */ -static struct file_operations pg_fops = { +static const struct file_operations pg_fops = { .owner = THIS_MODULE, .read = pg_read, .write = pg_write, @@ -647,14 +646,14 @@ static int __init pg_init(void) int err; if (disable){ - err = -1; + err = -EINVAL; goto out; } pg_init_units(); if (pg_detect()) { - err = -1; + err = -ENODEV; goto out; } @@ -674,25 +673,15 @@ static int __init pg_init(void) err = PTR_ERR(pg_class); goto out_chrdev; } - devfs_mk_dir("pg"); for (unit = 0; unit < PG_UNITS; unit++) { struct pg *dev = &devices[unit]; - if (dev->present) { + if (dev->present) class_device_create(pg_class, NULL, MKDEV(major, unit), NULL, "pg%u", unit); - err = devfs_mk_cdev(MKDEV(major, unit), - S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u", - unit); - if (err) - goto out_class; - } } err = 0; goto out; -out_class: - class_device_destroy(pg_class, MKDEV(major, unit)); - class_destroy(pg_class); out_chrdev: unregister_chrdev(major, "pg"); out: @@ -705,13 +694,10 @@ static void __exit pg_exit(void) for (unit = 0; unit < PG_UNITS; unit++) { struct pg *dev = &devices[unit]; - if (dev->present) { + if (dev->present) class_device_destroy(pg_class, MKDEV(major, unit)); - devfs_remove("pg/%u", unit); - } } class_destroy(pg_class); - devfs_remove("pg"); unregister_chrdev(major, name); for (unit = 0; unit < PG_UNITS; unit++) {