Commit 6fd89167 authored by Patrick Mochel's avatar Patrick Mochel

fs/partitions/check.c - minor updates

- remove extraneous header.
- check for error when doing kobject_add() for gendisk.
parent 03929468
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/blk.h> #include <linux/blk.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <../drivers/base/fs/fs.h> /* Eeeeewwwww */
#include "check.h" #include "check.h"
...@@ -399,13 +398,15 @@ void register_disk(struct gendisk *disk) ...@@ -399,13 +398,15 @@ void register_disk(struct gendisk *disk)
struct block_device *bdev; struct block_device *bdev;
char *s; char *s;
int j; int j;
int err;
strncpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN); strncpy(disk->kobj.name,disk->disk_name,KOBJ_NAME_LEN);
/* ewww... some of these buggers have / in name... */ /* ewww... some of these buggers have / in name... */
s = strchr(disk->kobj.name, '/'); s = strchr(disk->kobj.name, '/');
if (s) if (s)
*s = '!'; *s = '!';
kobject_add(&disk->kobj); if ((err = kobject_add(&disk->kobj)))
return;
disk_sysfs_symlinks(disk); disk_sysfs_symlinks(disk);
if (disk->flags & GENHD_FL_CD) if (disk->flags & GENHD_FL_CD)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment