From patchwork Mon Jun 3 19:34:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10973929 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 5398F6C5 for ; Mon, 3 Jun 2019 19:35:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 357F02094F for ; Mon, 3 Jun 2019 19:35:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 232D627D0E; Mon, 3 Jun 2019 19:35:26 +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 B742D2094F for ; Mon, 3 Jun 2019 19:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726102AbfFCTfZ (ORCPT ); Mon, 3 Jun 2019 15:35:25 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43516 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfFCTfZ (ORCPT ); Mon, 3 Jun 2019 15:35:25 -0400 Received: by mail-qk1-f193.google.com with SMTP id m14so1218999qka.10 for ; Mon, 03 Jun 2019 12:35:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0g9ugQG0sAP10Eo+U/PQ6hS9dDpWYGb5C09T4WP9hqk=; b=cidDOwm/pSisEm8lZjFsnvweBbyPndNfSDURR0yfUP/XXYuRNXWdlKm5b48g7IFYBe ItD+RAZfuxCRn0UawIGzzhrv5o4s+USisEc2dgRl8WJEjsEJkTEkffj4qWbnoY+T68nH JHm6Qe2fdXpMre1x9zXZRs7+m4AwTqp+MtAucvWBpSKowLAsVXAbEkS6C+2pKfBEnNGE +KjqaGidrnl9fGvWDE3sXyH8tVqQ5dZ4cSEZ24Q+fAEnpPfpS7x1nXpWMQoP8pRJB4CX RUoPRcU+YpDrdymHUa4VlFenP84CBN/0BjqEQ6LPJTDQFOY7tNc9IY7Bhg3PNxTowieB XIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0g9ugQG0sAP10Eo+U/PQ6hS9dDpWYGb5C09T4WP9hqk=; b=j/luDEvPOEM376yqU3efRKFvYd3TUcQ3v/ndf6g8bBP3oQ/0LLUJU8T89OlLlKkv5X uWowTZPi++l/Gm6MUwISLKy9CM/C1RY/O3y72poKPtXjcbKHnkU8C8ZQHMA9VNhZuKp0 b9nsgEJA9gZQMMw2NbXIwEoG+zVDLP9GUoN+ftlQ0u1OPL4ZICZfw8YsT6QzmS/txcAN 9TFNR6Aqjy48xR+G1ayDpXG072aZByzZeCCIQW0GITHsxWIp3SMiCHFpZHu307VIzM3l qSilkjLwJPuApusKws/tfjCzvQSTtmvjkc7HPSJlbygKYMuDf+KKuL1sTBbmBtKYY8GO xTZQ== X-Gm-Message-State: APjAAAU1lSJV0UAYWXnKAcH2lKjnvc3hfAX5FGIpYHIMIEFKVrxJFUYm OiUM7fZsCbox+DiZaY8+20I5pQiH X-Google-Smtp-Source: APXvYqzBoBjdTm+1/wFdyVwgjjQMu/bPj2Q0FfrYq0JPsWw1sdDOHf8DkVW/mREt8zmsqxTC3Mo94Q== X-Received: by 2002:a37:7786:: with SMTP id s128mr23420470qkc.63.1559590523947; Mon, 03 Jun 2019 12:35:23 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id t80sm7539231qka.87.2019.06.03.12.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 12:35:23 -0700 (PDT) From: Fabio Estevam To: jic23@kernel.org Cc: andrew.smirnov@gmail.com, linux-iio@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/4] iio: imx7d_adc: Remove unneeded error message Date: Mon, 3 Jun 2019 16:34:30 -0300 Message-Id: <20190603193433.6394-1-festevam@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 In case of ioremap failure, the core code will take care of printing the error message, so there is no need for having a local error message in the driver. Signed-off-by: Fabio Estevam --- drivers/iio/adc/imx7d_adc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c index 4fe97c2a0f43..23c7b0ee945f 100644 --- a/drivers/iio/adc/imx7d_adc.c +++ b/drivers/iio/adc/imx7d_adc.c @@ -493,11 +493,8 @@ static int imx7d_adc_probe(struct platform_device *pdev) info->dev = dev; info->regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(info->regs)) { - ret = PTR_ERR(info->regs); - dev_err(dev, "Failed to remap adc memory, err = %d\n", ret); - return ret; - } + if (IS_ERR(info->regs)) + return PTR_ERR(info->regs); irq = platform_get_irq(pdev, 0); if (irq < 0) { From patchwork Mon Jun 3 19:34:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10973931 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 792C16C5 for ; Mon, 3 Jun 2019 19:35:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DCD22094F for ; Mon, 3 Jun 2019 19:35:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51FDE27FB1; Mon, 3 Jun 2019 19:35:29 +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 02EA22094F for ; Mon, 3 Jun 2019 19:35:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726055AbfFCTf2 (ORCPT ); Mon, 3 Jun 2019 15:35:28 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46657 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfFCTf2 (ORCPT ); Mon, 3 Jun 2019 15:35:28 -0400 Received: by mail-qk1-f194.google.com with SMTP id a132so1211673qkb.13 for ; Mon, 03 Jun 2019 12:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gobfI5uVdjQDqkRfAakOgqno2MeUhFjJEmPYnWDl1pg=; b=Nh99qMJO3Vz7VQLY5S35sx/9J17Ipb6+7L1LwQlU+g+lp6c1vGlwQTQ+kTnPocnxU3 iI35PqrJxhJ0FsmI2iQ+SzMSZkXdsyvOvWMUkAxYEt8Dz30JzInQnpVjUIf/2mA9K29a CXkgTOrIcRPjMDhvoU1I7yE0b3Jccng9fUvV8QtRLi9091fKWivZX3ruf0jhsasLTQRO r3H4sAGkMr33PK8y+wZADmr1GsPKUbX0jeaBvwz92Q9pHB6iVACE2i9VlXRv9kIOC8pW KPdh62G+CFoS90yU7sXojNQmcQDKquwGGHf5T+2ZnCPRWyEqQ+jwJpqyHNskMU/Uis/u jmYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gobfI5uVdjQDqkRfAakOgqno2MeUhFjJEmPYnWDl1pg=; b=jm/g8TLQNlC6600iaeJzNgpL1wUzcoi3cbAmsMVsdxw8UfHTiefS7MOHWv7qyOjf5a IOHDpvBxsifHI6DO+z9DLMf3nzdKWLWFFgaKvZQn+wbInnGsRALE/bWUN5lJDS1vxPG4 z8taVRGWewmqg+5aqdgNyPZ/+5pYQWTMSpPci8oCw4RT+E1+qFZ49cMdlmVGAgB41RJ+ ndR8FWZO6HgVaNIDmn3+jmwfLQKXomQxtJFFKQhErw8ust4BC1ntWS3s8gV8OZxHef7R RAypovUJW4XSO+sHoaP3wpKtyAb8zB+NcLJbA53jK4WGXxcCzlK+RoL+8sECHYbuyzN4 29Jw== X-Gm-Message-State: APjAAAXjnBdcFZE80J3UNeC/g/BYM5ULVEuWi7ZjcWftTMQb3yymhihH wOUrrFyTK1CDkpMFfFSgRZ8= X-Google-Smtp-Source: APXvYqwwkMPUHHv9xCtDr/uj2Dg935hrZgmMATqN1WLaHva64BAdhNf1mLqNm0tHc1jYmTmdfewLhw== X-Received: by 2002:a37:bd86:: with SMTP id n128mr23249902qkf.318.1559590527391; Mon, 03 Jun 2019 12:35:27 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id t80sm7539231qka.87.2019.06.03.12.35.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 12:35:26 -0700 (PDT) From: Fabio Estevam To: jic23@kernel.org Cc: andrew.smirnov@gmail.com, linux-iio@vger.kernel.org, Fabio Estevam Subject: [PATCH 2/4] iio: imx7d_adc: Introduce a definition for the input clock Date: Mon, 3 Jun 2019 16:34:31 -0300 Message-Id: <20190603193433.6394-2-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190603193433.6394-1-festevam@gmail.com> References: <20190603193433.6394-1-festevam@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 Since the input clock is always 24MHz, there is no need for storing this value into a variable. Use a definition instead, which is more appropriate in this case. Signed-off-by: Fabio Estevam --- drivers/iio/adc/imx7d_adc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c index 23c7b0ee945f..bffc172e7635 100644 --- a/drivers/iio/adc/imx7d_adc.c +++ b/drivers/iio/adc/imx7d_adc.c @@ -78,6 +78,7 @@ #define IMX7D_REG_ADC_INT_STATUS_CHANNEL_CONV_TIME_OUT 0xf0000 #define IMX7D_ADC_TIMEOUT msecs_to_jiffies(100) +#define IMX7D_ADC_INPUT_CLK 24000000 enum imx7d_adc_clk_pre_div { IMX7D_ADC_ANALOG_CLK_PRE_DIV_4, @@ -272,13 +273,11 @@ static void imx7d_adc_channel_set(struct imx7d_adc *info) static u32 imx7d_adc_get_sample_rate(struct imx7d_adc *info) { - /* input clock is always 24MHz */ - u32 input_clk = 24000000; u32 analogue_core_clk; u32 core_time_unit = info->adc_feature.core_time_unit; u32 tmp; - analogue_core_clk = input_clk / info->pre_div_num; + analogue_core_clk = IMX7D_ADC_INPUT_CLK / info->pre_div_num; tmp = (core_time_unit + 1) * 6; return analogue_core_clk / tmp; From patchwork Mon Jun 3 19:34:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10973933 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 43DFF6C5 for ; Mon, 3 Jun 2019 19:35:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 351C12094F for ; Mon, 3 Jun 2019 19:35:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 272BB27FB1; Mon, 3 Jun 2019 19:35:32 +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 CEEF62094F for ; Mon, 3 Jun 2019 19:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbfFCTfb (ORCPT ); Mon, 3 Jun 2019 15:35:31 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45486 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfFCTfb (ORCPT ); Mon, 3 Jun 2019 15:35:31 -0400 Received: by mail-qk1-f193.google.com with SMTP id s22so1212351qkj.12 for ; Mon, 03 Jun 2019 12:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=flnePExtC+ruu5dhcQrai04re/FGxZ1Oi9gicuNZPPI=; b=fklkNTmFbnN6dxKgeKiYAQ41+ZyCTKhT8Lo5FjSygFZk7wX2w8MaPrkUn57XLq+Uf8 kkgSuj4twdq0KQsTVXUsXzB+4KMf4IiM/mL1O/GOdHIK6BazHKlcwKCv5crRFSPx2aoG aKdssGZ6DhEUH+lwLLmaGLFi/YSMHDysN7fIfuYtscni5TjUgNuSqiEFfdWZegLAyPoD zV/CDiiAbrV7pmaUk6nhRMFbuZsd4TA+rmEypx/z8U9pG5XxPZDwgHMY15kU+cLTCdNi xYwFkX6pe/ZWfM4RBYCsaXuSObuPhiI6J2C6pmiWNwhF0hMn69wST/SXBdFHrUKkVhS1 C4Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=flnePExtC+ruu5dhcQrai04re/FGxZ1Oi9gicuNZPPI=; b=ljK99NSIDl3zyLWzRNxO8UVZpqOC41HwudXmBPoEXFJ/gptPLGeXQlKrvcRjwsso34 p0R2aQj4dP4Um/Or9GIIoC2F94mwt8cashsslDCCxzdldI3YZVTSXnZ5bu7K02dJ3LQW t4RKC3pTj+tbxIst2GK0V6XVhOet1JuL31UeH47iL4bH/nxv7JW6e0fWSlDA1jyLvOFx CdJkL1l1YwHh55uPWw3kKGk4cFvI02zx15JaQmoSgK2d7ESLnQTESrEK/D3ZgANd8IX+ ZO0goj0WqSUJQgdkEvu/JQgItLtUiGApSLIEYcGypKjgIICm4OR50Ee83fRWaFlpK/PQ wMuA== X-Gm-Message-State: APjAAAWa8FgJc6F9WWzyHh9Xt5YQ3hIRA3wlSd+pBoq3Zq/xsLfTeXA4 mwYc2ElbpSIFq2q+Vci39cc= X-Google-Smtp-Source: APXvYqye522K4085TBXZolIuU0HD3iKHnMAZkm5nQHeGnOGQWfiwRrFRJWMJbmmW++K0nnFee1i1TA== X-Received: by 2002:a05:620a:147:: with SMTP id e7mr23254276qkn.247.1559590530334; Mon, 03 Jun 2019 12:35:30 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id t80sm7539231qka.87.2019.06.03.12.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 12:35:29 -0700 (PDT) From: Fabio Estevam To: jic23@kernel.org Cc: andrew.smirnov@gmail.com, linux-iio@vger.kernel.org, Fabio Estevam Subject: [PATCH 3/4] iio: imx7d_adc: Fit into a single line Date: Mon, 3 Jun 2019 16:34:32 -0300 Message-Id: <20190603193433.6394-3-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190603193433.6394-1-festevam@gmail.com> References: <20190603193433.6394-1-festevam@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 All the parameters of devm_request_irq() can fit into a single line, so place them all in a single line for better readability. Signed-off-by: Fabio Estevam --- drivers/iio/adc/imx7d_adc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c index bffc172e7635..46e88899ad74 100644 --- a/drivers/iio/adc/imx7d_adc.c +++ b/drivers/iio/adc/imx7d_adc.c @@ -527,9 +527,7 @@ static int imx7d_adc_probe(struct platform_device *pdev) indio_dev->channels = imx7d_adc_iio_channels; indio_dev->num_channels = ARRAY_SIZE(imx7d_adc_iio_channels); - ret = devm_request_irq(dev, irq, - imx7d_adc_isr, 0, - dev_name(dev), info); + ret = devm_request_irq(dev, irq, imx7d_adc_isr, 0, dev_name(dev), info); if (ret < 0) { dev_err(dev, "Failed requesting irq, irq = %d\n", irq); return ret; From patchwork Mon Jun 3 19:34:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10973935 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 7DEFC1515 for ; Mon, 3 Jun 2019 19:35:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DDCA2094F for ; Mon, 3 Jun 2019 19:35:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6115B27FB1; Mon, 3 Jun 2019 19:35:35 +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 133802094F for ; Mon, 3 Jun 2019 19:35:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbfFCTfe (ORCPT ); Mon, 3 Jun 2019 15:35:34 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:44298 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725876AbfFCTfe (ORCPT ); Mon, 3 Jun 2019 15:35:34 -0400 Received: by mail-qt1-f195.google.com with SMTP id x47so10836992qtk.11 for ; Mon, 03 Jun 2019 12:35:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8Z56y5NEC2YnC4rCSfGPtPlUIecEEPpwOsxZipXMuzo=; b=OORORKlAlwgkC9fEn52k6O5WjKEwBVz38902L7e5Fd+vNKyM+VdeeW9aCapQeo2cAr fUAh+eWJnCaof0BzH0lQx29I4LbIL138MkF9w2cwm7dGhGabG/NPHSoHWlEMnVWgfzLn D/Mh2tHiMfjHxwfqYDmfP5ADOWhwYkaQdsU0LAL0oY9pl0bM8hXqWXCMOTPo1KQ0eurz DDvkTGJKOQvxmG9N00KRSBDYVxTPWWtHkjsNuwii0bkcKXfprRSxtlTMocylrfVJRKsC BssY+d+EreskBPYyFylv6eXsyIixslphMHyFkhZPlPeSC+BjLQJebpNGMzYe2r77fEXw GTfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8Z56y5NEC2YnC4rCSfGPtPlUIecEEPpwOsxZipXMuzo=; b=l3icixcjowvVgmvYoo3gtqckMZMVwl66S8PDUSdcoV0Ci/5v9gO+5pnOfl+DcmXzoX SHFkRALyLW1rNshEZCDlob50P2ZAz7yHeWV72YmkCfTtOBEERyPliTOs1tfSgM6sLrdb RVm6cHaJ8laao3WNH6Om3yrgFVJI21LgTKQ0mFyO5dvZK6yKZf6prbdLTj65sqjwEqUR jTH+K6epnxUq7PC85gSwQXuUwVGg3NNp+7YryRq3qcqbYbm6XQD35/MYgfDcvWqrf52h d2PRLikIknSbWd4dONADUnPdKjznp/iDF/gevpx2WkQB5EDpHV0bRVwRBLrT61wpjXIO GIYw== X-Gm-Message-State: APjAAAXwchtgQcFCjoGixLUpCXsruw5qB/csIg170nJGn9Oejp+O6h2X 4jRjf3oiYauOGrCSDT26ibUuPeNd X-Google-Smtp-Source: APXvYqxuSWcDoufyo9tS5xdQyUffFTpRsm4DTjIFJx6BMCjABNTqIbP/P4BrQUwMmEmjlTxAjnuDlA== X-Received: by 2002:a0c:e741:: with SMTP id g1mr20129836qvn.67.1559590533363; Mon, 03 Jun 2019 12:35:33 -0700 (PDT) Received: from fabio-Latitude-E5450.am.freescale.net ([2804:14c:482:3c8:56cb:1049:60d2:137b]) by smtp.gmail.com with ESMTPSA id t80sm7539231qka.87.2019.06.03.12.35.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jun 2019 12:35:32 -0700 (PDT) From: Fabio Estevam To: jic23@kernel.org Cc: andrew.smirnov@gmail.com, linux-iio@vger.kernel.org, Fabio Estevam Subject: [PATCH 4/4] iio: imx7d_adc: Remove unneeded 'average_en' member Date: Mon, 3 Jun 2019 16:34:33 -0300 Message-Id: <20190603193433.6394-4-festevam@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190603193433.6394-1-festevam@gmail.com> References: <20190603193433.6394-1-festevam@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 average_en is always true, so there is not really need for this structure member. Signed-off-by: Fabio Estevam --- drivers/iio/adc/imx7d_adc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c index 46e88899ad74..26a7bbe4d534 100644 --- a/drivers/iio/adc/imx7d_adc.c +++ b/drivers/iio/adc/imx7d_adc.c @@ -101,8 +101,6 @@ struct imx7d_adc_feature { enum imx7d_adc_average_num avg_num; u32 core_time_unit; /* impact the sample rate */ - - bool average_en; }; struct imx7d_adc { @@ -180,7 +178,6 @@ static void imx7d_adc_feature_config(struct imx7d_adc *info) info->adc_feature.clk_pre_div = IMX7D_ADC_ANALOG_CLK_PRE_DIV_4; info->adc_feature.avg_num = IMX7D_ADC_AVERAGE_NUM_32; info->adc_feature.core_time_unit = 1; - info->adc_feature.average_en = true; } static void imx7d_adc_sample_rate_set(struct imx7d_adc *info) @@ -241,9 +238,8 @@ static void imx7d_adc_channel_set(struct imx7d_adc *info) /* the channel choose single conversion, and enable average mode */ cfg1 |= (IMX7D_REG_ADC_CH_CFG1_CHANNEL_EN | - IMX7D_REG_ADC_CH_CFG1_CHANNEL_SINGLE); - if (info->adc_feature.average_en) - cfg1 |= IMX7D_REG_ADC_CH_CFG1_CHANNEL_AVG_EN; + IMX7D_REG_ADC_CH_CFG1_CHANNEL_SINGLE | + IMX7D_REG_ADC_CH_CFG1_CHANNEL_AVG_EN); /* * physical channel 0 chose logical channel A