From patchwork Tue Oct 20 21:34:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 533279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 5E4771401DE; Wed, 21 Oct 2015 08:37:33 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Zoeb4-0002cJ-7a; Tue, 20 Oct 2015 21:37:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ZoeZf-0001dB-91 for kernel-team@lists.ubuntu.com; Tue, 20 Oct 2015 21:36:03 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZoeZf-00028t-2h; Tue, 20 Oct 2015 21:36:03 +0000 Received: from kamal by fourier with local (Exim 4.82) (envelope-from ) id 1ZoeZc-0001x5-SI; Tue, 20 Oct 2015 14:36:00 -0700 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 3.13.y-ckt 20/85] iio: industrialio-buffer: Fix iio_buffer_poll return value Date: Tue, 20 Oct 2015 14:34:36 -0700 Message-Id: <1445376941-7046-21-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445376941-7046-1-git-send-email-kamal@canonical.com> References: <1445376941-7046-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Cc: Cristina Opriceana , Kamal Mostafa , Jonathan Cameron X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.13.11-ckt28 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Cristina Opriceana commit 1bdc0293901cbea23c6dc29432e81919d4719844 upstream. Change return value to 0 if no device is bound since unsigned int cannot support negative error codes. Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the device has been unregistered") Signed-off-by: Cristina Opriceana Signed-off-by: Jonathan Cameron Signed-off-by: Kamal Mostafa --- drivers/iio/industrialio-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index d660c89..1d05805 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -67,7 +67,7 @@ unsigned int iio_buffer_poll(struct file *filp, struct iio_buffer *rb = indio_dev->buffer; if (!indio_dev->info) - return -ENODEV; + return 0; poll_wait(filp, &rb->pollq, wait); if (rb->stufftoread)