• Martin Sperl's avatar
    spi: bcm2835aux: fix driver to not allow 65535 (=-1) cs-gpios · 509c5836
    Martin Sperl authored
    The original driver by default defines num_chipselects as -1.
    This actually allicates an array of 65535 entries in
    of_spi_register_master.
    
    There is a side-effect for buggy device trees that (contrary to
    dt-binding documentation) have no cs-gpio defined.
    
    This mode was never supported by the driver due to limitations
    of native cs and additional code complexity and is explicitly
    not stated to be implemented.
    
    To keep backwards compatibility with such buggy DTs we limit
    the number of chip_selects to 1, as for all practical purposes
    it is only ever realistic to use a single chip select in
    native cs mode without negative side-effects.
    
    Fixes: 1ea29b39 ("spi: bcm2835aux: add bcm2835 auxiliary spi device...")
    Signed-off-by: default avatarMartin Sperl <kernel@martin.sperl.org>
    Acked-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    509c5836
spi-bcm2835aux.c 15 KB