From patchwork Thu Jan 25 12:08:38 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: 13530847 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 15FB5C47258 for ; Thu, 25 Jan 2024 13:51:26 +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=Oj3nSqKIpqSW4/zkTrgeO/FDJPDgWiVFeUl1jRKhD+U=; b=b7a/+ByyXJQwQQ WTuaFZEcomFq3DS2yopLBBUbr8wuzag+il2e89h9WT+FxdQJs+kuRHrd6VEEjd3o6/Q0MPayG5PZy iK9SBc86BSsnUAEDd6GSwyvSIBNdnhaaYFNn9/FvasgaF/4afMao7Yxy2g1ui3B3nGxv1Zsa7U229 JZFIpbfRTlXm9yxjdnAp9g49EUVY+ht/XnKfZQGCWUWIpnE23eiXhStBd3A4KHtR3c6uPaE046P5/ 0nXBPP4IxZz7wzfygi5y2XJG6QmxrA0hpm042sCto0RK6TvhT4PVOInh8E2zJt80m8+4xn9FG4Dwi GiWLGROEcBPoE7g0VeCg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT08P-000000008lU-2tS7; Thu, 25 Jan 2024 13:51:13 +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 1rT07w-000000008Om-0y3A for linux-arm-kernel@bombadil.infradead.org; Thu, 25 Jan 2024 13:50:44 +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=U+sEPW2mra/7BX1+22r/MmdJnegJKugNJVxG+ORUzvc=; b=KRoG7mj4H0h6zIVSTJk/r+f2PG N7mbP9TSfWPJZHvFnaRC6Okgvw+3uoVtUbbq/HTaN66hYxm9bj+3LUeno/7Jy/Khd54ck7bIgcsow wNa7bssU1yVjigGs7AQUAEuAYR5+LAu4AesvsM22IsU+hjeOBRrjAyNBa5PWBZHHsnXRcSWOtB1E2 ZHPzaTXhMqyQhYNYqdnI02p/t/Wb87/oXz4DqUf8m2k/UI8pAIbw2/a8CsEqWdCX8aQLSurOAZ1eF nfyWaxZTP0C7TpJJkWb0KsrnRb1PcT7XcyP9f/B1CxHbXJkio2bEQ2Es7xMwn7Ik+dSBXThXXmfst 69C7O3ew==; 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 1rSybQ-00000005Hfb-2MVd for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 12:13:07 +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 1rSyZ9-0003hx-Bz; Thu, 25 Jan 2024 13:10:43 +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 1rSyZ8-002HPh-Ut; Thu, 25 Jan 2024 13:10:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rSyZ8-007mzB-2p; Thu, 25 Jan 2024 13:10:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Vladimir Zapolskiy , linux-pwm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH v5 016/111] pwm: lpc18xx-sct: Make use of parent device pointer in driver data Date: Thu, 25 Jan 2024 13:08:38 +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=2273; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=9I6mp43V59KeZtkOb5brm+FGGJoThb3S6V+ToYzCpe4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlsk9MwAszs4qqG1xpjvFD+N8bFQMQi7skhk9rp 5kvuEUR4AWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZbJPTAAKCRCPgPtYfRL+ TkDNB/9JGdinssjbOnuol9/1nla9F1EV08P1WRntSHIOsxptv6q/CgAxVnmeloQ9Zw55QfPS+Is 9/m0SJT+nmPovW8v8r8DWmFGmg6YFhQS9GSPuiYm/ECqXfnTnUgb9OG0sWRxRaUhl8kpGwyeuFY CIMpYh7WqyPFctr/RSv2bvYEOhPzSfYzDyQRdGqmLsLo3eE/6mfdY1eGcGkaqwZvdwSiOfCt+bI Yokv1NndTg1UKs1KRydWorUmuzwt1HH9O8uhcgixdchT4kZ4J5HUn4sSuSK326I02Z4JERbJ0so yitgngTcL/n2KMx8bd/gr28GX+EOp4S67Uvdk8uEsiQ/jrlf 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-20240125_121304_711910_D78B560F X-CRM114-Status: GOOD ( 17.00 ) 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, make use of the already existing pointer to the parent device in driver data. However rename the pointer to "parent" for consistency with other drivers. Signed-off-by: Uwe Kleine-König --- drivers/pwm/pwm-lpc18xx-sct.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pwm/pwm-lpc18xx-sct.c b/drivers/pwm/pwm-lpc18xx-sct.c index fe891fa71a1d..1d2d342c05fd 100644 --- a/drivers/pwm/pwm-lpc18xx-sct.c +++ b/drivers/pwm/pwm-lpc18xx-sct.c @@ -92,7 +92,7 @@ struct lpc18xx_pwm_data { }; struct lpc18xx_pwm_chip { - struct device *dev; + struct device *parent; struct pwm_chip chip; void __iomem *base; struct clk *pwm_clk; @@ -198,7 +198,7 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, if (period_ns < lpc18xx_pwm->min_period_ns || period_ns > lpc18xx_pwm->max_period_ns) { - dev_err(chip->dev, "period %d not in range\n", period_ns); + dev_err(lpc18xx_pwm->parent, "period %d not in range\n", period_ns); return -ERANGE; } @@ -214,7 +214,7 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, */ if (requested_events > 2 && lpc18xx_pwm->period_ns != period_ns && lpc18xx_pwm->period_ns) { - dev_err(chip->dev, "conflicting period requested for PWM %u\n", + dev_err(lpc18xx_pwm->parent, "conflicting period requested for PWM %u\n", pwm->hwpwm); mutex_unlock(&lpc18xx_pwm->period_lock); return -EBUSY; @@ -289,7 +289,7 @@ static int lpc18xx_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) LPC18XX_PWM_EVENT_MAX); if (event >= LPC18XX_PWM_EVENT_MAX) { - dev_err(lpc18xx_pwm->dev, + dev_err(lpc18xx_pwm->parent, "maximum number of simultaneous channels reached\n"); return -EBUSY; } @@ -358,7 +358,7 @@ static int lpc18xx_pwm_probe(struct platform_device *pdev) if (!lpc18xx_pwm) return -ENOMEM; - lpc18xx_pwm->dev = &pdev->dev; + lpc18xx_pwm->parent = &pdev->dev; lpc18xx_pwm->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(lpc18xx_pwm->base))