From patchwork Wed Feb 14 09:33:13 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: 13556205 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 81AC6C48BEE for ; Wed, 14 Feb 2024 09:40:35 +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=xkTqiQ7iMOzwZs/pfYxe/BCch3SwzOMPns2Ub9c9KLo=; b=U3XkXx7MXGAEnm 7B09bIzoLbWqhZCmPTMcjejRdCe4Edx31k8IWQyBpPsObZkfWFwGjAW6KMsaj4O0BkXm7paLMXkME 1dZWE+YBbazJumsYNCf7A4WfCkgsqQPmlpabg97SOX4aJMTg/qujOzhBhmt/LPxhiPb2DAWt4zWft K0PAsumltpUplun7iUlCAQR8/v/gxOr8EbKcMvOlYP3xK1Tn8XCiqsrRCgEQEw1G5BpHiSn0+ufK+ sMnPLZR8BS85xXK+DLxlPKa/hHRLGlOy8S2rriASHs+nPAu4PGkvDTeBVFchjuCzZghJ8u8NxdI7B 2bxCfsIF7GbOXg98GxfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBkZ-0000000COTl-3BCG; Wed, 14 Feb 2024 09:40:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfb-0000000CKx3-124Z for linux-arm-kernel@bombadil.infradead.org; Wed, 14 Feb 2024 09:35:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=ZRi/2XwxOTc+wbKbepRKmWxtHYD6a4n7CbpV1Hxbvdc=; b=aiVuyGaIHcrPpEZBz6cmzAbJLx Gs7PQ7e9OxmpeLXWT7nKm2y+zQjHZf2U87RgwiMzyvk6So+1sUFvRNYEfR8iFBBcpLAfnJeOVS+t+ yQY6CSagVyae4EzknPyTPuqW2SUF80NRrV/1qcAnb1K4Z/ap5LQlpKCFTEH2nD6YIyOTPdY6IOF3f 9VixiGCgrGla7T5OCZ3bfMdEBzpw2T7Dn2DZPLa4nQR+uSccSQgplSVvQlBwezBtBVB3Rw0K3vmjp 6QqFRIj42YwtcPnhklI05smH143BoSq5gSS3fHceEXTeVZifcwmzctHOH7Me9X+lRjemKYYip/mJL /RhjxvJQ==; Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by casper.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1raBfS-0000000GDl9-3dKt for linux-arm-kernel@lists.infradead.org; Wed, 14 Feb 2024 09:35:10 +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 1raBf9-00069W-8y; Wed, 14 Feb 2024 10:34: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 1raBf6-000fHp-8C; Wed, 14 Feb 2024 10:34:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1raBf6-004Y9j-0Z; Wed, 14 Feb 2024 10:34:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: linux-pwm@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH v6 146/164] pwm: vt8500: Introduce a local pwm_chip variable in .probe() Date: Wed, 14 Feb 2024 10:33:13 +0100 Message-ID: <7d903b608609d46cf1ee1e06530f516f42af1ebb.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=1522; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=j+ll1jcK/Tz1Xx6dt5wVgay2IUKDTlBkIX93unWwzRs=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlzIjyE2JyHtqSobupAVUTnyaXx+U7SK81qJd0L aylHFyMJ4iJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZcyI8gAKCRCPgPtYfRL+ TrTXCACKWdn+1TnbAzOS8B1SxWUnr0+CXxBrP3i56jQI3PdDuJWiigcFFng5yVkSlk61wZU+8AV aUHuWn2G80bz6dNDtjAELl+xwTPYfFcP/rpa0mkwL7C/6ny3vx411jVYJlXGPWX1i8fvpG26e8Z kwDRyJBkmzl2krZe5f1i5XRkhWrdLsx3UErxffVQ3avO0csNS5xYBS9SqGfmSu7o0fgQvj1CCC2 qFqmZyeJIHXuSEBvyfKxfs9sl8epBsB/Nm9CUcFcEXQ9S+j5CroCf9gGMwisljo7HAMkFZ4YNUU ibFOlvl3zfz1B15V4316wpfttWrQlkaw93/K7nDpBhIFLui9 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_093504_382043_3856215A X-CRM114-Status: GOOD ( 11.46 ) 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 This simplifies converting the driver to pwmchip_alloc() as there is only a single code line left that makes use of struct vt8500_chip::chip. Signed-off-by: Uwe Kleine-König --- drivers/pwm/pwm-vt8500.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-vt8500.c b/drivers/pwm/pwm-vt8500.c index 3646bd45b101..6da9b8f88afc 100644 --- a/drivers/pwm/pwm-vt8500.c +++ b/drivers/pwm/pwm-vt8500.c @@ -232,6 +232,7 @@ MODULE_DEVICE_TABLE(of, vt8500_pwm_dt_ids); static int vt8500_pwm_probe(struct platform_device *pdev) { + struct pwm_chip *chip; struct vt8500_chip *vt8500; struct device_node *np = pdev->dev.of_node; int ret; @@ -243,9 +244,10 @@ static int vt8500_pwm_probe(struct platform_device *pdev) if (vt8500 == NULL) return -ENOMEM; - vt8500->chip.dev = &pdev->dev; - vt8500->chip.ops = &vt8500_pwm_ops; - vt8500->chip.npwm = VT8500_NR_PWMS; + chip = &vt8500->chip; + chip->dev = &pdev->dev; + chip->ops = &vt8500_pwm_ops; + chip->npwm = VT8500_NR_PWMS; vt8500->clk = devm_clk_get_prepared(&pdev->dev, NULL); if (IS_ERR(vt8500->clk)) @@ -255,7 +257,7 @@ static int vt8500_pwm_probe(struct platform_device *pdev) if (IS_ERR(vt8500->base)) return PTR_ERR(vt8500->base); - ret = devm_pwmchip_add(&pdev->dev, &vt8500->chip); + ret = devm_pwmchip_add(&pdev->dev, chip); if (ret < 0) return dev_err_probe(&pdev->dev, ret, "failed to add PWM chip\n");