From patchwork Tue Apr 10 06:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Ranostay X-Patchwork-Id: 10332361 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 02B7B6028A for ; Tue, 10 Apr 2018 06:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD5D9288BE for ; Tue, 10 Apr 2018 06:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0B5E28C9C; Tue, 10 Apr 2018 06:18: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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1CE48288BE for ; Tue, 10 Apr 2018 06:18:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751589AbeDJGS0 (ORCPT ); Tue, 10 Apr 2018 02:18:26 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33606 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbeDJGSZ (ORCPT ); Tue, 10 Apr 2018 02:18:25 -0400 Received: by mail-pl0-f68.google.com with SMTP id s10-v6so6779410plp.0 for ; Mon, 09 Apr 2018 23:18:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=from:to:cc:subject:date:message-id; bh=rKd51Oa9AV3HRaC0zEHzW/SN5dHduefzz6hreevb9Uk=; b=ezmRF4lV1PmiYy+wo1PKwP8i5VLEPK+iKopJfBOAQh/BvBOlJtu9DhoKskDODMv3Yv E/VN/h0EMiNNgubW90fkctz5hUQThM+pWWwMBbkWUdpr8bgKHJFyJ+yYk1AHXopWZYyo 48ENcB7w6wwHMn4c8XRZDsm+YbHfoguNuVHz0= 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=rKd51Oa9AV3HRaC0zEHzW/SN5dHduefzz6hreevb9Uk=; b=H3+CpI64u8M+WgtGk3Nfk45ZCv6et/koaOzxDUI+VjeJ7l0I/KT+VesYaICQPQGY0h +YzML+ADHNLmnSmdSvdMGXFeTPX9PieFfkFCSheQsiu8/QLUxaWzktd68rJlKxPBnK4J l6BRs5NhwfI3mhad6miR1Nf/E0riaBR1Rilxs/3bmnuCb7DCqyGI81HhFjaVx8yaC76g 9DoSh2NCIublxK4yBLZ3gh2RCSMCYdNpP9+5025+EhxNQwp3ksg19mIzpvDJS+XZDgwn Q6NqGZTzCUcCYzDkvexZDKNG/Citl0oOssudRmprsnZWYdCHQ5UZcRg5IdKx5kWI+2iH NZig== X-Gm-Message-State: AElRT7EIW2o229DSWyxjPTXIJ3A5lIdN4LXuF+C/xcMhV68S2B87BOq5 rmlAsuQnPvH+yGSpS6gUS3E5SmRC X-Google-Smtp-Source: AIpwx48mTzhk5d1Kwfz4WvHC5DOJN9XUsijpxAda3MMwdaJ/hTbubbs3Y+BiQ7l6hiDBMsz9lI9bsA== X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr42110814plb.54.1523341105438; Mon, 09 Apr 2018 23:18:25 -0700 (PDT) Received: from niteshade.hsd1.or.comcast.net ([2601:1c2:5000:8d45::3f0e]) by smtp.gmail.com with ESMTPSA id t25sm3833855pfk.69.2018.04.09.23.18.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 23:18:24 -0700 (PDT) From: Matt Ranostay To: jic23@kernel.org Cc: linux-iio@vger.kernel.org, Matt Ranostay , Nicholas Mc Guire Subject: [PATCH] iio: chemical: atlas-ph-sensor: use msleep() for long uncritical delays Date: Mon, 9 Apr 2018 23:18:22 -0700 Message-Id: <20180410061822.12750-1-matt.ranostay@konsulko.com> X-Mailer: git-send-email 2.14.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 usleep_range() uses hrtimers and provides no advantage over msleep() for larger delays. Cc: Nicholas Mc Guire Link: http://lkml.org/lkml/2017/1/11/377 Signed-off-by: Matt Ranostay Reviewed-by: Nicholas Mc Guire --- drivers/iio/chemical/atlas-ph-sensor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/iio/chemical/atlas-ph-sensor.c b/drivers/iio/chemical/atlas-ph-sensor.c index abfc4bbc4cfc..a406ad31b096 100644 --- a/drivers/iio/chemical/atlas-ph-sensor.c +++ b/drivers/iio/chemical/atlas-ph-sensor.c @@ -61,9 +61,9 @@ #define ATLAS_REG_ORP_CALIB_STATUS 0x0d #define ATLAS_REG_ORP_DATA 0x0e -#define ATLAS_PH_INT_TIME_IN_US 450000 -#define ATLAS_EC_INT_TIME_IN_US 650000 -#define ATLAS_ORP_INT_TIME_IN_US 450000 +#define ATLAS_PH_INT_TIME_IN_MS 450 +#define ATLAS_EC_INT_TIME_IN_MS 650 +#define ATLAS_ORP_INT_TIME_IN_MS 450 enum { ATLAS_PH_SM, @@ -270,21 +270,21 @@ static struct atlas_device atlas_devices[] = { .num_channels = 3, .data_reg = ATLAS_REG_PH_DATA, .calibration = &atlas_check_ph_calibration, - .delay = ATLAS_PH_INT_TIME_IN_US, + .delay = ATLAS_PH_INT_TIME_IN_MS, }, [ATLAS_EC_SM] = { .channels = atlas_ec_channels, .num_channels = 5, .data_reg = ATLAS_REG_EC_DATA, .calibration = &atlas_check_ec_calibration, - .delay = ATLAS_EC_INT_TIME_IN_US, + .delay = ATLAS_EC_INT_TIME_IN_MS, }, [ATLAS_ORP_SM] = { .channels = atlas_orp_channels, .num_channels = 2, .data_reg = ATLAS_REG_ORP_DATA, .calibration = &atlas_check_orp_calibration, - .delay = ATLAS_ORP_INT_TIME_IN_US, + .delay = ATLAS_ORP_INT_TIME_IN_MS, }, }; @@ -393,7 +393,7 @@ static int atlas_read_measurement(struct atlas_data *data, int reg, __be32 *val) } if (suspended) - usleep_range(data->chip->delay, data->chip->delay + 100000); + msleep(data->chip->delay); ret = regmap_bulk_read(data->regmap, reg, (u8 *) val, sizeof(*val));