From patchwork Fri Mar 16 20:06:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Jha X-Patchwork-Id: 10290071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3CB83602C2 for ; Fri, 16 Mar 2018 20:09:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A1DB28E0F for ; Fri, 16 Mar 2018 20:09:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D56128F90; Fri, 16 Mar 2018 20:09:27 +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=-2.0 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no 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 B2E3F28E0F for ; Fri, 16 Mar 2018 20:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148AbeCPUHA (ORCPT ); Fri, 16 Mar 2018 16:07:00 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:38388 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752084AbeCPUGz (ORCPT ); Fri, 16 Mar 2018 16:06:55 -0400 Received: by mail-pg0-f67.google.com with SMTP id a15so4497316pgn.5; Fri, 16 Mar 2018 13:06:55 -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=/iccnOjY6i1kO4B1/HD85opfWBl0YAQKSIFMLnmMeds=; b=UPiA34HLVSiSxOUNd65IR+BCTEKZzIQ1YfP8x7YWWDUQeoJBpQIvCn82/HI2p1U3rt g2RR9GjyS8uSlLTE6zTQC3R33+DS7lI9iYLXqO7yj0NbA/SjEVtUtYWCzUYIf+FoOaP+ 2FvpbXXQD9wJcSa0JcnjoNvUJ4bWUqB9HSUmLm4IEXTlRe2WRL8jfF8NTMl8fW99a4NT NhsLxgJzcpVZ6YOfCbdbtwN2MfKX0/fucF2/a8QD4Rt2UX66fTFgyUvtzehHc1TfLjZl /AZ/8rOEDZ2BpC6SkA/kPXmWw9e976mPAduNhdUcUSv6jjzddnVYU8JLt9vaYRW6+5il LJfQ== 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=/iccnOjY6i1kO4B1/HD85opfWBl0YAQKSIFMLnmMeds=; b=qRlYpP5VHx/xRfQkESQBB2+8VEp4ESnGkL6m8qga/wJk6Ba2TzmIg28wWtbuzDwWhF /lnVTbHLGQjkE2Rp5lEYalcAfZhtt8d/2+Q0Il3h+XB09jhVv0wnygHprqY1WEVbVv5L s8LvSrrVA35cXFggZ/2fzby9Imk+yz1Z48FbA6zNndGYHuHDxRRNxFitifnG/VHXJYgT g9ehoCGDgDmsUvYSu3waDgg+yUTql1bWJfBdnQ/obJDb4dERSO0t9dDCyJFPA35RY048 smvA7xI8hEuqcnGQuPaaxlXw2zR0Ef7VfvQoqASqwBH91Ch1jRwrW88sQlh/Pj8Orbay A9kQ== X-Gm-Message-State: AElRT7GRerd5eouCE79JM0/c0izD2yTfNpsa7bYtpbm9kWNEQLeB7ea3 CkKYAFrPXz4FwyI9/2jvEbU= X-Google-Smtp-Source: AG47ELsbSk+hJb8h2UVwMt3dkNpCFPiH2VX2cLpZrFTAy0j/S5+KFhiiGvmrjT+LPO/Si1X8WA4PVg== X-Received: by 10.99.119.133 with SMTP id s127mr2418852pgc.441.1521230814911; Fri, 16 Mar 2018 13:06:54 -0700 (PDT) Received: from localhost.localdomain ([103.46.193.14]) by smtp.gmail.com with ESMTPSA id s9sm15605347pfm.39.2018.03.16.13.06.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Mar 2018 13:06:54 -0700 (PDT) From: Himanshu Jha To: jic23@kernel.org Cc: lars@metafoo.de, Michael.Hennerich@analog.com, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, daniel.baluta@gmail.com, 21cnbao@gmail.com, Himanshu Jha Subject: [PATCH v2 1/9] Staging: iio: accel: adis16201: Rename few macro definitions Date: Sat, 17 Mar 2018 01:36:18 +0530 Message-Id: <1521230786-18155-2-git-send-email-himanshujha199640@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521230786-18155-1-git-send-email-himanshujha199640@gmail.com> References: <1521230786-18155-1-git-send-email-himanshujha199640@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 Rename the macro definitions with suitable names specifying their purpose. * ADIS16201_STARTUP_DELAY_MS: Remove the comment specifying the delay in microseconds and rename it with addtition of _MS suffix. * ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH: Rename the macro to make it similar to other misc control registers which denotes the data ready polarity. * ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT: Rename to denote it is a failure bit. * ADIS16201_GLOB_CMD_FACTORY_RESET: Remove ambiguous _CAL suffix and add _RESET suffix instead to denote factory reset command. Signed-off-by: Himanshu Jha --- v2: -explained every change in the process of renaming macros. drivers/staging/iio/accel/adis16201.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c index 0fae8aa..767ebf0 100644 --- a/drivers/staging/iio/accel/adis16201.c +++ b/drivers/staging/iio/accel/adis16201.c @@ -20,7 +20,7 @@ #include #include -#define ADIS16201_STARTUP_DELAY 220 /* ms */ +#define ADIS16201_STARTUP_DELAY_MS 220 /* Flash memory write count */ #define ADIS16201_FLASH_CNT 0x00 @@ -118,7 +118,7 @@ #define ADIS16201_MSC_CTRL_DATA_RDY_EN BIT(2) /* Data-ready polarity: 1 = active high, 0 = active low */ -#define ADIS16201_MSC_CTRL_ACTIVE_HIGH BIT(1) +#define ADIS16201_MSC_CTRL_ACTIVE_DATA_RDY_HIGH BIT(1) /* Data-ready line selection: 1 = DIO1, 0 = DIO0 */ #define ADIS16201_MSC_CTRL_DATA_RDY_DIO1 BIT(0) @@ -135,7 +135,7 @@ #define ADIS16201_DIAG_STAT_SPI_FAIL_BIT 3 /* Flash update failure */ -#define ADIS16201_DIAG_STAT_FLASH_UPT_BIT 2 +#define ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT 2 /* Power supply above 3.625 V */ #define ADIS16201_DIAG_STAT_POWER_HIGH_BIT 1 @@ -146,7 +146,7 @@ /* GLOB_CMD */ #define ADIS16201_GLOB_CMD_SW_RESET BIT(7) -#define ADIS16201_GLOB_CMD_FACTORY_CAL BIT(1) +#define ADIS16201_GLOB_CMD_FACTORY_RESET BIT(1) #define ADIS16201_ERROR_ACTIVE BIT(14) @@ -290,7 +290,7 @@ static const struct iio_info adis16201_info = { static const char * const adis16201_status_error_msgs[] = { [ADIS16201_DIAG_STAT_SPI_FAIL_BIT] = "SPI failure", - [ADIS16201_DIAG_STAT_FLASH_UPT_BIT] = "Flash update failed", + [ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT] = "Flash update failed", [ADIS16201_DIAG_STAT_POWER_HIGH_BIT] = "Power supply above 3.625V", [ADIS16201_DIAG_STAT_POWER_LOW_BIT] = "Power supply below 3.15V", }; @@ -303,11 +303,11 @@ static const struct adis_data adis16201_data = { .self_test_mask = ADIS16201_MSC_CTRL_SELF_TEST_EN, .self_test_no_autoclear = true, - .startup_delay = ADIS16201_STARTUP_DELAY, + .startup_delay = ADIS16201_STARTUP_DELAY_MS, .status_error_msgs = adis16201_status_error_msgs, .status_error_mask = BIT(ADIS16201_DIAG_STAT_SPI_FAIL_BIT) | - BIT(ADIS16201_DIAG_STAT_FLASH_UPT_BIT) | + BIT(ADIS16201_DIAG_STAT_FLASH_UPT_FAIL_BIT) | BIT(ADIS16201_DIAG_STAT_POWER_HIGH_BIT) | BIT(ADIS16201_DIAG_STAT_POWER_LOW_BIT), };