Skip to content

Commit ef5a54c

Browse files
krzklag-linaro
authored andcommitted
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>
1 parent fa9ccb6 commit ef5a54c

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

drivers/mfd/ezx-pcap.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,15 @@ static int ezx_pcap_probe(struct spi_device *spi)
384384
struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev);
385385
struct pcap_chip *pcap;
386386
int i, adc_irq;
387-
int ret = -ENODEV;
387+
int ret;
388388

389389
/* platform data is required */
390390
if (!pdata)
391-
goto ret;
391+
return -ENODEV;
392392

393393
pcap = devm_kzalloc(&spi->dev, sizeof(*pcap), GFP_KERNEL);
394-
if (!pcap) {
395-
ret = -ENOMEM;
396-
goto ret;
397-
}
394+
if (!pcap)
395+
return -ENOMEM;
398396

399397
spin_lock_init(&pcap->io_lock);
400398
spin_lock_init(&pcap->adc_lock);
@@ -407,17 +405,15 @@ static int ezx_pcap_probe(struct spi_device *spi)
407405
spi->mode = SPI_MODE_0 | (pdata->config & PCAP_CS_AH ? SPI_CS_HIGH : 0);
408406
ret = spi_setup(spi);
409407
if (ret)
410-
goto ret;
408+
return ret;
411409

412410
pcap->spi = spi;
413411

414412
/* setup irq */
415413
pcap->irq_base = pdata->irq_base;
416414
pcap->workqueue = create_singlethread_workqueue("pcapd");
417-
if (!pcap->workqueue) {
418-
ret = -ENOMEM;
419-
goto ret;
420-
}
415+
if (!pcap->workqueue)
416+
return -ENOMEM;
421417

422418
/* redirect interrupts to AP, except adcdone2 */
423419
if (!(pdata->config & PCAP_SECOND_PORT))

0 commit comments

Comments
 (0)