• Andrey Smirnov's avatar
    spi: Don't call spi_get_gpio_descs() before device name is set · cf0e0ec1
    Andrey Smirnov authored
    [ Upstream commit 0a919ae4 ]
    
    Move code calling spi_get_gpio_descs() to happen after ctlr->dev's
    name is set in order to have proper GPIO consumer names.
    
    Before:
    
    cat /sys/kernel/debug/gpio
    gpiochip0: GPIOs 0-31, parent: platform/40049000.gpio, vf610-gpio:
     gpio-6   (                    |regulator-usb0-vbus ) out lo
    
    gpiochip1: GPIOs 32-63, parent: platform/4004a000.gpio, vf610-gpio:
     gpio-36  (                    |scl                 ) in  hi
     gpio-37  (                    |sda                 ) in  hi
     gpio-40  (                    |(null) CS1          ) out lo
     gpio-41  (                    |(null) CS0          ) out lo ACTIVE LOW
     gpio-42  (                    |miso                ) in  hi
     gpio-43  (                    |mosi                ) in  lo
     gpio-44  (                    |sck                 ) out lo
    
    After:
    
    cat /sys/kernel/debug/gpio
    gpiochip0: GPIOs 0-31, parent: platform/40049000.gpio, vf610-gpio:
     gpio-6   (                    |regulator-usb0-vbus ) out lo
    
    gpiochip1: GPIOs 32-63, parent: platform/4004a000.gpio, vf610-gpio:
     gpio-36  (                    |scl                 ) in  hi
     gpio-37  (                    |sda                 ) in  hi
     gpio-40  (                    |spi0 CS1            ) out lo
     gpio-41  (                    |spi0 CS0            ) out lo ACTIVE LOW
     gpio-42  (                    |miso                ) in  hi
     gpio-43  (                    |mosi                ) in  lo
     gpio-44  (                    |sck                 ) out lo
    Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
    Cc: Mark Brown <broonie@kernel.org>
    Cc: Chris Healy <cphealy@gmail.com>
    Cc: linux-spi@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    cf0e0ec1
spi.c 99.9 KB