From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F1E181C01A6 for ; Wed, 9 May 2018 13:47:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EE6E087542 for ; Wed, 9 May 2018 13:47:10 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2zx0rAY2KD51 for ; Wed, 9 May 2018 13:47:10 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by whitealder.osuosl.org (Postfix) with ESMTPS id 33DFA8752D for ; Wed, 9 May 2018 13:47:10 +0000 (UTC) Date: Wed, 9 May 2018 16:46:56 +0300 From: Dan Carpenter Subject: Re: [PATCH 09/28] staging: most: i2c: avoid polling in case of misconfig Message-ID: <20180509134656.acpak243i7yb56tf@mwanda> References: <1525772716-15742-1-git-send-email-christian.gromm@microchip.com> <1525772716-15742-10-git-send-email-christian.gromm@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1525772716-15742-10-git-send-email-christian.gromm@microchip.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Christian Gromm Cc: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org 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 > --- > 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`. regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel