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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
ef5a54c5 fa9ccb6b

+7 -11
+7 -11
drivers/mfd/ezx-pcap.c
··· 384 384 struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev); 385 385 struct pcap_chip *pcap; 386 386 int i, adc_irq; 387 - int ret = -ENODEV; 387 + int ret; 388 388 389 389 /* platform data is required */ 390 390 if (!pdata) 391 - goto ret; 391 + return -ENODEV; 392 392 393 393 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; 398 396 399 397 spin_lock_init(&pcap->io_lock); 400 398 spin_lock_init(&pcap->adc_lock); ··· 405 407 spi->mode = SPI_MODE_0 | (pdata->config & PCAP_CS_AH ? SPI_CS_HIGH : 0); 406 408 ret = spi_setup(spi); 407 409 if (ret) 408 - goto ret; 410 + return ret; 409 411 410 412 pcap->spi = spi; 411 413 412 414 /* setup irq */ 413 415 pcap->irq_base = pdata->irq_base; 414 416 pcap->workqueue = create_singlethread_workqueue("pcapd"); 415 - if (!pcap->workqueue) { 416 - ret = -ENOMEM; 417 - goto ret; 418 - } 417 + if (!pcap->workqueue) 418 + return -ENOMEM; 419 419 420 420 /* redirect interrupts to AP, except adcdone2 */ 421 421 if (!(pdata->config & PCAP_SECOND_PORT))