Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6375909ybe; Wed, 18 Sep 2019 02:24:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrJUg6gSplqlH7FbtBGyJuzZJWUkr3w6Z73bX9MMVpM+Yhh2PfMcLArJoNRVlrqABN8YJ1 X-Received: by 2002:a17:906:d8a9:: with SMTP id qc9mr7279896ejb.199.1568798651392; Wed, 18 Sep 2019 02:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568798651; cv=none; d=google.com; s=arc-20160816; b=f8CHEewZdyJKLosVQkyHFp46zOx/t4UOtwcltGNERmbIJaKtR4fu0Tn7NBex55REQj jLMagGts7OspJgMfxnII+qMQHLLeT0PrvvJ2KwCHcdJf+ZMAwC4TmvX/og0V23YqTWFq d5Yy/mvSFjyzro/5FdDd3W4a5gyIctntiHpw8X22Xh0PGV4WKLDSooxxFrm8NQ5ZD1Bo TBk3XZ2+knvUCaaj0uSgL5LTZ8gHXnPWZgyDnzbMGSlj6tcbcDXMREMAsAPI8kyG/Rmz +Gji+V46VP33K4+Y9b93aagOCuRUjGAKqP4aVrXnforSvT72qGqciBYnJGbDntYVBabE slPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wv4la6Y6FsJg+2v49trmGgdAwNGUcPB7OMZV54Bj2EQ=; b=IKaJdCJW5MBhB1qrjxSr0qqfDMiSlk4ZdrcvQz5/tY/rYq12kKVWWrptfErxZF9zrR X4yebRp26b6Ds5YZ+YL0PthoNvH7A3mUOLZO+Ot94y/SFXld8P9J84BZ0hmW41TplbYb t7BrpfqCUHZSFuZ7DoPQtsyMx44RhebBM9MB8AJreiiUZgPowQRMmH1l6e7m7DQwuVNe tfzUVFy2VSQmREa7/M48Og/f497p0jBbuHHVGlkGsId5jJCR5FUSE0fcHFgYQzPbfVgI aZ8mkf5O72mo6Ry6v8jzS/Gjo0XiZje6CTCfxgYIWNOJu8OZt6pCnoY6dwHVM4GWImCQ 6Eng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gBsEGCLI; 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 34si3120673edk.26.2019.09.18.02.23.48; Wed, 18 Sep 2019 02:24:11 -0700 (PDT) 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=gBsEGCLI; 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 S1729248AbfIRHxt (ORCPT + 99 others); Wed, 18 Sep 2019 03:53:49 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43061 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfIRHxq (ORCPT ); Wed, 18 Sep 2019 03:53:46 -0400 Received: by mail-pf1-f194.google.com with SMTP id a2so3815256pfo.10; Wed, 18 Sep 2019 00:53:46 -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 :mime-version:content-transfer-encoding; bh=wv4la6Y6FsJg+2v49trmGgdAwNGUcPB7OMZV54Bj2EQ=; b=gBsEGCLIoG9yZOLSPABp5DkqpxUM9VPF+gft6+M58mitntGiBP2B8ZmrdxOFtVQXbn Ri3QHHyEmNUfyQSyX52qq4D7m9tZmGEhy7E12ATGIl8xUL2fdr6MQC7B7UgLocy3qRN2 zKvq2O6kUZNUZUjYg9ZTnJLo1cAZ3DagU2gA6jbq1mM9d7b8TS+CBxCYv73a21JsSweL YgDq8thCF1g0TVAs5oSjbcIWdTfUOK6BABgoT/pslldal2AWK0yke8OqcUmbkyBbntit /xJdKQ99zJ/XgOU8AdprPj5kAjHHpD7e2Vrr4WeHEetM6hB5L+So+ClfGNokdxjz5+Vw UwIQ== 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:mime-version:content-transfer-encoding; bh=wv4la6Y6FsJg+2v49trmGgdAwNGUcPB7OMZV54Bj2EQ=; b=KIiza3Ym0/Iek06nYuTC0Q+Bf8u1iGmn36aGRe9W/I1gIFUEfGsbleqvuPZIWT00W8 br3rJrR/2H39KU5IhPVo1sEoS98RJTcYpjA9f3EeDxdoY/ek4TKpCxnLhjJsYyDgs9mq 5UyMw1Z1JmGOsDBuuR6fTmhHEfUGP82+FFbQdSPJn+qMFX61MTp+H4BNXc2gytT9HWEQ 1Y0sX4b1szCVT7f6AAfDkTzFbdF7HZDF0g22BzyCJecpkgXSzjoiwdIDU4sLVryoCmXx Um8Vc8hzUKg4zSwCI+dEH0xaHnhaohNcEAfu+DjaKEj+HDeeVgcQTJokCj/uSyGiMEdn CEXQ== X-Gm-Message-State: APjAAAWawIb3dwoRrSj8hB0RHg4M+Rzf5isi7d/OB00dbZSdpyxZH8uN TrkX7mwGsR40gJC5g820QCQ= X-Received: by 2002:a17:90a:b108:: with SMTP id z8mr2370791pjq.64.1568793226157; Wed, 18 Sep 2019 00:53:46 -0700 (PDT) Received: from localhost.localdomain ([2001:268:c147:d9df:f819:e399:825f:f2dc]) by smtp.gmail.com with ESMTPSA id h8sm5580715pfo.64.2019.09.18.00.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 00:53:45 -0700 (PDT) From: William Breathitt Gray To: jic23@jic23.retrosnub.co.uk Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, William Breathitt Gray Subject: [PATCH v2 7/7] counter: stm32-timer-cnt: Update count_read and count_write callbacks Date: Wed, 18 Sep 2019 16:52:48 +0900 Message-Id: <327fe01b7ce4feb0fc3d854393691664a6a36b40.1568792697.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The count_read and count_write callbacks pass unsigned long now. Cc: Fabrice Gasnier Signed-off-by: William Breathitt Gray --- drivers/counter/stm32-timer-cnt.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/counter/stm32-timer-cnt.c b/drivers/counter/stm32-timer-cnt.c index 644ba18a72ad..839083543323 100644 --- a/drivers/counter/stm32-timer-cnt.c +++ b/drivers/counter/stm32-timer-cnt.c @@ -48,34 +48,27 @@ static enum counter_count_function stm32_count_functions[] = { }; static int stm32_count_read(struct counter_device *counter, - struct counter_count *count, - struct counter_count_read_value *val) + struct counter_count *count, unsigned long *val) { struct stm32_timer_cnt *const priv = counter->priv; u32 cnt; regmap_read(priv->regmap, TIM_CNT, &cnt); - counter_count_read_value_set(val, COUNTER_COUNT_POSITION, &cnt); + *val = cnt; return 0; } static int stm32_count_write(struct counter_device *counter, struct counter_count *count, - struct counter_count_write_value *val) + const unsigned long val) { struct stm32_timer_cnt *const priv = counter->priv; - u32 cnt; - int err; - - err = counter_count_write_value_get(&cnt, COUNTER_COUNT_POSITION, val); - if (err) - return err; - if (cnt > priv->ceiling) + if (val > priv->ceiling) return -EINVAL; - return regmap_write(priv->regmap, TIM_CNT, cnt); + return regmap_write(priv->regmap, TIM_CNT, val); } static int stm32_count_function_get(struct counter_device *counter, -- 2.23.0