[PATCHv2] staging: pi433: pi433_if.c remove SET_CHECKED macro

Dan Carpenter dan.carpenter at oracle.com
Wed Dec 6 18:36:39 UTC 2017


On Mon, Dec 04, 2017 at 02:41:51PM +0300, Dan Carpenter wrote:
> drivers/staging/pi433/pi433_if.c
>    468          /* rx done, wait was interrupted or error occurred */
>    469  abort:
>    470          dev->interrupt_rx_allowed = true;
>    471          SET_CHECKED(rf69_set_mode(dev->spi, standby));
>    472          wake_up_interruptible(&dev->tx_wait_queue);
>    473  
>    474          if (retval)
>    475                  return retval;
>    476          else
>    477                  return bytes_total;
> 

I just want to clarify that what I'm suggesting here is something like
this:

	/* rx done, wait was interrupted or error occurred */
abort:
	dev->interrupt_rx_allowed = true;
-	SET_CHECKED(rf69_set_mode(dev->spi, standby));
+	if (rf69_set_mode(dev->spi, standby))
+		pr_err("rf69_set_mode() failed to go standby\n");
	wake_up_interruptible(&dev->tx_wait_queue);

	if (retval)
		return retval;
	else
		return bytes_total;

I'm pretty sure we want to wake_up() even if it fails.  It's not likely
to fail, or if it does then we're probably screwed no matter what.  So
this is mostly theoretical.

regards,
dan carpenter


More information about the devel mailing list