From patchwork Sat Dec 8 15:16:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10719393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C356314E2 for ; Sat, 8 Dec 2018 15:17:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1FC02B27E for ; Sat, 8 Dec 2018 15:17:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A689C2B281; Sat, 8 Dec 2018 15:17:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B53F2B27E for ; Sat, 8 Dec 2018 15:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbeLHPQt (ORCPT ); Sat, 8 Dec 2018 10:16:49 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42782 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeLHPQs (ORCPT ); Sat, 8 Dec 2018 10:16:48 -0500 Received: by mail-pl1-f196.google.com with SMTP id y1so3177587plp.9; Sat, 08 Dec 2018 07:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=nWcKVpbCtOeHHfzBkxr54dLK7pg5obwuEhza0JXpwy4=; b=PUk9+P0Hb2yaJ9Bxan1LfCT5xVEvAuf8XylcuDAOPytX6nICbix9bg8tHAcKMvI3yl w78d0j8Vvtufi+yEhHx1eZrvvyLnsKp4eVvx+fOk/AUasHo3u8zbJ2ZecUXiweStHlIs aKlRNGWo01nI+PT9CtKsUGGG1mXywVQYpTGcEIiPlW1v+w1WKPkUtbjCIqwt1dZJ37w0 wZUPGCGQk2lZZzQTSKxwA7uG+Hg7oZP6yGXbqVwMCKAp9I+Go85UnEzyiMu7kDm8k2JV LZa+k9tsDX8VeFZXM01zoA9z6FpDmg2qNP7/0D22K5qDv0FhUZ7q7ZtcnYVMHHgWsRE/ ieew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=nWcKVpbCtOeHHfzBkxr54dLK7pg5obwuEhza0JXpwy4=; b=aAUP89ntCVj2SwT3Xqlo0IYQh8gOJR5p759WR0jTopUm3W3T0VoPp9BYR9rYmhYvI8 1zwTmQg5SvNRT+LI+dVrr6B8h2SiJ3WLJs0mRxY9romKRpk3r8/HjLfF71PXsuel5Zoe xmslzXgq5iQpCFB2VVAjFdDQXpbL3N6J2bOBlRaDJRaYvDVcjAJhgq9m1pPvKuRas6+E ErdfIlrLOmPJ+OFMC6Zi0O8/m33gb0+yatDEZVRWvP7HSUk5lFknZfn2N1S6b0qlvuuJ PyDSKrzkvQzIv+UnNK1wq9/2aHeGldAIThU5cyT3cNbedSussc+qe8RIJDlHtMVSL8Tf mQuw== X-Gm-Message-State: AA+aEWac/JgVVcwBfVbNN+bE58ITbRnGQknBCwknDdten4OvdNO95eKO 4uYayPat60hqzqerWjKPVZnMUadV X-Google-Smtp-Source: AFSGD/U2kSHdrd/P89FvjZYlpvMBoSO0Zc+evEzCd2LVW0W7TNwSg2plK9tiPCrdAzFP2HbK5PK6hw== X-Received: by 2002:a17:902:704b:: with SMTP id h11mr6056475plt.157.1544282207770; Sat, 08 Dec 2018 07:16:47 -0800 (PST) Received: from localhost.localdomain ([103.212.140.153]) by smtp.gmail.com with ESMTPSA id e23sm9774091pfh.68.2018.12.08.07.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Dec 2018 07:16:47 -0800 (PST) From: Shreeya Patel To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, shreeya.patel23498@gmail.com Subject: [PATCH v3 1/3] Staging: iio: adt7316: Use device tree data to assign irq_type Date: Sat, 8 Dec 2018 20:46:36 +0530 Message-Id: <20181208151638.8759-2-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208151638.8759-1-shreeya.patel23498@gmail.com> References: <20181208151638.8759-1-shreeya.patel23498@gmail.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ADT7316 driver no more uses platform data and hence use device tree data instead of platform data for assigning irq_type field. Switch case figures out the type of irq and if it's the default case then assign the default value to the irq_type i.e. irq_type = IRQF_TRIGGER_LOW All this is implemented in a new function called adt7316_setup_irq. Signed-off-by: Shreeya Patel --- drivers/staging/iio/addac/adt7316.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 9c72538baf9e..86b2c3d53588 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -1807,6 +1807,29 @@ static irqreturn_t adt7316_event_handler(int irq, void *private) return IRQ_HANDLED; } +static int adt7316_setup_irq(struct device *dev, int irq) +{ + int irq_type; + + irq_type = irqd_get_trigger_type(irq_get_irq_data(irq)); + + switch (irq_type) { + case IRQF_TRIGGER_HIGH: + case IRQF_TRIGGER_RISING: + break; + case IRQF_TRIGGER_LOW: + case IRQF_TRIGGER_FALLING: + break; + default: + dev_info(dev, "mode %d unsupported, using IRQF_TRIGGER_LOW\n", + irq_type); + irq_type = IRQF_TRIGGER_LOW; + break; + } + + return irq_type; +} + /* * Show mask of enabled interrupts in Hex. */ @@ -2101,8 +2124,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, { struct adt7316_chip_info *chip; struct iio_dev *indio_dev; - unsigned short *adt7316_platform_data = dev->platform_data; - int irq_type = IRQF_TRIGGER_LOW; + int irq_type; int ret = 0; indio_dev = devm_iio_device_alloc(dev, sizeof(*chip)); @@ -2146,8 +2168,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, indio_dev->modes = INDIO_DIRECT_MODE; if (chip->bus.irq > 0) { - if (adt7316_platform_data[0]) - irq_type = adt7316_platform_data[0]; + irq_type = adt7316_setup_irq(dev, chip->bus.irq); ret = devm_request_threaded_irq(dev, chip->bus.irq, NULL, From patchwork Sat Dec 8 15:16:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10719391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB30D13BB for ; Sat, 8 Dec 2018 15:17:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D98C32B27E for ; Sat, 8 Dec 2018 15:17:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD5882B281; Sat, 8 Dec 2018 15:17:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70C9E2B27E for ; Sat, 8 Dec 2018 15:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726196AbeLHPQw (ORCPT ); Sat, 8 Dec 2018 10:16:52 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34451 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeLHPQw (ORCPT ); Sat, 8 Dec 2018 10:16:52 -0500 Received: by mail-pl1-f194.google.com with SMTP id w4so3193938plz.1; Sat, 08 Dec 2018 07:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=d8j4BSBHgLLb1y8N2o89FumZInjolCQZpSlOVYn0aqA=; b=p90N9VIkjLLjkQhybGkbn/i6FAxVvunVKv6mx72C/yaXowBXzljYIxm2uGjyHTMnfv ZKoCbttRtWFdy02ByRvZei6SpVsrPQdgZAqJNNgGuNOz8D0eN6mVJm7BhO5imDjOfNeO Jh8B5zBhgrP7usad15Byhqy8O/tBvaDm5YPoPYLOAfLb5xtrLnnhaMbU1KnDMnSBt+zm QAr+eB2bQ0tVSsha8XjUGxQMT67KQVTszP4XYqz42/ZpY/owr6tMHJFr4bcIhSqYYM8C DTd6G1J08I6eBJc7It0U7KZBc4hC2c6jnK36MWDlYKGRtETwYkD+26SDGwy4tKeWW1ES TyWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=d8j4BSBHgLLb1y8N2o89FumZInjolCQZpSlOVYn0aqA=; b=pPUMGy67hGAchRkbMJoWtgalILAk9aBRe1HtfotO+U7fCU8HFmC2ZV6QphcmwKAQq5 J+J6vOqyR3KF/PpFliq75W2pYEmVbiygoAj7gqITPqQulmWsCPdhXhw65/lcbvGuJUMO HhAWnZEqbtOD8yemQOjmNg5zNQvHIMm7xoPmJx6AIHdtTu/6EAHsaT0zZDc5GgXKc3X4 KShvc+5gOlyrJibSAi9CiRyGmrunilxrtGSYCsntTWhZGbPoz+bktW0TEEuMyDzJtG8H j3EZhTG3Vdodc8MfxFqO8x4Wjml+J1w7NLfnGucE8pzJujIEQ4JdEowp9lwwbjug7XtM 6Wog== X-Gm-Message-State: AA+aEWZDty+UHO/fYmhqWm+rns0dq0GZm+JCAqVnDLSno0Cp6Cs1K4Xy B1m4Cpc/95Vtvmojd5thZHs= X-Google-Smtp-Source: AFSGD/WxH3AxJDGI9dZ2Hty8YeZjRwX/jvhXoL58ovcgh8NIm5dqrAwyxYirNqMozo12EKbTRLCzEg== X-Received: by 2002:a17:902:a9c4:: with SMTP id b4mr6009503plr.298.1544282211290; Sat, 08 Dec 2018 07:16:51 -0800 (PST) Received: from localhost.localdomain ([103.212.140.153]) by smtp.gmail.com with ESMTPSA id e23sm9774091pfh.68.2018.12.08.07.16.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Dec 2018 07:16:50 -0800 (PST) From: Shreeya Patel To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, shreeya.patel23498@gmail.com Subject: [PATCH v3 2/3] Staging: iio: adt7316: Move interrupt related code Date: Sat, 8 Dec 2018 20:46:37 +0530 Message-Id: <20181208151638.8759-3-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208151638.8759-1-shreeya.patel23498@gmail.com> References: <20181208151638.8759-1-shreeya.patel23498@gmail.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a function adt7316_irq_setup() where irq_type is being set. It would be good to move devm_request_threaded_irq() function and assignment of chip->config1 in adt7316_irq_setup() to unclutter the code in probe function. Signed-off-by: Shreeya Patel --- drivers/staging/iio/addac/adt7316.c | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 86b2c3d53588..97dd48153293 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -1807,11 +1807,12 @@ static irqreturn_t adt7316_event_handler(int irq, void *private) return IRQ_HANDLED; } -static int adt7316_setup_irq(struct device *dev, int irq) +static int adt7316_setup_irq(struct iio_dev *indio_dev) { - int irq_type; + struct adt7316_chip_info *chip = iio_priv(indio_dev); + int irq_type, ret; - irq_type = irqd_get_trigger_type(irq_get_irq_data(irq)); + irq_type = irqd_get_trigger_type(irq_get_irq_data(chip->bus.irq)); switch (irq_type) { case IRQF_TRIGGER_HIGH: @@ -1821,13 +1822,23 @@ static int adt7316_setup_irq(struct device *dev, int irq) case IRQF_TRIGGER_FALLING: break; default: - dev_info(dev, "mode %d unsupported, using IRQF_TRIGGER_LOW\n", + dev_info(&indio_dev->dev, "mode %d unsupported, using IRQF_TRIGGER_LOW\n", irq_type); irq_type = IRQF_TRIGGER_LOW; break; } - return irq_type; + ret = devm_request_threaded_irq(&indio_dev->dev, chip->bus.irq, + NULL, adt7316_event_handler, + irq_type | IRQF_ONESHOT, + indio_dev->name, indio_dev); + if (ret) + return ret; + + if (irq_type & IRQF_TRIGGER_HIGH) + chip->config1 |= ADT7316_INT_POLARITY; + + return ret; } /* @@ -2124,7 +2135,6 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, { struct adt7316_chip_info *chip; struct iio_dev *indio_dev; - int irq_type; int ret = 0; indio_dev = devm_iio_device_alloc(dev, sizeof(*chip)); @@ -2168,19 +2178,9 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, indio_dev->modes = INDIO_DIRECT_MODE; if (chip->bus.irq > 0) { - irq_type = adt7316_setup_irq(dev, chip->bus.irq); - - ret = devm_request_threaded_irq(dev, chip->bus.irq, - NULL, - adt7316_event_handler, - irq_type | IRQF_ONESHOT, - indio_dev->name, - indio_dev); + ret = adt7316_setup_irq(indio_dev); if (ret) return ret; - - if (irq_type & IRQF_TRIGGER_HIGH) - chip->config1 |= ADT7316_INT_POLARITY; } ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG1, chip->config1); From patchwork Sat Dec 8 15:16:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10719389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5156913BB for ; Sat, 8 Dec 2018 15:16:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C0A42B27E for ; Sat, 8 Dec 2018 15:16:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BACA2B281; Sat, 8 Dec 2018 15:16:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8E9A2B27E for ; Sat, 8 Dec 2018 15:16:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726217AbeLHPQ4 (ORCPT ); Sat, 8 Dec 2018 10:16:56 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44899 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeLHPQz (ORCPT ); Sat, 8 Dec 2018 10:16:55 -0500 Received: by mail-pl1-f193.google.com with SMTP id k8so3174841pls.11; Sat, 08 Dec 2018 07:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=sx7bEFL8SVo2GNwtK9DKmgT5Sowc26cvdGR4sApF5j4=; b=X404tw4nsn6BtgV2j+dnytQ+5lGZs9FoLv7seQHXeECasuJG9h7hNVL5SvbomcY8sm OCclwrkppJp8zXaNDkzHu71Bovpqfh+opBkiZZVKLMSfF/E5tHZKYMI5yDP8oKL5wQOK BguDDEfRjsZlEThBxtY5jSGp5fmLliYrBgCp3bL0eVKnCaacmTk3XQV/LHB7S+3QPZEO JDZmLDP9f7BOXpJcFIlPA25c4voTB5EKLSeGF+7gquC75tZP+fL6N5C3LjgaZ4O2Wkrn qk1aYQoqWbdCtaYgFeqSci+14XyrGwTIfYtEZxT3+kUjhqcwMnA2LXkrh9gVYEIiT5Kn FsFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=sx7bEFL8SVo2GNwtK9DKmgT5Sowc26cvdGR4sApF5j4=; b=lrU5xvJERgklQt8goFDxvJ+WocurLHkTLr6t+wAZev4FodazKCmmnbY5MsxxjmnY0d 3Y18ocbhdp2GusNxflD4ieZhlVNlFh40VxbjKVvHxsdMpDLePBSc36xg81X3h9YPcijA jds+g/DFnbOR1XMn697We4XPnmcTxgLg8zRoJFVdWYbx7SdN5KJekr4kbg/F9pXlwmEW FljcY40lAi6F4nweP/0Kl8+xbcEkyktvDGZP8l6KRrbTM++0YRKYxGtBxdP8akqoWnBf +zCgYmBC5dU6ZY/pykvSCUJ3gvX3rhU4OaxTdij0xd3vQWjunTWS3laIU98wM2cfL6IU klNA== X-Gm-Message-State: AA+aEWZKFYX1JRsph3kimX15uu42b69Ya55o5yJAGpd9pm8608RRGyIY uvWToao5vXBZWgAWGEhAKJ0= X-Google-Smtp-Source: AFSGD/WB4BoSFGXDYDvhXSLH1+9stSaJcEg6mQU1WUiK1KpnYe2HkqdRUXaMzUcfB19ce5rInMBnsA== X-Received: by 2002:a17:902:6b49:: with SMTP id g9mr5907021plt.98.1544282214763; Sat, 08 Dec 2018 07:16:54 -0800 (PST) Received: from localhost.localdomain ([103.212.140.153]) by smtp.gmail.com with ESMTPSA id e23sm9774091pfh.68.2018.12.08.07.16.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Dec 2018 07:16:54 -0800 (PST) From: Shreeya Patel To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, shreeya.patel23498@gmail.com Subject: [PATCH v3 3/3] Staging: iio: adt7316: Add a dev_err() message Date: Sat, 8 Dec 2018 20:46:38 +0530 Message-Id: <20181208151638.8759-4-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208151638.8759-1-shreeya.patel23498@gmail.com> References: <20181208151638.8759-1-shreeya.patel23498@gmail.com> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a dev_err() message "failed to request irq" for describing what went wrong when an error contition is statisfied. Signed-off-by: Shreeya Patel --- drivers/staging/iio/addac/adt7316.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 97dd48153293..e3eb8ad06403 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -1832,8 +1832,11 @@ static int adt7316_setup_irq(struct iio_dev *indio_dev) NULL, adt7316_event_handler, irq_type | IRQF_ONESHOT, indio_dev->name, indio_dev); - if (ret) + if (ret) { + dev_err(&indio_dev->dev, "failed to request irq %d\n", + chip->bus.irq); return ret; + } if (irq_type & IRQF_TRIGGER_HIGH) chip->config1 |= ADT7316_INT_POLARITY;