• Alexander Inyukhin's avatar
    cdrom: handle TOC · bce31b67
    Alexander Inyukhin authored
    This patch should fix TOC handling for cdroms that can not play audio.  It
    extends commit af744e32 ("cdrom: don't
    check CDC_PLAY_AUDIO in cdrom_count_tracks()") with a safety check and
    non-audio ioctls support.
    
    Since CDC_PLAY_AUDIO flag was used not only to check ability to play audio
    but also to ensure that audio_ioctl was not NULL, all TOC-related
    operations had to use it.
    
    As far as I understand, now audio_ioctl is never NULL, so a sanity check
    during device registration should be sufficient.
    
    It was tested on Optiarc AD7203A device, that has no ability to play
    audio.
    
    Cc: Tejun Heo <tj@kernel.org>
    Cc: Jens Axboe <jens.axboe@oracle.com>
    Cc: Borislav Petkov <petkovbb@googlemail.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    [bart: remove now unneeded ->audio_ioctl check (noticed by Borislav)]
    Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    bce31b67
cdrom.c 94.7 KB