Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp782972imp; Wed, 20 Feb 2019 08:57:09 -0800 (PST) X-Google-Smtp-Source: AHgI3IYU7rTUmrwQBUF8bmZAUL7V8g0SHqAhFfZ8uo7JQ0S2xcgPvxWXyhJkQMrBg+BwsIMU+mWa X-Received: by 2002:a17:902:a506:: with SMTP id s6mr4678623plq.24.1550681829903; Wed, 20 Feb 2019 08:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550681829; cv=none; d=google.com; s=arc-20160816; b=HJJpXo5ZCema+6oadFfPvUZ3XEXyuF6gtqfTYHZhnWcvHy2nNtPBUqTFMRs5g34GsE DBFz+bLf7h3yn3XWvdf5ZvXr03Z6e+x5WlrXm5seQZoSJeHDB30qovqlMIM+Xgloqwl9 VMmjGB5i7Gn7aRwGI2dvcB/YEdbcZ0zrnWyc74BURgwHgV7ZpeFQX7Da4dkQniT/BhVG X9nbsiialEFHQeZd0iNHoE8pkDT53cMgEoC3Z8AYA8Jf7+z9q9tS1KdpzcErQNFnTxH9 H9yJtUfRc1VMnooRB3wxginy6Wk0lsrT7DvTbd2XOsQ7dj9K6e+OywPSoTtzz5Znfmwd xRyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=653FcqMCyzpI7qGVBbSKYIJIji5WXAw5KBlT2LKJtfE=; b=ANOZnpvIAtPAyqHNAJhDWZm74YFHsDMvaUYExbM/U6FUtwMiinzOQY/FRkc7BPqf/h kCb1D07hnHFjEosaJOn8LX73pLo9zhmA4YCkFxsfh2KguaXHAxd4cXQLmTl9ewFR8qL7 D+75T17xX6GHJIH2/uLQ0g8s05YJQ3gHqt/pdxfRpUzafZflIB5XnAUhAh0sy+pxSgrr BRKijWoLeZb4VY2XDOD66V5RimvrHIfjy8jPsh8UDVPfqKISue9/q5Zx/0pPCW0QBZof u4B7GaqV5XhsP/jbh7dp0C2V/U3wqy8dvThaAVHaqFpV8W7UBn+I+qamLjEdxRoCxZTE urYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OkmbynPD; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30si19628775ple.287.2019.02.20.08.56.54; Wed, 20 Feb 2019 08:57:09 -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=@kernel.org header.s=default header.b=OkmbynPD; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbfBTQ40 (ORCPT + 99 others); Wed, 20 Feb 2019 11:56:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:42646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725801AbfBTQ4Z (ORCPT ); Wed, 20 Feb 2019 11:56:25 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E9BF2084D; Wed, 20 Feb 2019 16:56:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550681784; bh=oIS7lSF4HXo//aiugYgaw2YVawOfHPqLXBn4b69cH7k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OkmbynPDy3YJ/EKR9KV+6+J86ZDBNyUP3mUEBVqI4pZ7OOH/xRVqvvwmCAYGpOSh9 syWl5sTtM73TPtLFGyWsgzCiD+mSSU/fRvBe2hY/PD/S/KlEHma75z6XYqNfdvA8uI wlzeExkIaCzpZMqW1EPGnElFnHYPOsE1Cytqkmwg= Date: Wed, 20 Feb 2019 16:56:19 +0000 From: Jonathan Cameron To: Mathieu Othacehe Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] iio: trigger: Print an error if there is no available irq Message-ID: <20190220165619.171da668@archlinux> In-Reply-To: <20190220164910.18517-1-m.othacehe@gmail.com> References: <20190220164910.18517-1-m.othacehe@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Feb 2019 17:49:10 +0100 Mathieu Othacehe wrote: > 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 Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > 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,