From patchwork Mon Mar 18 16:09:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 13595559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F7B8C54E6A for ; Mon, 18 Mar 2024 16:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C7Dv6NiK5h6T1V60qeKHU7+sNcG2DNRepiVhxr9DPZ8=; b=knSqXW67KlTjAa Q45y7kkrW7JgKJbkiq+9ERfbIkpcs/wNPRgJq8bXs6Z+nCJuIsSCgdDu3BjVhshQZVPE4B0b/WVRh /QRCY3Sc669q+euaGHVrtXn/8xro0bWJ6tnQ/n3UdgG7E7l4NEyMdjDLY3PT4Kv+3qpJtI9hjiSIL uA3K/OaL2gQUKBkz+1MGKoTsVo4GWvhM8lqxStqcIW0riZmCTrrGlPUgRUjgK30vTP0TUExPqljtb fPaZuyhoOh3tN9BuPv2Jw+5yDsvE71q1wyoxqM2qo+ZNKULjNSUkMo0I5jS9QOlQfJgTLzmcYStGm l28rb3B1so0NHBx35oAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmFqT-00000009Emd-2TpO; Mon, 18 Mar 2024 16:28:17 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rmFqP-00000009Ek7-3Z0H for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2024 16:28:16 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rmFqA-0007vm-3z; Mon, 18 Mar 2024 17:27:58 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmFq7-00771K-3i; Mon, 18 Mar 2024 17:27:55 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rmFq7-0084aB-04; Mon, 18 Mar 2024 17:27:55 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jean Delvare , Guenter Roeck , Joel Stanley Cc: Andrew Jeffery , linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-pwm@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/2] hwmon: (aspeed-g6-pwm-tacho): Make use of pwmchip_parent() accessor Date: Mon, 18 Mar 2024 17:09:49 +0100 Message-ID: <5c6a11dd10cd29e0f7bfaa1fdef145523347cb58.1710777536.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1715; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=0kwrQdVB9fHadW0zcs/zefkApf0unD8BGUorM1zzxmk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl+GdO3EeEUQ6nZ6pNdoQlPypXol9wo4WBc8brb /motAhELkWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZfhnTgAKCRCPgPtYfRL+ TsW1B/4z18EWUeJw8wanzvuSJt/qMpj2oBXKwiEzs+LtnrnJley6qeMoySlIeJ5WW0nVSbG/J8x 49nH5bAVvuR/5lnNT5RxR95dy5lfuYeos4aUzW7/SpMgWmMOAu7XewYt5nl1EYdwFA2YweSM0l8 0VbVlsQubVnIUeb9ab19Y8u9SfvoQRQ2lGD2Ps6hFhPwRSalSVHme23YyDL3zsC0hpO7spSow/b qjCr/BoWYZ1bN8xRYQXqlhjUZF8OGinn2haV7XU7N0DIOlWl1foIDVJk94eO7ucCLQzgCqkhudF y8x+4Sd55CZSPS04U8/MZetP0J/uGr9gzp33ojHyNxVCLjJD X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240318_092814_145900_31809F4C X-CRM114-Status: GOOD ( 12.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org struct pwm_chip::dev is about to change. To not have to touch this driver in the same commit as struct pwm_chip::dev, use the accessor function provided for exactly this purpose. Signed-off-by: Uwe Kleine-König Acked-by: Guenter Roeck --- drivers/hwmon/aspeed-g6-pwm-tach.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/aspeed-g6-pwm-tach.c b/drivers/hwmon/aspeed-g6-pwm-tach.c index 597b3b019d49..64def5e4cdf6 100644 --- a/drivers/hwmon/aspeed-g6-pwm-tach.c +++ b/drivers/hwmon/aspeed-g6-pwm-tach.c @@ -195,7 +195,7 @@ static int aspeed_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, expect_period = div64_u64(ULLONG_MAX, (u64)priv->clk_rate); expect_period = min(expect_period, state->period); - dev_dbg(chip->dev, "expect period: %lldns, duty_cycle: %lldns", + dev_dbg(pwmchip_parent(chip), "expect period: %lldns, duty_cycle: %lldns", expect_period, state->duty_cycle); /* * Pick the smallest value for div_h so that div_l can be the biggest @@ -218,12 +218,12 @@ static int aspeed_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, if (div_l > 255) div_l = 255; - dev_dbg(chip->dev, "clk source: %ld div_h %lld, div_l : %lld\n", + dev_dbg(pwmchip_parent(chip), "clk source: %ld div_h %lld, div_l : %lld\n", priv->clk_rate, div_h, div_l); /* duty_pt = duty_cycle * (PERIOD + 1) / period */ duty_pt = div64_u64(state->duty_cycle * priv->clk_rate, (u64)NSEC_PER_SEC * (div_l + 1) << div_h); - dev_dbg(chip->dev, "duty_cycle = %lld, duty_pt = %d\n", + dev_dbg(pwmchip_parent(chip), "duty_cycle = %lld, duty_pt = %d\n", state->duty_cycle, duty_pt); /*