Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp475833imp; Wed, 20 Feb 2019 03:36:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IZyBy/HWm0Yf3LckVZ9TbhZvot66o+zRyPGl5ayBgFwoBc3Am4w6Zlllj3Y9UdTghJRnmPo X-Received: by 2002:a17:902:784c:: with SMTP id e12mr14547210pln.117.1550662608308; Wed, 20 Feb 2019 03:36:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550662608; cv=none; d=google.com; s=arc-20160816; b=s9ahTZAOrMkhfFv/o5T/cHSmd05rtg/JKe4Mh4gAjG94VIp/xJeyFOjMfKKUcvvU6H SmQp82XWsFz0cguPnbchtoCHfTAcBRFeIPDMq7W+w8Av7UmAXWyg6PMoJatKoZz1lobR JYBuU3EtbJJO8BEMnyMXXq8BgvVpMWcATY878MykxZSUxy9jOGTDbk9zCF6jOC8IDkvO Py7mM04QfH/IopwsDWEnyXGlGeMOsCCma2tdS+yw89n2lqzjVD5Z4MRbbP7rhxVF9d28 EhGexGe3xgTobZ/o2+Of6OrTdUS1SKO0DfyDTd7jfcFaQ/v2Af1Vn7Lyxv6iXnvdRTvp CVCg== 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=dyXgH6vXyUIINjcUuK8W1/QETddYANA+iB+ERqhXpLQ=; b=qdmEG00FzrWI+281CEzu9D/FvtbFYYJLkUWUjTamNqop/YdeGkJ+57uS4vBHXKWyQy KSQs5dAsX1rsJmG6L/CIMcy5iSZkJgwLarg+f0ObhW8h4487UewrX0skDuIk70JduOlC qAz1frd/hYDkwMut/C8R/3Owg5Pmje7tOZohKNw7EqAEh5xHb7CXvvNZ5c56RCXN8w5+ vNCWoPkbC3um8jhlmk+UH+9qUZZNUQpxmgj1/NeyX1X8KdMp5/oIUcfkx7f2XMSeSyv4 KhieF+sLo3xi5RTM3uSDImxzV0NoihxINanXMC9MQzpXPjEzv2BNiRS4H8fLcHztqxz7 ETsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a4+rH3AX; 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 b17si7898628pls.181.2019.02.20.03.36.32; Wed, 20 Feb 2019 03:36:48 -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=a4+rH3AX; 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 S1726947AbfBTLe7 (ORCPT + 99 others); Wed, 20 Feb 2019 06:34:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:37112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbfBTLe7 (ORCPT ); Wed, 20 Feb 2019 06:34:59 -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 0149020851; Wed, 20 Feb 2019 11:34:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550662498; bh=G36ZHd7D9eHLnW6qGl3mA5qqZ+q+yuZZlm92mdHzJSs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=a4+rH3AX4vVLSlvYOc4HwGEF12N0bxhim4Auu7a07x45oRiNkPtbQj6hlYgUi9DV4 Fawd2q/6RZvzxn7usVE9362UIO5wmJyr9OCR3c8zavAwuiftY06Xn+w3A9yQt5fnia 86bVbz2I23vZWnGak7lRkurd+K998832Y0J7fmow= Date: Wed, 20 Feb 2019 11:34:53 +0000 From: Jonathan Cameron To: Martin Kelly Cc: Mathieu Othacehe , "knaack.h@gmx.de" , "lars@metafoo.de" , "pmeerw@pmeerw.net" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] iio: trigger: Print an error if there is no available irq Message-ID: <20190220113453.22d8fcd2@archlinux> In-Reply-To: References: <20190213131752.646-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, 13 Feb 2019 22:19:16 +0000 Martin Kelly wrote: > On 2/13/19 5:17 AM, 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 > > --- > > 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, > > > > This seems useful! I think it would be good to print the value of > CONFIG_IIO_CONSUMERS_PER_TRIGGER too. Also, it appears this is > triggering a checkpatch warning: > > WARNING: quoted string split across lines Agreed, with both comments. Sensible change though. I'll admit I'm a bit embarrassed that I wrote it without that warning in the first place :( Thanks, Jonathan