From patchwork Wed Feb 14 09:30:56 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: 13556136 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 4AA32C48BEB for ; Wed, 14 Feb 2024 09:34:47 +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=H9zS/7b07Ze6RbQMKUfS69zVi3Ah1296OwmDxTYyQ00=; b=fZ2EnWTKhp67HY fHtXhhsjZ98k4DdtkjylVRPvCRzZxOECp2LvEaxJOryuI2p+GPYoDi5Fu95c0aP7GWVzu7/g3tdUM jp2eXlmx2wlfytsT1gIH1dxwd7WhEindoADU4gmg1r2RhIiSTWzpmqvFfOA5vaalvGpq/FMdjWZnK r9Xvq2ux4tBf08pgxdYsqYTNHn65AlSG+EWgZmZ3QW5FWT2E7mGxKwz2cV2AanwucZqsmKIiM/SKB 3mAeLE7wKYdSFvJSflf7ylDHdWBd3s0uK1V+jf9Hw979euOD7/6VoIn9M7k7QCqKHlJ+C3xHZh7O7 w+Ok5jaoIj38EwdQGvhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBex-0000000CKFs-2FXv; Wed, 14 Feb 2024 09:34:31 +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 1raBet-0000000CK8o-3I2s for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 09:34:29 +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 1raBel-0004On-J5; Wed, 14 Feb 2024 10:34:19 +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 1raBel-000f7C-64; Wed, 14 Feb 2024 10:34:19 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1raBel-004Y0F-0L; Wed, 14 Feb 2024 10:34:19 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Claudiu Beznea , Nicolas Ferre , Alexandre Belloni , linux-pwm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH v6 009/164] pwm: atmel: Make use of pwmchip_parent() accessor Date: Wed, 14 Feb 2024 10:30:56 +0100 Message-ID: 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=1856; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=23C0zswHFbohCvcAG64YSEJS8Mf75jYiZ0e59VSUXJs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlzIhV/W2P+HdgVcZyMYogjnFY0gx1xBm8GEPrC gxgZWUsezaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZcyIVQAKCRCPgPtYfRL+ TnNACACPKROLmSTvBrx/ljyGq2XQpSZvl+A2g+nTl4ucQqryKvHGMNd0e0wmUtUxMI5qGrmP/MH IfpSzly1LPlgOJXoicaTHZfOxXOw+B5Mi2JditW1pe1gXIQODI9zGjKESHzgyzyQ1av2Z0nGI9L vOQ09WYVTt5BWTpGDaY/TRM+AXg5u647fp/Df7aM5644tXWzih7S/2dwHFp2rju9cCDWHNFP2yt v6V/864IVbRG327vnxkGeUPprbg1tmASowLs9vU9wgP/EAvI7c9sY9V8EmaELEQWYOpZ/Zz9c45 pYHpudXs95L8SiN4mvga7Ap58ot+0vlrZ8LJS0rFWwNQEGZd 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_013427_930627_505E7858 X-CRM114-Status: GOOD ( 14.58 ) 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-atmel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c index 2f7d6c43be85..96e1676a5c51 100644 --- a/drivers/pwm/pwm-atmel.c +++ b/drivers/pwm/pwm-atmel.c @@ -210,7 +210,7 @@ static int atmel_pwm_calculate_cprd_and_pres(struct pwm_chip *chip, shift = fls(cycles) - atmel_pwm->data->cfg.period_bits; if (shift > PWM_MAX_PRES) { - dev_err(chip->dev, "pres exceeds the maximum value\n"); + dev_err(pwmchip_parent(chip), "pres exceeds the maximum value\n"); return -EINVAL; } else if (shift > 0) { *pres = shift; @@ -321,7 +321,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ret = atmel_pwm_calculate_cprd_and_pres(chip, clkrate, state, &cprd, &pres); if (ret) { - dev_err(chip->dev, + dev_err(pwmchip_parent(chip), "failed to calculate cprd and prescaler\n"); return ret; } @@ -333,7 +333,7 @@ static int atmel_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, } else { ret = clk_enable(atmel_pwm->clk); if (ret) { - dev_err(chip->dev, "failed to enable clock\n"); + dev_err(pwmchip_parent(chip), "failed to enable clock\n"); return ret; } } @@ -481,7 +481,7 @@ static int atmel_pwm_enable_clk_if_on(struct pwm_chip *chip, bool on) for (i = 0; i < cnt; i++) { ret = clk_enable(atmel_pwm->clk); if (ret) { - dev_err(chip->dev, + dev_err(pwmchip_parent(chip), "failed to enable clock for pwm %pe\n", ERR_PTR(ret));