diff options
| author | Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> | 2026-03-06 00:45:47 +0300 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-03-25 15:45:55 +0300 |
| commit | ef5a54c542f5388df3f142a84de642d33790bd7b (patch) | |
| tree | e6026d110eaddafbb416d44da25d9148b363b1b5 | |
| parent | fa9ccb6b7fb4c5ac50613d1412a273a2031dcd2b (diff) | |
| download | linux-ef5a54c542f5388df3f142a84de642d33790bd7b.tar.xz | |
mfd: ezx-pcap: Return directly instead of empty gotos
Code is easier to read if empty error paths simply return, instead of
jumping to empty label doing only "return ret".
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260305-workqueue-devm-v2-8-66a38741c652@oss.qualcomm.com
Signed-off-by: Lee Jones <lee@kernel.org>
| -rw-r--r-- | drivers/mfd/ezx-pcap.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index cd0520a08224..8e51c113a320 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c @@ -384,17 +384,15 @@ static int ezx_pcap_probe(struct spi_device *spi) struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev); struct pcap_chip *pcap; int i, adc_irq; - int ret = -ENODEV; + int ret; /* platform data is required */ if (!pdata) - goto ret; + return -ENODEV; pcap = devm_kzalloc(&spi->dev, sizeof(*pcap), GFP_KERNEL); - if (!pcap) { - ret = -ENOMEM; - goto ret; - } + if (!pcap) + return -ENOMEM; spin_lock_init(&pcap->io_lock); spin_lock_init(&pcap->adc_lock); @@ -407,17 +405,15 @@ static int ezx_pcap_probe(struct spi_device *spi) spi->mode = SPI_MODE_0 | (pdata->config & PCAP_CS_AH ? SPI_CS_HIGH : 0); ret = spi_setup(spi); if (ret) - goto ret; + return ret; pcap->spi = spi; /* setup irq */ pcap->irq_base = pdata->irq_base; pcap->workqueue = create_singlethread_workqueue("pcapd"); - if (!pcap->workqueue) { - ret = -ENOMEM; - goto ret; - } + if (!pcap->workqueue) + return -ENOMEM; /* redirect interrupts to AP, except adcdone2 */ if (!(pdata->config & PCAP_SECOND_PORT)) |
