Skip to content

Commit

Permalink
ide-cd: put proc-related functions together under single ifdef
Browse files Browse the repository at this point in the history
[bart: ported it over Paolo's patch]

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 177773e commit 1134b6f
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,19 +1898,6 @@ int ide_cdrom_setup(ide_drive_t *drive)
return 0;
}

#ifdef CONFIG_IDE_PROC_FS
static
sector_t ide_cdrom_capacity(ide_drive_t *drive)
{
unsigned long capacity, sectors_per_frame;

if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame, NULL))
return 0;

return capacity * sectors_per_frame;
}
#endif

static void ide_cd_remove(ide_drive_t *drive)
{
struct cdrom_info *info = drive->driver_data;
Expand Down Expand Up @@ -1943,6 +1930,16 @@ static void ide_cd_release(struct kref *kref)
static int ide_cd_probe(ide_drive_t *);

#ifdef CONFIG_IDE_PROC_FS
static sector_t ide_cdrom_capacity(ide_drive_t *drive)
{
unsigned long capacity, sectors_per_frame;

if (cdrom_read_capacity(drive, &capacity, &sectors_per_frame, NULL))
return 0;

return capacity * sectors_per_frame;
}

static int proc_idecd_read_capacity
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
Expand Down

0 comments on commit 1134b6f

Please sign in to comment.