Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1053419imu; Fri, 16 Nov 2018 15:02:31 -0800 (PST) X-Google-Smtp-Source: AJdET5cp+2si/hsmZZwtbcNWADp4hSHS/og5onS8xR4rDv4GOrskfBLxy1WPRwwc2GfLYLhgM3PO X-Received: by 2002:a63:b105:: with SMTP id r5mr11812512pgf.442.1542409351037; Fri, 16 Nov 2018 15:02:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542409351; cv=none; d=google.com; s=arc-20160816; b=cHB4hyeIP8JZVpkUp5PVl/7gc4s/l6Ox+T4gkfDWvrUjHpNIy27ZEEVzLByOGeZSQC pphQi++D+sJkoiw4D2xosGNM9XaArRlSCQPGn6K9F/tlSdzHpoHRuGKGHoX4J2mUi6Pz NmkE+W4jr640iN822h+qUVIyNaBUF00DwEUWQchRbpBPF50EFbd1SkOkSPYGUUhEEwVy SIagGfp7FeVMxA9EPr+McZXnBWfG0SzQ2SaUOvP7ju5WhAsOs9Sb1OG1QFiNyAfm+C5f U3MLG6L44rjyNsV3vIXDra/XDJWW7Cm9z5cK3jGIb6Xow0fidZrfkLHSy8/rriUW16xP NuWw== 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:to:from :dkim-signature; bh=wcOr0IyKfNnQzLgC+t07yZkvswNA9tMU8FyJkchOris=; b=ENX64EPNS1PleNNAjzlKaRe4BBRmMeQMU3KCd0Z/ouHFG6KwBOxfZrwN6isbuQfrfh kWtavuOmoL0rE3FC20Xvbfs0FZDVKM2wCuNX87xIZONSWQ3s2kIDarhV6iD65/uKZ91V i1+NwJH4W8wnSfxIdJPOiBAJdZJNxkBRVaaJcTZQcNozdJayk5z2oVBzr95LgUS5r3I0 MZZewBNoXt/v5GDQUPkEWQd8zADMBEI9QGcBOiZYQjCUlA2IiYU3MYPYPE6KxanMNoPx cuf3yk5dvnMrJYUuxG0wN7IjSmm/UfUulxZNCMWhowk0G0hRrLnuiIIjQ2YtgAU23+P2 jDFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D3rqOmR2; 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 z14si12025998pgu.525.2018.11.16.15.02.16; Fri, 16 Nov 2018 15:02:30 -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=D3rqOmR2; 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 S1730388AbeKQJOM (ORCPT + 99 others); Sat, 17 Nov 2018 04:14:12 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35656 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725911AbeKQJOM (ORCPT ); Sat, 17 Nov 2018 04:14:12 -0500 Received: by mail-pg1-f196.google.com with SMTP id 32-v6so11219687pgu.2; Fri, 16 Nov 2018 14:59: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; bh=wcOr0IyKfNnQzLgC+t07yZkvswNA9tMU8FyJkchOris=; b=D3rqOmR27SbqitfqRcX4mV50QGNxqp1dASTsjtRThO5T0O1W69lg2F+rOMMEdw2QPp 8bSIXObng/7C+Iw3OIZiCNXt9cmD860vf95OHDIT2UAxV3eFC1N9yptzF/c6MmDxZNg1 IVdH/y1lLVcQNjl+N4KGoxuYANnOr1nzrtMqCKhp6ziynQAPkwScp7NrLH8eR4iRRj8W mf7Xr3UkY+J+w7m2BUmbLEKLwkspxYFefo09I2M6RZMrykJL/IffkuDckP8SXO7ENmp3 AKjzl6PtzlPbu2n4vJg8r7tLNrLdRSJbZ84TaRqxM0/KfhNTEkaTt0G0eDv5RW5Z4+ra fztg== 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=wcOr0IyKfNnQzLgC+t07yZkvswNA9tMU8FyJkchOris=; b=fSCW8Qelvt2O/EiV5nEqezKd3cQlLxaeiUQIq/rmG/OIlwJANsxwtDoDPQDXz1NayS /0MAGI2/EGGhjPPSm0Z99LyUlEAOwzu4fyV5nF1avQsNF8QiCDH2P4hHo06Z2vDgs5fc v5ig0/A90Iv7/JvJCxczi4kyqspwrFRyiNxsCSM+vdLjEEeuJU+qusyxWiIGesrAMI6Q ingX0fXafUutqDwqTrCa5c3h2JdKjDyRHqTWexVTvYVCu1vaNoJVxDcGDgpvt0bGdspA YEIWWs96adR2IirnuutNSOL8HaEFlFRU9O1FrIUkNhJl8EXKM8bIec0qqdhSE7o/eEWW IfHw== X-Gm-Message-State: AGRZ1gJIlDz15Q2heUmSGbAHQFlOoCBHy5K4czjrRMC5+JdV8d6TLNJn GAz7Q6goEexnqH/XyyFVAH4= X-Received: by 2002:a63:5c41:: with SMTP id n1mr10265692pgm.1.1542409195175; Fri, 16 Nov 2018 14:59:55 -0800 (PST) Received: from localhost.localdomain ([103.212.140.154]) by smtp.gmail.com with ESMTPSA id w80-v6sm55317406pfk.11.2018.11.16.14.59.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 14:59: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 Subject: [PATCH 5/7] Staging: iio: adt7316: Switch irq_flags to a local variable Date: Sat, 17 Nov 2018 04:29:49 +0530 Message-Id: <20181116225949.24913-1-shreeya.patel23498@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 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 d4b5060c18ee..91d6cdcb747e 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); -- 2.17.1