aboutsummaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 53f2238e69c8..00da5219ee37 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -17,11 +17,15 @@
17#include <linux/buffer_head.h> 17#include <linux/buffer_head.h>
18#include <linux/mutex.h> 18#include <linux/mutex.h>
19 19
20#include "blk.h"
21
20static DEFINE_MUTEX(block_class_lock); 22static DEFINE_MUTEX(block_class_lock);
21#ifndef CONFIG_SYSFS_DEPRECATED 23#ifndef CONFIG_SYSFS_DEPRECATED
22struct kobject *block_depr; 24struct kobject *block_depr;
23#endif 25#endif
24 26
27static struct device_type disk_type;
28
25/* 29/*
26 * Can be deleted altogether. Later. 30 * Can be deleted altogether. Later.
27 * 31 *
@@ -346,8 +350,6 @@ const struct seq_operations partitions_op = {
346#endif 350#endif
347 351
348 352
349extern int blk_dev_init(void);
350
351static struct kobject *base_probe(dev_t devt, int *part, void *data) 353static struct kobject *base_probe(dev_t devt, int *part, void *data)
352{ 354{
353 if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0) 355 if (request_module("block-major-%d-%d", MAJOR(devt), MINOR(devt)) > 0)
@@ -358,7 +360,9 @@ static struct kobject *base_probe(dev_t devt, int *part, void *data)
358 360
359static int __init genhd_device_init(void) 361static int __init genhd_device_init(void)
360{ 362{
361 class_register(&block_class); 363 int error = class_register(&block_class);
364 if (unlikely(error))
365 return error;
362 bdev_map = kobj_map_init(base_probe, &block_class_lock); 366 bdev_map = kobj_map_init(base_probe, &block_class_lock);
363 blk_dev_init(); 367 blk_dev_init();
364 368
@@ -502,7 +506,7 @@ struct class block_class = {
502 .name = "block", 506 .name = "block",
503}; 507};
504 508
505struct device_type disk_type = { 509static struct device_type disk_type = {
506 .name = "disk", 510 .name = "disk",
507 .groups = disk_attr_groups, 511 .groups = disk_attr_groups,
508 .release = disk_release, 512 .release = disk_release,
@@ -632,12 +636,14 @@ static void media_change_notify_thread(struct work_struct *work)
632 put_device(gd->driverfs_dev); 636 put_device(gd->driverfs_dev);
633} 637}
634 638
639#if 0
635void genhd_media_change_notify(struct gendisk *disk) 640void genhd_media_change_notify(struct gendisk *disk)
636{ 641{
637 get_device(disk->driverfs_dev); 642 get_device(disk->driverfs_dev);
638 schedule_work(&disk->async_notify); 643 schedule_work(&disk->async_notify);
639} 644}
640EXPORT_SYMBOL_GPL(genhd_media_change_notify); 645EXPORT_SYMBOL_GPL(genhd_media_change_notify);
646#endif /* 0 */
641 647
642dev_t blk_lookup_devt(const char *name) 648dev_t blk_lookup_devt(const char *name)
643{ 649{