Message ID | 4e8400a42979b6be0b80dff5ae964d8e9d6232eb.1707900770.git.u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 DDCAFC48BEB for <linux-arm-kernel@archiver.kernel.org>; Wed, 14 Feb 2024 09:42:09 +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=aav3D/F1sInz/MNqjBBHV4X4+cDRyPdExqdkkukiceU=; b=0PCj99jEJpyzOj TszEB7Es06wdL8Z5aAo7pXTvbwGjUy//3G8SzsmSyrOgHnMDiRyiEnYqrULWBnOzToMs5o41mH++q 8Nd9LMSgutiDatUT5ofn69O2iNgMLFNVjmHcv5c2X+h+B1865P1ygehShW8s8dzxyy4sabcrvuabX txskerGNWXfUyYoF4vpzGkabo4taLwVAa11dZbABn/WHmf9uZWvM/c4bREJ3tZFC16SjXNOPfVtQ1 Czj8ojkEiHb/YaI2L8HhL1RDZxonaDuT662qS436Al9lvFYxY84rzmByb3B/Lqrc+rszLAQmnwfd1 dkf1Ud3HBP1YU0elyT1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBm5-0000000CPff-4AfC; Wed, 14 Feb 2024 09:41:54 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfH-0000000CKcY-1A2c for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Feb 2024 09:34:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=77xukX4g0zdxjb5pL8QmqSiL6tj09dqFzgMrf1XV/y0=; b=SmqmHepD4ADNqVUslg+XB2GA3b AQLIEHcLEK5m6K4ovtpQpFq1ybHRP7MI4tBamoZj+cJQ9oUz+uXi0sJC9789uldSbNLo0PGx84D9i HZW3i2hZorDfFkoRmxY81vu6yUXvT9OX6SeeskR+0Z/E2U1q3WuGsPGlU/INhaZ7R06B3EoDL/Qqx bNhpq96lCqK+9BVPnMEuQJDs8zVJTsTkPU42tevsiizufp2CQxjd9mr5JXoExz+Q9mEMQp9C/5BsC wT05QeI+5FhDrEq8b2jNA4Al2N4Xj1E9nMc2TtMKBnful4dzTlHuEyr9nm1Xgu4/mt5Z5BLRTM/e8 xJtLVvGg==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfC-0000000GAX9-49aG for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 09:34:49 +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 <ukl@pengutronix.de>) id 1raBf1-0005RU-QD; Wed, 14 Feb 2024 10:34:35 +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 <ukl@pengutronix.de>) id 1raBey-000fEe-JU; Wed, 14 Feb 2024 10:34:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from <ukl@pengutronix.de>) id 1raBey-004Y6B-1g; Wed, 14 Feb 2024 10:34:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, linux-pwm@vger.kernel.org Cc: Alim Akhtar <alim.akhtar@samsung.com>, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v6 096/164] pwm: samsung: Simplify code to determine the pwmchip's parent device Date: Wed, 14 Feb 2024 10:32:23 +0100 Message-ID: <4e8400a42979b6be0b80dff5ae964d8e9d6232eb.1707900770.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1707900770.git.u.kleine-koenig@pengutronix.de> References: <cover.1707900770.git.u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1945; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=gI6fgHjRyxH3Qt9HapAhSqq3xRfx+GZ8KpfHRdKhT88=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlzIi5dffod7rgEsvr7NFa/8oDDNfXE0QdPB0pK AogvDV4MFqJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZcyIuQAKCRCPgPtYfRL+ TvmIB/9nfm11krcHO1WDkPaq7yn2sgHJkG66SC3mgGtRwWSzNdGf/Ks1qwm2m/TFR6YHBMwrdNt 4w0c6pE+eeDaavHQPPDhwdIqzBcnp/G0kpQ4DxH/Yz2Fv92OZ0fiooDBDo8/QJ6D9d5sm+yppQE S3E7lId+KqwiaGBfR6b0byZPO0POor/7YLack1khWjziXBuwIo2QUkEcOWGAaOdZ5ID0PlQD7LU VnsdFMh6cPm7Xvtt1MxXUyCRHds7jqHLAcug99K2kEEgII/iV718Zh1xTqvPO4z6vxXfpBqEZxn Xz3kis9kVqYIWMyMZqCorBhflwXaaehhP7zLzc+h9bbbQyDM 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-20240214_093447_507730_9993D9A0 X-CRM114-Status: GOOD ( 12.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
[v6,001/164] pwm: Provide an inline function to get the parent device of a given chip
|
expand
|
diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index 6e77302f7368..0f9a2a5e3ebc 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -326,12 +326,12 @@ static int __pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, period = NSEC_PER_SEC / period_ns; - dev_dbg(our_chip->chip.dev, "duty_ns=%d, period_ns=%d (%u)\n", + dev_dbg(chip->dev, "duty_ns=%d, period_ns=%d (%u)\n", duty_ns, period_ns, period); tin_rate = pwm_samsung_calc_tin(our_chip, pwm->hwpwm, period); - dev_dbg(our_chip->chip.dev, "tin_rate=%lu\n", tin_rate); + dev_dbg(chip->dev, "tin_rate=%lu\n", tin_rate); tin_ns = NSEC_PER_SEC / tin_rate; tcnt = period_ns / tin_ns; @@ -355,8 +355,7 @@ static int __pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, /* -1UL will give 100% duty. */ --tcmp; - dev_dbg(our_chip->chip.dev, - "tin_ns=%u, tcmp=%u/%u\n", tin_ns, tcmp, tcnt); + dev_dbg(chip->dev, "tin_ns=%u, tcmp=%u/%u\n", tin_ns, tcmp, tcnt); /* Update PWM registers. */ writel(tcnt, our_chip->base + REG_TCNTB(pwm->hwpwm)); @@ -368,7 +367,7 @@ static int __pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, * shortly afer this update (before it autoreloaded the new values). */ if (oldtcmp == (u32) -1) { - dev_dbg(our_chip->chip.dev, "Forcing manual update"); + dev_dbg(chip->dev, "Forcing manual update"); pwm_samsung_manual_update(our_chip, pwm); }
There is already a pointer to the pwmchip, make use of it directly instead of using the struct samsung_pwm_chip *our_chip just obtained from it. This also has the advantage of not using struct samsung_pwm_chip::chip any more which will be dropped soon. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-samsung.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)