Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4590641pja; Thu, 21 Nov 2019 22:26:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzj/00KpEwJqDez0FyeP2ejnew8MqAvD/M98oPoA1uzqeoV/u8SN8xdnb0rJjMmYNwF6Zh8 X-Received: by 2002:a17:906:8054:: with SMTP id x20mr19425962ejw.68.1574403966641; Thu, 21 Nov 2019 22:26:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574403966; cv=none; d=google.com; s=arc-20160816; b=nJrPM6HS/G05m22eoQUU2ULyd6AgQswhQHgCNlrheIiHGbCxaO31SRdkpoy5NPyXEL +u83Q/lGN6nSJ7019Lxu0KNkswP2ZJiIvgSzjbfLObu4UQGxHikRjwxKHMQQxVCSsI82 K0RUx3xUMCDDuX69zbzVPrdhTBH1qJnFvUmhFswkwE9OghWVJRgEAAnmFZxAdZXKFdDY e+Dz7M/woJtIrTX+W7FCN78QeKdhNB5ecwo+5GhVfNgLf8CzS745vddseHiIfkNpaBa7 MuHYWA15VR5BAlanK2CizttlHzrfGqyDv0kVnl12NMKqBcs9IYJ3jFvWuy7ijX6NQrrI gvDA== 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=1JHLkyUGrtdk3dECdvPnkU890+Yi8oZrz/+VzNfDQrU=; b=HjMSYA84L7fJFQN2X0HSNd7CXp3wox9dEhTm+6jyo5boy+v9IZOKgUD1QB3wKr9Php JTaDV/fYw4xaXDm0ipRxkaJ4o8dFvfOPS9AHhvpO5st130Yynf/K30xsNJeKtS03KKWP 7UL/1xsnhtUxFL8WzaJatPm03857TaToA2yJv0UivXlM7Cz6+seA3bZsSQs2Gn9jKU8X EE5SXsufVyTbyw5yJtnE+tmN0kQ7qIH8vV6mCrsqVSaXOFHTRxvBWht42TcEeDrmiUFE yRd4s9yiuHng997oaM6WXeUFCjApJoSygVg0l+FeG9dQ2d5SM0xDwdsXqO/hDiiPSs8N 4caw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=whG7Unw2; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qw26si3517308ejb.103.2019.11.21.22.25.43; Thu, 21 Nov 2019 22:26:06 -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=@kernel.org header.s=default header.b=whG7Unw2; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728329AbfKVGXZ (ORCPT + 99 others); Fri, 22 Nov 2019 01:23:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:57056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbfKVFvq (ORCPT ); Fri, 22 Nov 2019 00:51:46 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7C3D22084B; Fri, 22 Nov 2019 05:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401906; bh=wLBO30qA8tZlK3OT5pGv0t3ty/ImslmbiEW2j4YjAG0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=whG7Unw2khm4vsQGruMSNnnN9ip2QKc2bDjZIDciYvnUH9I/GUhys5MmkEYbuNU7W Jj2u1AmMPEF2K86kDHj5104ENFtXWcEZBOW4I85qSMkM0QphBY4L10HRHwnUs/jgT/ ZT6qjJihRQPq2VU/UnSvwjrXiA6maa66LqBCiDQE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Shiyan , Thierry Reding , Sasha Levin , linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.19 137/219] pwm: clps711x: Fix period calculation Date: Fri, 22 Nov 2019 00:47:49 -0500 Message-Id: <20191122054911.1750-130-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Shiyan [ Upstream commit b0f17570b8203c22f139459c86cfbaa0311313ed ] Commit e39c0df1be5a ("pwm: Introduce the pwm_args concept") has changed the variable for the period for clps711x-pwm driver, so now pwm_get/set_period() works with pwm->state.period variable instead of pwm->args.period. This patch changes the period variable in other places where it is used. Signed-off-by: Alexander Shiyan Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/pwm/pwm-clps711x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c index 26ec24e457b12..7e16b7def0dcb 100644 --- a/drivers/pwm/pwm-clps711x.c +++ b/drivers/pwm/pwm-clps711x.c @@ -48,7 +48,7 @@ static void clps711x_pwm_update_val(struct clps711x_chip *priv, u32 n, u32 v) static unsigned int clps711x_get_duty(struct pwm_device *pwm, unsigned int v) { /* Duty cycle 0..15 max */ - return DIV_ROUND_CLOSEST(v * 0xf, pwm_get_period(pwm)); + return DIV_ROUND_CLOSEST(v * 0xf, pwm->args.period); } static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) @@ -71,7 +71,7 @@ static int clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, struct clps711x_chip *priv = to_clps711x_chip(chip); unsigned int duty; - if (period_ns != pwm_get_period(pwm)) + if (period_ns != pwm->args.period) return -EINVAL; duty = clps711x_get_duty(pwm, duty_ns); -- 2.20.1