Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi/dln2: simplify return flow for dln2_spi_transfer_setup and dln2_spi_enable

This fixes the following kbuild test robot warnings:

>> drivers/spi/spi-dln2.c:124:1-4: WARNING: end returns can be simplified if negative or 0 value
>> drivers/spi/spi-dln2.c:656:1-4: WARNING: end returns can be simplified if negative or 0 value

Additionally, fix a comment after switching from CONFIG_PM_RUNTIME to
CONFIG_PM.

Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Laurentiu Palcu and committed by
Mark Brown
2b5e368e b2e5dda1

+3 -12
+3 -12
drivers/spi/spi-dln2.c
··· 103 103 */ 104 104 static int dln2_spi_enable(struct dln2_spi *dln2, bool enable) 105 105 { 106 - int ret; 107 106 u16 cmd; 108 107 struct { 109 108 u8 port; ··· 120 121 cmd = DLN2_SPI_DISABLE; 121 122 } 122 123 123 - ret = dln2_transfer_tx(dln2->pdev, cmd, &tx, len); 124 - if (ret < 0) 125 - return ret; 126 - 127 - return 0; 124 + return dln2_transfer_tx(dln2->pdev, cmd, &tx, len); 128 125 } 129 126 130 127 /* ··· 648 653 dln2->bpw = bpw; 649 654 } 650 655 651 - ret = dln2_spi_enable(dln2, true); 652 - if (ret < 0) 653 - return ret; 654 - 655 - return 0; 656 + return dln2_spi_enable(dln2, true); 656 657 } 657 658 658 659 static int dln2_spi_transfer_one(struct spi_master *master, ··· 857 866 858 867 return dln2_spi_enable(dln2, true); 859 868 } 860 - #endif /* CONFIG_PM_RUNTIME */ 869 + #endif /* CONFIG_PM */ 861 870 862 871 static const struct dev_pm_ops dln2_spi_pm = { 863 872 SET_SYSTEM_SLEEP_PM_OPS(dln2_spi_suspend, dln2_spi_resume)