From patchwork Wed Feb 14 09:32:25 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: 13556199 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 0D157C48BEB for ; Wed, 14 Feb 2024 09:40:10 +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=LPuXAvBesnb5JgOrHkPepe0UnsIHwQd9LYeEfxtYim8=; b=dgBZ5fR6hsz2CK tGzyV2bdgq28jAJ3YGzRhf+oCeX0IdpPhBpLxc4eePb/roylMF+2LYNdJNo3LF3BTe/CbV9OaW1Hm pgGSo4zYQzQ2UzS8k2JDNPi3vjksrA1qRyTVBuQ6/MHF+C6mTyQgg7slqW+kl4Shsq+5rqUocAGCM e24AnZ038wWyE9eXPH5PjmMRfykNoX986XVR88s7DXqxHWLqgvSrm2JytaQEkX9i+SMdWGWBlGz7P 0SidTmTlJRbyf42Y6kFfDyzFoVW7tiTXKlBECgtlDx6i2SBF2/IJj6WEZkbeLaR8FDZbvR2JUkSX8 mFTT0xXES3S1Ljkx/Jaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBkC-0000000COBe-0p2U; Wed, 14 Feb 2024 09:39:56 +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 1raBfW-0000000CKuB-1Rwf for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Feb 2024 09:35:06 +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=vu/CdUWWt3zubDABkOMSf0aE1x4rrvpM/kXThvAy36w=; b=Gi8mqfz72do2JMcVA3vG1CeBt+ Ns2yeGqu0aHwxm/q3SFhFbS2B6Jcv6yF5en552XTLJ7pir40QJL9Jdos+WHrevsnYyIOmgu+k4Ln4 ojeUbHP+ZDV/K174yGn37/yljLv4elUbrzypWV3SVNOCZddqHsgK6FfFroyqbxvJ7u3WXw433j4hb M4cfk4cZNQJZvZGf0BkHuvq7jAPIKxQwqd/tRyNJ1zmJQXqfEUwxviIjUPsLOi8oh18nJUEtOyVdP /wRNL2/n2cYWUiwb3oWEIm/VCR61BT+b6bmyesO42Wo/KaABPBF3E1oPwZVJpnaSxba54sySgUad/ F/5ul3zA==; 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 1raBfD-0000000GAXC-2aVs for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 09:35:02 +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 1raBf2-0005Tq-QF; Wed, 14 Feb 2024 10:34:36 +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 1raBey-000fEo-UE; Wed, 14 Feb 2024 10:34:32 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1raBey-004Y6J-2l; Wed, 14 Feb 2024 10:34:32 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Krzysztof Kozlowski , linux-pwm@vger.kernel.org Cc: Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v6 098/164] pwm: samsung: Make use of pwmchip_parent() accessor Date: Wed, 14 Feb 2024 10:32:25 +0100 Message-ID: <421ee291a065aeae7a1552f22da4173313e789ad.1707900770.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=3488; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=dtj8pBhqbTvcBaJAEjUaKJM7LAj26UkY+/gbMpOgPPc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlzIi8dRtUNe0zYA+s0OHD5sj0QsHY4X9kSVwDe Uj6zO+Q6myJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZcyIvAAKCRCPgPtYfRL+ TsP5B/98DHYE2m1eQEfspjC38cwFhD/0cfp6nXL8UnHUglrlUDv2OcJB6R90d05IF1jL9A2gZZX G27m3+MIAMQbBE1D+eEdY+Qy8cXcJU+FgYFYQzddOBYTm44kOE9hfUBTHzYwBrhNMZiQ3AgNhyD cMKaZ9vb8mSmskMYCC9vcaJr+0/XuqV7yNjAtTLTZNib8JJlC57Jp2/tin12K+epNeCjTAjBrrQ wlR/tdZ+FKA4zWSTwWnflo48ogRgE4qj+FYqENuvkf6E+iiAgRgeYghTe2vVQoXK6mcdrPRzKhY zVVwowv0fzaXNJdhn/cmcgvr7EeiLFy6kbyp630rZ7md2ypF 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_093448_023960_26100DDB X-CRM114-Status: GOOD ( 13.18 ) 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 --- drivers/pwm/pwm-samsung.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/pwm/pwm-samsung.c b/drivers/pwm/pwm-samsung.c index ecd612adf19d..cabdcdf37ec9 100644 --- a/drivers/pwm/pwm-samsung.c +++ b/drivers/pwm/pwm-samsung.c @@ -198,12 +198,12 @@ static unsigned long pwm_samsung_calc_tin(struct pwm_chip *chip, return rate; } - dev_warn(chip->dev, + dev_warn(pwmchip_parent(chip), "tclk of PWM %d is inoperational, using tdiv\n", chan); } rate = pwm_samsung_get_tin_rate(our_chip, chan); - dev_dbg(chip->dev, "tin parent at %lu\n", rate); + dev_dbg(pwmchip_parent(chip), "tin parent at %lu\n", rate); /* * Compare minimum PWM frequency that can be achieved with possible @@ -233,7 +233,7 @@ static int pwm_samsung_request(struct pwm_chip *chip, struct pwm_device *pwm) struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip); if (!(our_chip->variant.output_mask & BIT(pwm->hwpwm))) { - dev_warn(chip->dev, + dev_warn(pwmchip_parent(chip), "tried to request PWM channel %d without output\n", pwm->hwpwm); return -EINVAL; @@ -327,12 +327,12 @@ static int __pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, period = NSEC_PER_SEC / period_ns; - dev_dbg(chip->dev, "duty_ns=%d, period_ns=%d (%u)\n", + dev_dbg(pwmchip_parent(chip), "duty_ns=%d, period_ns=%d (%u)\n", duty_ns, period_ns, period); tin_rate = pwm_samsung_calc_tin(chip, pwm->hwpwm, period); - dev_dbg(chip->dev, "tin_rate=%lu\n", tin_rate); + dev_dbg(pwmchip_parent(chip), "tin_rate=%lu\n", tin_rate); tin_ns = NSEC_PER_SEC / tin_rate; tcnt = period_ns / tin_ns; @@ -356,7 +356,7 @@ static int __pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, /* -1UL will give 100% duty. */ --tcmp; - dev_dbg(chip->dev, "tin_ns=%u, tcmp=%u/%u\n", tin_ns, tcmp, tcnt); + dev_dbg(pwmchip_parent(chip), "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 +368,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(chip->dev, "Forcing manual update"); + dev_dbg(pwmchip_parent(chip), "Forcing manual update"); pwm_samsung_manual_update(our_chip, pwm); } @@ -510,7 +510,7 @@ MODULE_DEVICE_TABLE(of, samsung_pwm_matches); static int pwm_samsung_parse_dt(struct pwm_chip *chip) { struct samsung_pwm_chip *our_chip = to_samsung_pwm_chip(chip); - struct device_node *np = chip->dev->of_node; + struct device_node *np = pwmchip_parent(chip)->of_node; const struct of_device_id *match; struct property *prop; const __be32 *cur; @@ -524,7 +524,7 @@ static int pwm_samsung_parse_dt(struct pwm_chip *chip) of_property_for_each_u32(np, "samsung,pwm-outputs", prop, cur, val) { if (val >= SAMSUNG_PWM_NUM) { - dev_err(chip->dev, + dev_err(pwmchip_parent(chip), "%s: invalid channel index in samsung,pwm-outputs property\n", __func__); continue;