• Andrew Morton's avatar
    [PATCH] DAC960 patch to entry points with a new fix · 946f68b9
    Andrew Morton authored
    From: Dave Olien <dmo@osdl.org>
    
    Christoph submitted a patch to linus last week fixing up some DAC960 driver
    entry points.  That patch will OOPS during boot on version 2 controller
    types.  Christoph's version of the disk_size() function was dereferencing
    a NULL pointer in it's "else" clause.
    
    Christoph's patch hasn't appeared in linus's BK tree yet.  So, I'm
    resending Christoph's orignal patch with my fix to disk_size() included.
    This patch can be applied to the driver in Linus's BK tree from April 28.
    
    Here's Christoph's original description of his patch:
    
    Some grepping showed that DAC960's open routine was duplicating parts
    of check_disk_change().  I went on fixing this by implementing a
    media_changed method and making DAC960_Open use it.  While looking
    at the surrounding code I noticed that
    
      (a) all methods weren't using the private data the upperlayer
          hands to it properly, but instead using kdev_t-based indexes
      (b) DAC960_Open/DAC960_Release was keeping never used counters
      (c) DAC960_Open was doing tons of checks the upperlayer already does
      (d) DAC960_Release was entirely superflous.
    
    The patch below corrects that and rewrites the block entry points
    into readable code - 100 LOC are gone and the same amount replaced
    by readable code.
    946f68b9
DAC960.c 255 KB