aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r--drivers/ide/ide-cd.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 638becda81c6..252ab8295edf 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -3059,10 +3059,14 @@ int ide_cdrom_probe_capabilities (ide_drive_t *drive)
3059 return nslots; 3059 return nslots;
3060} 3060}
3061 3061
3062#ifdef CONFIG_IDE_PROC_FS
3062static void ide_cdrom_add_settings(ide_drive_t *drive) 3063static void ide_cdrom_add_settings(ide_drive_t *drive)
3063{ 3064{
3064 ide_add_setting(drive, "dsc_overlap", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL); 3065 ide_add_setting(drive, "dsc_overlap", SETTING_RW, TYPE_BYTE, 0, 1, 1, 1, &drive->dsc_overlap, NULL);
3065} 3066}
3067#else
3068static inline void ide_cdrom_add_settings(ide_drive_t *drive) { ; }
3069#endif
3066 3070
3067/* 3071/*
3068 * standard prep_rq_fn that builds 10 byte cmds 3072 * standard prep_rq_fn that builds 10 byte cmds
@@ -3274,7 +3278,7 @@ int ide_cdrom_setup (ide_drive_t *drive)
3274 return 0; 3278 return 0;
3275} 3279}
3276 3280
3277#ifdef CONFIG_PROC_FS 3281#ifdef CONFIG_IDE_PROC_FS
3278static 3282static
3279sector_t ide_cdrom_capacity (ide_drive_t *drive) 3283sector_t ide_cdrom_capacity (ide_drive_t *drive)
3280{ 3284{
@@ -3291,7 +3295,7 @@ static void ide_cd_remove(ide_drive_t *drive)
3291{ 3295{
3292 struct cdrom_info *info = drive->driver_data; 3296 struct cdrom_info *info = drive->driver_data;
3293 3297
3294 ide_unregister_subdriver(drive, info->driver); 3298 ide_proc_unregister_driver(drive, info->driver);
3295 3299
3296 del_gendisk(info->disk); 3300 del_gendisk(info->disk);
3297 3301
@@ -3321,7 +3325,7 @@ static void ide_cd_release(struct kref *kref)
3321 3325
3322static int ide_cd_probe(ide_drive_t *); 3326static int ide_cd_probe(ide_drive_t *);
3323 3327
3324#ifdef CONFIG_PROC_FS 3328#ifdef CONFIG_IDE_PROC_FS
3325static int proc_idecd_read_capacity 3329static int proc_idecd_read_capacity
3326 (char *page, char **start, off_t off, int count, int *eof, void *data) 3330 (char *page, char **start, off_t off, int count, int *eof, void *data)
3327{ 3331{
@@ -3336,8 +3340,6 @@ static ide_proc_entry_t idecd_proc[] = {
3336 { "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL }, 3340 { "capacity", S_IFREG|S_IRUGO, proc_idecd_read_capacity, NULL },
3337 { NULL, 0, NULL, NULL } 3341 { NULL, 0, NULL, NULL }
3338}; 3342};
3339#else
3340# define idecd_proc NULL
3341#endif 3343#endif
3342 3344
3343static ide_driver_t ide_cdrom_driver = { 3345static ide_driver_t ide_cdrom_driver = {
@@ -3355,7 +3357,9 @@ static ide_driver_t ide_cdrom_driver = {
3355 .end_request = ide_end_request, 3357 .end_request = ide_end_request,
3356 .error = __ide_error, 3358 .error = __ide_error,
3357 .abort = __ide_abort, 3359 .abort = __ide_abort,
3360#ifdef CONFIG_IDE_PROC_FS
3358 .proc = idecd_proc, 3361 .proc = idecd_proc,
3362#endif
3359}; 3363};
3360 3364
3361static int idecd_open(struct inode * inode, struct file * file) 3365static int idecd_open(struct inode * inode, struct file * file)
@@ -3517,7 +3521,7 @@ static int ide_cd_probe(ide_drive_t *drive)
3517 3521
3518 ide_init_disk(g, drive); 3522 ide_init_disk(g, drive);
3519 3523
3520 ide_register_subdriver(drive, &ide_cdrom_driver); 3524 ide_proc_register_driver(drive, &ide_cdrom_driver);
3521 3525
3522 kref_init(&info->kref); 3526 kref_init(&info->kref);
3523 3527
@@ -3534,7 +3538,7 @@ static int ide_cd_probe(ide_drive_t *drive)
3534 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE; 3538 g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
3535 if (ide_cdrom_setup(drive)) { 3539 if (ide_cdrom_setup(drive)) {
3536 struct cdrom_device_info *devinfo = &info->devinfo; 3540 struct cdrom_device_info *devinfo = &info->devinfo;
3537 ide_unregister_subdriver(drive, &ide_cdrom_driver); 3541 ide_proc_unregister_driver(drive, &ide_cdrom_driver);
3538 kfree(info->buffer); 3542 kfree(info->buffer);
3539 kfree(info->toc); 3543 kfree(info->toc);
3540 kfree(info->changer_info); 3544 kfree(info->changer_info);