From patchwork Tue Nov 20 16:52:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10690843 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 1E84A13BF for ; Tue, 20 Nov 2018 16:52:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CA772AC6D for ; Tue, 20 Nov 2018 16:52:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00F702AC65; Tue, 20 Nov 2018 16:52:44 +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 9FD9B2AC3F for ; Tue, 20 Nov 2018 16:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730031AbeKUDWo (ORCPT ); Tue, 20 Nov 2018 22:22:44 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:43826 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbeKUDWo (ORCPT ); Tue, 20 Nov 2018 22:22:44 -0500 Received: by mail-pg1-f195.google.com with SMTP id v28so1140739pgk.10; Tue, 20 Nov 2018 08:52:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=NA1qthEFQ7/pB53uVIREyL6YfIxumKaRa1YNVVVRolk=; b=gJguVhw7fpxjHUNb2bH9a5CrAb8by8pHBriW14mbz2Uoq02/hJ+mISI+KWBNlix4JZ 2IqRJbwd1cLTIga4pf2T3fv2hCZcMxA7lNElPiO6M9wSlUfmTqK/ymLnVXXMkA4yMfiO 5n3j/g4o/4qBMyA55iF2Mtsq6cqtLI3uEH4yaML7/eYWZtYPyNJn4hRI8xcxIR22RGzi lzYTZ+WsZqkLntzaLn7FHkFvN9unReBD2mdiGExdbyO5EjiE1xGGhb4LYsDUhbbgTPAr LrIsp4LQ1k5VYuh49AMBgwDSYM9+vvYQWJYOl60HYSTmmOoptp+bN8MIhHQkAhEiJsfM gaxQ== 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:mime-version :content-transfer-encoding; bh=NA1qthEFQ7/pB53uVIREyL6YfIxumKaRa1YNVVVRolk=; b=uTMo666lyTc+wyb1KW7sSd2+bEm5F1lMG374bLeHPjMHG6G2Lvi/HWBUUuBVslEh+8 CR1bwuXZU2BYXmK/0XkUR6CHIm37L8fPE8/qMPFTaNxprNjpx/yoq+vYjbpo+RU0/C8P 7t/a+16FyZf+FrytFE8LQiM1LLnNWo4h7ylrepad/8oyG43MH42YD0cxydcnoXsKNynW lmXbcVlmY+L7FEH99QWHeMxyrFNTJSUzsSNG7DUBXp9eNR4I54z1Ol3fsc3GkysV4eRR ELgDXulmP1icCN/2cK+xsVNqHBdA12xQkJy2PCdZL4FHtSVfg/mC9MntAaXntPAuSzzU a+/A== X-Gm-Message-State: AGRZ1gKejFmlx5t8r/BULiHYzcQYAp9WmtSoc1D62l1vVyEmvSrnMR11 aoidRl5N2Cp2yII4t9x8A64= X-Google-Smtp-Source: AJdET5e8Fqdnng6yptrdzlx1ELgZ5XmzowRRYbBBTMw+BYNBS1fmy0JG5up4hmMn8UESKoxGAeb2Ng== X-Received: by 2002:a62:5e46:: with SMTP id s67-v6mr3060335pfb.122.1542732758124; Tue, 20 Nov 2018 08:52:38 -0800 (PST) Received: from localhost.localdomain ([103.212.140.152]) by smtp.gmail.com with ESMTPSA id h8sm27048058pgv.27.2018.11.20.08.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 08:52:37 -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 Subject: [PATCH v2 1/5] Staging: iio: adt7316: Add of_device_id table Date: Tue, 20 Nov 2018 22:22:30 +0530 Message-Id: <20181120165230.7079-1-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 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 When the kernel starts up, it kicks off compiled-in drivers that match “compatible” entries it finds in the device tree. At a later stage (when /lib/modules is available), all kernel modules that match “compatible” entries in the device tree are loaded. But if there is no dt table then there should be a fall back path with which desired kernel modules can be loaded. Hence, add of_device_id table in the i2c driver to be able to use when there is no dt table. Signed-off-by: Shreeya Patel --- Changes in v2: - Make the commit message appropriate and assign of_match_table in the driver structure. drivers/staging/iio/addac/adt7316-i2c.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c index 473e5e34ec00..41bc4ca008bc 100644 --- a/drivers/staging/iio/addac/adt7316-i2c.c +++ b/drivers/staging/iio/addac/adt7316-i2c.c @@ -126,9 +126,22 @@ static const struct i2c_device_id adt7316_i2c_id[] = { MODULE_DEVICE_TABLE(i2c, adt7316_i2c_id); +static const struct of_device_id adt7316_of_match[] = { + { .compatible = "adi,adt7316" }, + { .compatible = "adi,adt7317" }, + { .compatible = "adi,adt7318" }, + { .compatible = "adi,adt7516" }, + { .compatible = "adi,adt7517" }, + { .compatible = "adi,adt7519" }, + { }, +}; + +MODULE_DEVICE_TABLE(of, adt7316_of_match); + static struct i2c_driver adt7316_driver = { .driver = { .name = "adt7316", + .of_match_table = adt7316_of_match, .pm = ADT7316_PM_OPS, }, .probe = adt7316_i2c_probe, From patchwork Tue Nov 20 16:54: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: 10690849 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 42C4115A7 for ; Tue, 20 Nov 2018 16:54:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CBD62978E for ; Tue, 20 Nov 2018 16:54:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2020429966; Tue, 20 Nov 2018 16:54:46 +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 C0CFB2978E for ; Tue, 20 Nov 2018 16:54:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727976AbeKUDYu (ORCPT ); Tue, 20 Nov 2018 22:24:50 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46560 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbeKUDYu (ORCPT ); Tue, 20 Nov 2018 22:24:50 -0500 Received: by mail-pl1-f195.google.com with SMTP id t13so1252505ply.13; Tue, 20 Nov 2018 08:54:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=zNs2xBlZTXJMas/ITpZ31ZhslFUYpV/Egqz6U1dNoRs=; b=hY0gtWxXaEwzMwiiCjFUNAtFtcH3i4uRqQtVOss1FKN1xV8ejI6VnanSfU+FF2+KCf lu2IBdkf150c5qiknE3W9Z6u6/UP8TyoDqkG9Wtn7cLLEQmyOr8krOU272DOgXXf+vj7 w4kUca6u8cDPYHa+wMpXV9md2LSSFEBMQJwFNRw0/5JEZVDijbdJc1LTw/Tkfv4yFqRw 3zVfdVe4Xxgg+lhvPFnZv1dL9kdoBj/w4et8DNLtXgVHrdX+OeITT9HJKDgCewtuUGDg ECdtpIxaRuL+cmvExXfGKv6B/WlUBQnXMyYraFm1FMLUhXJeRUrRP2y6mLLXHQvxio82 nPVA== 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; bh=zNs2xBlZTXJMas/ITpZ31ZhslFUYpV/Egqz6U1dNoRs=; b=Uz1ZuZpivgfjO/famuTwFmjDkW6w5CYeSSMXBPDl9vlqsVIi7DxFTb34TWklHjYLOr 8G1sybpj8gi9Gg7mxtKCY0msLi86j1HA5CBavRU9G1KDVl8NTYD1H21pkfhkTF5QK672 gC7uC3rYSf/EPpNBeFAPlOUJNHwp7IIpKVT43c5cXQcVwUT1aItA03LFyyCggYPfbBwH FtZTFfzn6mmfSNnD2dtCgwE0ZloHx5IKx4TwAdHn/2jBrrT+fwi9I+CTzQNfF4MmTXAd 4jUoKOb+knbZ+r60bHmLuN9IXH7DUlpkNGSvCBxulg2TbRMIGANqeF6xdbcpfGjjTcxe cJaA== X-Gm-Message-State: AA+aEWZftTewxCWY2ieFwIXcPRFIJUJKWBEK1IvyNIqGGkQWVB4uE2iH 8Vw4a7ZFsR0d9/9JRSWouOk= X-Google-Smtp-Source: AFSGD/W4AAtdGN8A2VP/oaRM/XVGSFgp9BFBRuCFTM3T2cQO6TeBwjiOAl5FMmzz/bT39vKCbhCJ2A== X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr1600686plg.250.1542732884190; Tue, 20 Nov 2018 08:54:44 -0800 (PST) Received: from localhost.localdomain ([103.212.140.152]) by smtp.gmail.com with ESMTPSA id r83sm64235709pfc.115.2018.11.20.08.54.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 08:54:43 -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 Subject: [PATCH v2 2/5] Staging: iio: adt7316: Use device tree data to set ldac_pin Date: Tue, 20 Nov 2018 22:24:36 +0530 Message-Id: <20181120165436.7178-1-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 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 Make the driver use device tree instead of the platform data. Hence, use devm_gpiod_get_optional function to get the data from device tree for ldac-pin and accordingly make the needed changes in the driver. Signed-off-by: Shreeya Patel --- drivers/staging/iio/addac/adt7316.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index 3f22d1088713..deb2f7b40f60 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -177,7 +177,7 @@ struct adt7316_chip_info { struct adt7316_bus bus; - u16 ldac_pin; + struct gpio_desc *ldac_pin; u16 int_mask; /* 0x2f */ u8 config1; u8 config2; @@ -950,8 +950,8 @@ static ssize_t adt7316_store_update_DAC(struct device *dev, if (ret) return -EIO; } else { - gpio_set_value(chip->ldac_pin, 0); - gpio_set_value(chip->ldac_pin, 1); + gpiod_set_value(chip->ldac_pin, 0); + gpiod_set_value(chip->ldac_pin, 1); } return len; @@ -2120,7 +2120,13 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, else return -ENODEV; - chip->ldac_pin = adt7316_platform_data[1]; + chip->ldac_pin = devm_gpiod_get_optional(dev, "ldac", GPIOD_OUT_LOW); + if (IS_ERR(chip->ldac_pin)) { + ret = PTR_ERR(chip->ldac_pin); + dev_err(dev, "Failed to request ldac GPIO: %d\n", ret); + return ret; + } + if (chip->ldac_pin) { chip->config3 |= ADT7316_DA_EN_VIA_DAC_LDCA; if ((chip->id & ID_FAMILY_MASK) == ID_ADT75XX) From patchwork Tue Nov 20 16:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreeya Patel X-Patchwork-Id: 10690855 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 63D965A4 for ; Tue, 20 Nov 2018 16:57:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E2342A1EF for ; Tue, 20 Nov 2018 16:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D67D2A233; Tue, 20 Nov 2018 16:57:08 +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 CBA402A1EF for ; Tue, 20 Nov 2018 16:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729148AbeKUD1N (ORCPT ); Tue, 20 Nov 2018 22:27:13 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46859 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbeKUD1N (ORCPT ); Tue, 20 Nov 2018 22:27:13 -0500 Received: by mail-pg1-f194.google.com with SMTP id w7so1138870pgp.13; Tue, 20 Nov 2018 08:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=/6kx2Bggq2klXhF/moriz5e4i2xZPc9arr0AFnneIzY=; b=D4lO0s7WhDzdX9NZLLEO7GoRMOAb8rIXaDRecB30ON0rtuJg29hhoqN396DJ5c8psd NX95bUw/hIXJLXfQkV+fJsYaO8Cge6Z04z7c2gWZVUvQULx9svBahD/5FTgJvR/YmCPA 2BmrkzC/Tb6EAIgEj3x3bUtis+UvIX4VUbRWiM/3PTiy/VvFHxomTBNnNw/Vy7ARDMQ9 +hQvCkiS/lEP8y3/GzzbMw9A83MyJPkdLmxkrnRQ1W4C7xCznPFWypcBLDlUAOkLNhmh bxwWkHwSybV4PEQT0AKICDiJ3vZgJOHjwQTthjGjNIZXYgnkUDnQmn8XErbg7y8869Sz LuLw== 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; bh=/6kx2Bggq2klXhF/moriz5e4i2xZPc9arr0AFnneIzY=; b=o2pixvXPSM6gFG8ZAoJJd0+J8J6TwvTkb3fIym7YllUHY4EFQ2rfVIvsefS1Eop+8v CTkj8Y01f5+3DtwYqdq397PB8GYDbtvWlMpCkC5sEMtAcoYSRquR73m0Nso38pSIheAq LdTbTwYdI5xbtxo8skBfjDOuazA09QWM6Hc//dS/c21fU9FFETwf/FohC2fRcUn09Uyl V0Epx2u0cJDSn5BgpmmSzeenhHeA6mTLmMZI2rHrlACyCWTpxxV9zvNUVdTpr/5Y/Na9 h2A6SbYZhrZatuxyJHvrQiuD5fV2dGZP6Ts870Vr/2+N2aVPbzdSRUJ5MBTmIE7fqt+7 VLjg== X-Gm-Message-State: AA+aEWaML1cS4g7kOCWoAklxzAC39gPaqsTI7tXyQ2hneUqTD5Qb1bs2 w/p6dt+AVHSE3cs/Veoevgw= X-Google-Smtp-Source: AFSGD/WZjw6utnaLYKAd7Wajrc1tyGSy1aaHlquc8MIat4R1pHKlbIMQ3BJjNq6NBnl5sTq0SHkH5Q== X-Received: by 2002:a65:66ce:: with SMTP id c14mr2573306pgw.450.1542733025908; Tue, 20 Nov 2018 08:57:05 -0800 (PST) Received: from localhost.localdomain ([103.212.140.152]) by smtp.gmail.com with ESMTPSA id h8sm27062360pgv.27.2018.11.20.08.57.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 08:57:05 -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 Subject: [PATCH v2 3/5] Staging: iio: adt7316: Switch irq_flags to a local variable Date: Tue, 20 Nov 2018 22:26:58 +0530 Message-Id: <20181120165658.7259-1-shreeya.patel23498@gmail.com> X-Mailer: git-send-email 2.17.1 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 no need to store irq_flags into the structure as it is always set to the same thing. Hence switch irq_flags to a local variable. Signed-off-by: Shreeya Patel --- drivers/staging/iio/addac/adt7316-i2c.c | 1 - drivers/staging/iio/addac/adt7316-spi.c | 1 - drivers/staging/iio/addac/adt7316.c | 8 ++++---- drivers/staging/iio/addac/adt7316.h | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c index 41bc4ca008bc..ac91163656b5 100644 --- a/drivers/staging/iio/addac/adt7316-i2c.c +++ b/drivers/staging/iio/addac/adt7316-i2c.c @@ -104,7 +104,6 @@ static int adt7316_i2c_probe(struct i2c_client *client, struct adt7316_bus bus = { .client = client, .irq = client->irq, - .irq_flags = IRQF_TRIGGER_LOW, .read = adt7316_i2c_read, .write = adt7316_i2c_write, .multi_read = adt7316_i2c_multi_read, diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c index 5cd22743e140..e75827e326a6 100644 --- a/drivers/staging/iio/addac/adt7316-spi.c +++ b/drivers/staging/iio/addac/adt7316-spi.c @@ -94,7 +94,6 @@ static int adt7316_spi_probe(struct spi_device *spi_dev) struct adt7316_bus bus = { .client = spi_dev, .irq = spi_dev->irq, - .irq_flags = IRQF_TRIGGER_LOW, .read = adt7316_spi_read, .write = adt7316_spi_write, .multi_read = adt7316_spi_multi_read, diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c index deb2f7b40f60..dfae22619287 100644 --- a/drivers/staging/iio/addac/adt7316.c +++ b/drivers/staging/iio/addac/adt7316.c @@ -2102,6 +2102,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_flags = IRQF_TRIGGER_LOW; int ret = 0; indio_dev = devm_iio_device_alloc(dev, sizeof(*chip)); @@ -2146,19 +2147,18 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus, if (chip->bus.irq > 0) { if (adt7316_platform_data[0]) - chip->bus.irq_flags = adt7316_platform_data[0]; + irq_flags = adt7316_platform_data[0]; ret = devm_request_threaded_irq(dev, chip->bus.irq, NULL, adt7316_event_handler, - chip->bus.irq_flags | - IRQF_ONESHOT, + irq_flags | IRQF_ONESHOT, indio_dev->name, indio_dev); if (ret) return ret; - if (chip->bus.irq_flags & IRQF_TRIGGER_HIGH) + if (irq_flags & IRQF_TRIGGER_HIGH) chip->config1 |= ADT7316_INT_POLARITY; } diff --git a/drivers/staging/iio/addac/adt7316.h b/drivers/staging/iio/addac/adt7316.h index ec40fbb698a6..fd7c5c92b599 100644 --- a/drivers/staging/iio/addac/adt7316.h +++ b/drivers/staging/iio/addac/adt7316.h @@ -17,7 +17,6 @@ struct adt7316_bus { void *client; int irq; - int irq_flags; int (*read)(void *client, u8 reg, u8 *data); int (*write)(void *client, u8 reg, u8 val); int (*multi_read)(void *client, u8 first_reg, u8 count, u8 *data);