Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp778905imp; Wed, 20 Feb 2019 08:52:03 -0800 (PST) X-Google-Smtp-Source: AHgI3IZPXIsOToRkomQK+K++DNSqMm2tNkl/cBce8YWaxZxKyxULocHW6yTEC1vB9Nyqmpmp840z X-Received: by 2002:a17:902:64:: with SMTP id 91mr38715502pla.229.1550681523558; Wed, 20 Feb 2019 08:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550681523; cv=none; d=google.com; s=arc-20160816; b=ngk/0a9N7RtbZMwFnZKMp+m6c07gCx/lhI6lpAzqV+I40LWtp+jOUSNK/lkoCK8nht 46eHsIRu7ByueRj+V4qUh8zKKMTRQRcutKU2gY8wFccimXa4+nD0b5uHDs56nwZaN2V7 7l0pYv0FZFV2dWfseTCWSM/T/DB3g+NnBQ1z/+GY6VGXo0eGCAZLS90S7vltkeohnkTc Q0EO7n0A9KtuBu/FzdLMcwW/9cDkxnTq1qaQZVJ4F0LLfHVX0x9na7pemvwJ5muJhhD1 H/Uvb72OhsRqUsyHOjlwxxYTeNDD9HjJirJMNQHglH4N63hvekpv211jHiYVzNY3QHES vj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=f4W6oinkmGScKTJv+WgnLXI6I+CKPXVl9FXKRYf2lKU=; b=jG1pfkvTWV5yPICcIC20KQVhP9ENUazRSM7fbp1giWZOIR7Z7RxzmZzzidhWc33vg1 29306AUBKrb9jPY4ii2eiqCIcdC5x74PXPDin3eWJ/+z1PsA0PtoGnYWzomtfT/R+Ut0 k6EoI3GiL6rbdnBRsJ9Rob//Ak1oslXGGFwqk2Sjb+qLEzFwL8EzMgwtHVdMR17rEOtA KjRaTEOT3wtBdC/4D67/ULPqONOOyDk1yJzwrXesqMCcf8vpjsUBVnkmESgEle4PD+8b YdRzipD2OtsGUfgMivfk+eNSS4EjWGGJxIwqeEwOtncmpgGbIOcN8iabW0w3RDEPwk6J mnFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BRU42akJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k70si5625952pge.257.2019.02.20.08.51.47; Wed, 20 Feb 2019 08:52:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BRU42akJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbfBTQt0 (ORCPT + 99 others); Wed, 20 Feb 2019 11:49:26 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:37314 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbfBTQt0 (ORCPT ); Wed, 20 Feb 2019 11:49:26 -0500 Received: by mail-wr1-f67.google.com with SMTP id c8so26834094wrs.4; Wed, 20 Feb 2019 08:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=f4W6oinkmGScKTJv+WgnLXI6I+CKPXVl9FXKRYf2lKU=; b=BRU42akJ6kXcJ4NhFWQzdoqwse1UaNOZC/E4TSXtnVYu3UrMBZclJyirl7rMYWmDIE gp0lviC/bYqSzH/QCG6YG25OAp40826AkbP6BqkB8M4y1+CFbM9jYvuN9Bd8ZB7Rb5mc GfuRdDnU//TH/8g/nLhHrUpzXHVN3gmhAjRzsj7zQV8eqQNYeNBu1nSItiVZlAMaGKIi RcVJhZr0zmy2H3GI2tD4y7xeYS0jHR9i5YkSecue03pss1zTwVeGpOYZpDbdwZUx4s5N 8FLsy2qcluwiag5TagRL4k1J1erVPoE5ynjugQo+cReqOmJFAHMz/eMuSunSdKxBwfSc BWaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=f4W6oinkmGScKTJv+WgnLXI6I+CKPXVl9FXKRYf2lKU=; b=JyOCt25GUIZ8gF2ckFprtVVRm7d0TjXSkMcCMDQAqdyNUKhrAsAwuF++icCOovSH0g ZXyEjxuYOTEhL9PGtlEJ8Yb5AZk4aI1kIywQ5bxxQlxIRQXOoRMLQkTe/nklTsGFWuiq lof4FYXsVMtmc+4tLDd+mKXNt9zOr4xgzVtEd6zJKOkxXn5wwZyQuejj3WsTLY+JDgWT FQ9sYJWdlLZIxo1mKtnMqVma3VBWXwyPAYciGvoii0ue0dz9244Q/O4BED3HK6WhmZ1g 378+0R60WHODi27UzgfHn5KP2r2FONuUc/D6G6lDRksjo6aWQUUM76aksoxTgO83qBIm McJA== X-Gm-Message-State: AHQUAubRDHdI0y93S+NrYbmdCPwUyweOYaDux0sqn4E2+oPQdziW+L7X /xaxN68NKS26gHld6Uddcbk= X-Received: by 2002:adf:ef4a:: with SMTP id c10mr25227232wrp.180.1550681364399; Wed, 20 Feb 2019 08:49:24 -0800 (PST) Received: from fuji.PARROT.BIZ (smtp.parrot.biz. [62.23.167.188]) by smtp.gmail.com with ESMTPSA id h17sm14912464wrq.17.2019.02.20.08.49.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Feb 2019 08:49:23 -0800 (PST) From: Mathieu Othacehe To: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Othacehe Subject: [PATCH v2] iio: trigger: Print an error if there is no available irq Date: Wed, 20 Feb 2019 17:49:10 +0100 Message-Id: <20190220164910.18517-1-m.othacehe@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there are more trigger consumers than CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will silently fail. Add an error message to inform the user that CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded. Signed-off-by: Mathieu Othacehe --- drivers/iio/industrialio-trigger.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index ce66699c7fcc..e5b538379ed1 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -254,8 +254,11 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig, /* Get irq number */ pf->irq = iio_trigger_get_irq(trig); - if (pf->irq < 0) + if (pf->irq < 0) { + pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n", + trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER); goto out_put_module; + } /* Request irq */ ret = request_threaded_irq(pf->irq, pf->h, pf->thread, -- 2.17.1