Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp172963imj; Wed, 13 Feb 2019 06:33:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IY7nHhaBSzyZTCsJbNlR4Vq7Wodf3R4+o7Fvfk+LtbLRAST6XdKyAst9zgMbh1oKXzK5dA9 X-Received: by 2002:a63:618d:: with SMTP id v135mr414882pgb.238.1550068404679; Wed, 13 Feb 2019 06:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550068404; cv=none; d=google.com; s=arc-20160816; b=1GIwbAVKmTeCxRR579++lYWbIriNWngLyoNW/JmO9tvi/6iVvbVMUy2VkNpog5oZln eU34FkMtRdsJk6oEPnSpr/hgELmEPMwU+zzd23UdPDH3wr4nz/nxiIdusS2fkw2iXl1v XsLIu2WxdgGzJ3SHGvmK/HrtvLGcL1H/JJD4vOu2GLA7YAa8WHagv97TEz2WDvNQBnSk gAVAucuTUFNdgtA64sUQSMlM6z2ZF5KwW79CFevfaGmlN2sMmDKQiOmeE7MAkwEvCyf1 k7NPiDpXyZDWUTLT4KRmK8/hIRZkJdtTjLzqc6t/poBLCsIFo5xVIjAXxtCaQt6uDYsS DKmw== 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=kOiiFrA5j18jRpqBTDSiiLI1IM+ozLJzbXOSghDje+c=; b=ojtQOmskWRTbjWsoUdGpllj8eYpj3VTPOAWyLD+K4k2ZtPKAyZNJsPWOD3/OmbWC/K 6RoTvH6t0bS8A2a/cTksvfsVMACmCNEURE6hh0Av3NqKeZnd3tNUGVBNWOlHjs8VhaCs cTD9+MqYLAL9PVJN2c7JsospiUOqWPKjij6XbovL0mC25CdvWyu5Z9Zi/sZ5w/NpGxQ3 dMvd8tUjfXDGzQZFU5wfGXoP6Jr48kHLAxTOVKOSo79f7FMkoplcspMp2ICdcy5Yasgk XXFHw73wFWZoZXtezxyBSEfJ7/sNv7IqWEIV6wnAdh4i083lzGl1MbKDDDZ5BZezmq9P wypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oXSp1c4t; 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 j3si8197271pgf.402.2019.02.13.06.33.05; Wed, 13 Feb 2019 06:33:24 -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=oXSp1c4t; 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 S2390198AbfBMNR7 (ORCPT + 99 others); Wed, 13 Feb 2019 08:17:59 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43508 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730377AbfBMNR7 (ORCPT ); Wed, 13 Feb 2019 08:17:59 -0500 Received: by mail-wr1-f66.google.com with SMTP id r2so2422279wrv.10; Wed, 13 Feb 2019 05:17:57 -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=kOiiFrA5j18jRpqBTDSiiLI1IM+ozLJzbXOSghDje+c=; b=oXSp1c4tKFCLPyDGrQcBh0Tg5/irFTUdK+wiZaJyM77FfK4sFCDI+ssXMJdWcMgJAX xrnWJ/4rufx2ry+tXUAgNwjUHl1aeOmwIIYNQPRfeWNEcJsQTB/wd6FBe/VkMCISMgun sqGYNAMLJLgxEWIyKY42cRJMF8p4OugR7rTfo8vIjmrhQ7VKdYM9bYBNTFiZOUrjTzKI OsNY2Rr0YQdBLbKrdsRLLUMx8oWM9MPhKK+XPi8VxbDm/s+dMbyC8YEGr5bLGG778Mcc l+wj7KqfzaWGpEag7pizScR99rxQfi1lHNWjZQRimjqCV/w3m0Xx/HJIQl5Omdv3/MLd riaQ== 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=kOiiFrA5j18jRpqBTDSiiLI1IM+ozLJzbXOSghDje+c=; b=DXWcV6PmZjkDN8hhdy6gRHVqcRMuxgN46itNfykoFrzTPL46usuv5UQ1MUAxHi1B9K sADZeDoa5WRzkCkhZKJuYMZq+K9UjhEhfTySuTkzjIyrKRFQmkHPGfb7PXXm4sGJDIHg AEYVaKVwzAL3RskCx1cxCIP5gjuTGiMNSiOJsrWF5gJJVEU1nBYYXVbaoQs7i8d5u4Ou 6MwB3/vaAx4KOWRUONbBaK8b7RCH6hKDOCyCdvMf4Ky9c2Xn1lcDPC/7tL36e3PJNGGS yvp/QkbnS4KALFzldy97lrReAGfpvBXd3JtLefho/8fY0FBPCKyKQuKuuJfR45RUkEZV qHqQ== X-Gm-Message-State: AHQUAuaw5q9QOKm6uUxwJM8DjUCcnBGK4wbw5HDQOtF1gCuPGNQ3m0Dk 4Tf7AsQy3f+roIE/c8xlj9w= X-Received: by 2002:a5d:55c5:: with SMTP id i5mr382460wrw.245.1550063876817; Wed, 13 Feb 2019 05:17:56 -0800 (PST) Received: from fuji.Parrot.Biz (smtp.parrot.biz. [62.23.167.188]) by smtp.gmail.com with ESMTPSA id y24sm12765937wma.0.2019.02.13.05.17.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 05:17:56 -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] iio: trigger: Print an error if there is no available irq Date: Wed, 13 Feb 2019 14:17:52 +0100 Message-Id: <20190213131752.646-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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c index ce66699c7fcc..801986c21467 100644 --- a/drivers/iio/industrialio-trigger.c +++ b/drivers/iio/industrialio-trigger.c @@ -254,8 +254,12 @@ 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 limit " + "might be exceeded\n", trig->name); goto out_put_module; + } /* Request irq */ ret = request_threaded_irq(pf->irq, pf->h, pf->thread, -- 2.17.1