spi: acpi: remove superfluous parameter check
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 12 Mar 2020 13:45:07 +0000 (14:45 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 12 Mar 2020 17:38:41 +0000 (17:38 +0000)
to_spi_device() already checks 'dev'. No need to do it before calling
it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/20200312134507.10000-1-wsa@the-dreams.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c

index f6f6b2a..0996d23 100644 (file)
@@ -4028,7 +4028,7 @@ static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)
        struct device *dev;
 
        dev = bus_find_device_by_acpi_dev(&spi_bus_type, adev);
-       return dev ? to_spi_device(dev) : NULL;
+       return to_spi_device(dev);
 }
 
 static int acpi_spi_notify(struct notifier_block *nb, unsigned long value,