Re: [PATCH 09/28] staging: most: i2c: avoid polling in case of misconfig

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09.05.2018 15:46, Dan Carpenter wrote:
On Tue, May 08, 2018 at 11:44:57AM +0200, Christian Gromm wrote:
This patch prevents the driver from falling back to polling mode
in case of IRQ misconfiguration.

Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
---
  drivers/staging/most/i2c/i2c.c | 18 ++++++++++--------
  1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c
index a993e8e..e03cb6c 100644
--- a/drivers/staging/most/i2c/i2c.c
+++ b/drivers/staging/most/i2c/i2c.c
@@ -90,22 +90,24 @@ static int configure_channel(struct most_interface *most_iface,
  	}
if (channel_config->direction == MOST_CH_RX) {
-		dev->polling_mode = polling_req || dev->client->irq <= 0;
+		dev->polling_mode = polling_req;
  		if (!dev->polling_mode) {
-			pr_info("Requesting IRQ: %d\n", dev->client->irq);
+			if (dev->client->irq <= 0) {
+				pr_err("bad irq: %d\n", dev->client->irq);
+				return -ENOENT;
+			}

I was wondering about this at the time...  It would have been better to
fold this in with the earlier patch and it's pretty easy to fold patches
together with `git rebase -i`.

Yes probably, but isn't doing two things at a time a bad thing to do?

thanks,
Chris


regards,
dan carpenter



_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux