From patchwork Tue Jul 9 09:22:21 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: 13727531 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 45118C3DA41 for ; Tue, 9 Jul 2024 09:23:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version: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:In-Reply-To:References:List-Owner; bh=q+y4LCDnAAXXuarGv2yzEkakVU0kvPuo5/Bgu5L7r/I=; b=qdekLHFBd2OlTTXJfY9Np+uOFG IWlvdmbTrD3qlgaR2a5Ov+9QCjLE3QEITWmtzM/uM4UDn8wmiZnlhwG5akS4fvDWKdIByGr4ke/uF /A8Rak/hk52ncbbhgAYTANCq19B4yiDPABUA1u/degSw8zQHMCtoE0abi6M3NBwQFl+hJR7Q6UjC5 Yl4FiDXu6nTinO2Z4CvAyrTLWiRfayoJsTBVNXIryYDkOKQBYy7We+pNLlOAlndonZLDWERh+8vpw hOx+QDiMBgMd2wxdmEJpUCk3R6Okt9rEfr+UjQwwPOa2aaAVbDg7cnqO9Zy5V/10cNtTvk/hCUv8F t+oPYY4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR73f-00000006aTJ-0uUU; Tue, 09 Jul 2024 09:22:47 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sR73P-00000006aQz-3Dv3 for linux-arm-kernel@lists.infradead.org; Tue, 09 Jul 2024 09:22:33 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4266fd395eeso5606795e9.3 for ; Tue, 09 Jul 2024 02:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1720516950; x=1721121750; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=q+y4LCDnAAXXuarGv2yzEkakVU0kvPuo5/Bgu5L7r/I=; b=UbNCrMuxa1a4SysAC5WzbkhzXygAFdDnrbUYv2kgnZ5dCFzgHrlo6UHI15qp1r98Sv EGc/Yg6Wshf5gt9sK/V30UzjqlD0i7Oxxf9OwMcAaSVX2ZaLoFj7MpsKXea/ksHuZKod Ezx+vbNksGs7bnaz980pcHQtKJmhppG0LFTuhM5uL4aoVfsMMnsJmTryOc106P+5ntXl TwiztOQSHNLhRNveIouTmdpHrkhgFrBbX+IwVt6nU9hT+MNih/dxw29ujasurOB2odKE pdxbJ+tdmjEZlV5QXZDD2frRMlsFPUxsTEpEkfkC292qL0oZWqe0iOHbnop/VsWZipYJ QQSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720516950; x=1721121750; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q+y4LCDnAAXXuarGv2yzEkakVU0kvPuo5/Bgu5L7r/I=; b=Ysb6vvX7EkucOYTneHOMCXUfRT62tewFTCTG4EEtiICfmJqhMVk1axV5fBTkoA58WW cSIIWqh4kFNx1TNqYncFC0KLaPRPjfVz3CNvEoIsr4boYwh+PTeX68EjvaypF7QH+TVt JsaFmZDgojz5XMFPySBjboXo/tWmtMYPbpL0HMf0OlKJgc9ethzI4BvkqAJEbnUeoW6n FwXO4Cxq4jSGNr8pvo1c567tyYbxkn8VynuoznsXOy3mrdfUsrbDJPbqjK1QRrWhXvTo IdB+MEbqDCnGbmnSgSSA4r9vIyDHzXpgXQwg7mc4iiBZq8+cOp+iKKp6Ls2LNJyjz8KQ KDVA== X-Forwarded-Encrypted: i=1; AJvYcCVFX1fIud+nl8SCuZyp0rHi0PWi5zXEMABARfS53cHe5sF/i0qGkssX13e+K+GeMcU6w/sC7egaKLrnNTNYjWN5dGZNRyPFgI5MIbpzjlb7B4OwllQ= X-Gm-Message-State: AOJu0YwR642BRVBpwuuCFDlrnpALClMRxKEVoXChYFXJvxTHiYwvNZCw mtYhDyHvXilHVKsbzB+oq1G5z4zj3BYE3lOPRKXy6wlcvUAARb4vY4qIA3KwixQ= X-Google-Smtp-Source: AGHT+IG1fAt3JlWpReh32TqukLAKUyyiz5kCUoY3HPT/7TJNqa4Kz+jjTnH3sGV6GaHJCRuFMNzZzQ== X-Received: by 2002:a05:600c:4c8a:b0:426:6e93:4ad0 with SMTP id 5b1f17b1804b1-426707d7977mr13571995e9.17.1720516950204; Tue, 09 Jul 2024 02:22:30 -0700 (PDT) Received: from localhost (p50915e7b.dip0.t-ipconnect.de. [80.145.94.123]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4266f741624sm30874925e9.41.2024.07.09.02.22.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 02:22:29 -0700 (PDT) From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] pwm: atmel-tcb: Make private data variable naming consistent Date: Tue, 9 Jul 2024 11:22:21 +0200 Message-ID: <20240709092221.47025-2-u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6801; i=u.kleine-koenig@baylibre.com; h=from:subject; bh=L2ZslCkLR4UmS9dhyIDHvU1zQNZV4oQqupGRYQ7izc8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBmjQFNEmkm/PgmWgid0vUUok45iyvqxR5jzCsYL esRLilZTAOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZo0BTQAKCRCPgPtYfRL+ Tt8ECACjXyOITuoAE3Cchf8s+2WdkUPZPFIvTdI33TKBrcuJlw46ELxn8n5+0tllQIAv1YQay47 MtdYXYlAntMoPj3Gg1pbQM4K1YmBXmhoUnLg/CwpCmqyEatT4nC7+W5g9xr1qhiivLSZV2BgEwv KmYl2XpDtIrarZygIHTpyWtKQhpbGSDF1YlvqEQags3hRM00XUwIWMu6KBLDvA64n1xcNXu6INI LSf+PEey6tEDfmdPe/8hk6Em1YKeJr/M77AFZOHec5qAFBXl1TnW3100EKj6AIVvoFxUw9DHeiC WmJV89+jpEKRInyD9clkrvzIsSJbtwP8zkOvhYYuqjzYN8LL X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240709_022231_833506_AB8E8717 X-CRM114-Status: GOOD ( 15.97 ) 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 Currently the variables of type struct atmel_tcb_pwm_device are named "tcbpwm", and variables of type atmel_tcb_pwm_chip are either named "tcbpwm" (too!) or "tcbpwmc". Rename the chips with device name to "tcbpwmc" to get a consistent naming. Signed-off-by: Uwe Kleine-König Acked-by: Nicolas Ferre --- drivers/pwm/pwm-atmel-tcb.c | 90 ++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 45 deletions(-) base-commit: 120a528213b6693214e3cbc24a9c3052a4b1024b diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index 528e54c5999d..9470811e195c 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -389,17 +389,17 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) { struct pwm_chip *chip; const struct of_device_id *match; - struct atmel_tcb_pwm_chip *tcbpwm; + struct atmel_tcb_pwm_chip *tcbpwmc; const struct atmel_tcb_config *config; struct device_node *np = pdev->dev.of_node; char clk_name[] = "t0_clk"; int err; int channel; - chip = devm_pwmchip_alloc(&pdev->dev, NPWM, sizeof(*tcbpwm)); + chip = devm_pwmchip_alloc(&pdev->dev, NPWM, sizeof(*tcbpwmc)); if (IS_ERR(chip)) return PTR_ERR(chip); - tcbpwm = to_tcb_chip(chip); + tcbpwmc = to_tcb_chip(chip); err = of_property_read_u32(np, "reg", &channel); if (err < 0) { @@ -409,20 +409,20 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) return err; } - tcbpwm->regmap = syscon_node_to_regmap(np->parent); - if (IS_ERR(tcbpwm->regmap)) - return PTR_ERR(tcbpwm->regmap); + tcbpwmc->regmap = syscon_node_to_regmap(np->parent); + if (IS_ERR(tcbpwmc->regmap)) + return PTR_ERR(tcbpwmc->regmap); - tcbpwm->slow_clk = of_clk_get_by_name(np->parent, "slow_clk"); - if (IS_ERR(tcbpwm->slow_clk)) - return PTR_ERR(tcbpwm->slow_clk); + tcbpwmc->slow_clk = of_clk_get_by_name(np->parent, "slow_clk"); + if (IS_ERR(tcbpwmc->slow_clk)) + return PTR_ERR(tcbpwmc->slow_clk); clk_name[1] += channel; - tcbpwm->clk = of_clk_get_by_name(np->parent, clk_name); - if (IS_ERR(tcbpwm->clk)) - tcbpwm->clk = of_clk_get_by_name(np->parent, "t0_clk"); - if (IS_ERR(tcbpwm->clk)) { - err = PTR_ERR(tcbpwm->clk); + tcbpwmc->clk = of_clk_get_by_name(np->parent, clk_name); + if (IS_ERR(tcbpwmc->clk)) + tcbpwmc->clk = of_clk_get_by_name(np->parent, "t0_clk"); + if (IS_ERR(tcbpwmc->clk)) { + err = PTR_ERR(tcbpwmc->clk); goto err_slow_clk; } @@ -430,22 +430,22 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) config = match->data; if (config->has_gclk) { - tcbpwm->gclk = of_clk_get_by_name(np->parent, "gclk"); - if (IS_ERR(tcbpwm->gclk)) { - err = PTR_ERR(tcbpwm->gclk); + tcbpwmc->gclk = of_clk_get_by_name(np->parent, "gclk"); + if (IS_ERR(tcbpwmc->gclk)) { + err = PTR_ERR(tcbpwmc->gclk); goto err_clk; } } chip->ops = &atmel_tcb_pwm_ops; - tcbpwm->channel = channel; - tcbpwm->width = config->counter_width; + tcbpwmc->channel = channel; + tcbpwmc->width = config->counter_width; - err = clk_prepare_enable(tcbpwm->slow_clk); + err = clk_prepare_enable(tcbpwmc->slow_clk); if (err) goto err_gclk; - spin_lock_init(&tcbpwm->lock); + spin_lock_init(&tcbpwmc->lock); err = pwmchip_add(chip); if (err < 0) @@ -456,16 +456,16 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) return 0; err_disable_clk: - clk_disable_unprepare(tcbpwm->slow_clk); + clk_disable_unprepare(tcbpwmc->slow_clk); err_gclk: - clk_put(tcbpwm->gclk); + clk_put(tcbpwmc->gclk); err_clk: - clk_put(tcbpwm->clk); + clk_put(tcbpwmc->clk); err_slow_clk: - clk_put(tcbpwm->slow_clk); + clk_put(tcbpwmc->slow_clk); return err; } @@ -473,14 +473,14 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev) static void atmel_tcb_pwm_remove(struct platform_device *pdev) { struct pwm_chip *chip = platform_get_drvdata(pdev); - struct atmel_tcb_pwm_chip *tcbpwm = to_tcb_chip(chip); + struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip); pwmchip_remove(chip); - clk_disable_unprepare(tcbpwm->slow_clk); - clk_put(tcbpwm->gclk); - clk_put(tcbpwm->clk); - clk_put(tcbpwm->slow_clk); + clk_disable_unprepare(tcbpwmc->slow_clk); + clk_put(tcbpwmc->gclk); + clk_put(tcbpwmc->clk); + clk_put(tcbpwmc->slow_clk); } static const struct of_device_id atmel_tcb_pwm_dt_ids[] = { @@ -492,14 +492,14 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids); static int atmel_tcb_pwm_suspend(struct device *dev) { struct pwm_chip *chip = dev_get_drvdata(dev); - struct atmel_tcb_pwm_chip *tcbpwm = to_tcb_chip(chip); - struct atmel_tcb_channel *chan = &tcbpwm->bkup; - unsigned int channel = tcbpwm->channel; + struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip); + struct atmel_tcb_channel *chan = &tcbpwmc->bkup; + unsigned int channel = tcbpwmc->channel; - regmap_read(tcbpwm->regmap, ATMEL_TC_REG(channel, CMR), &chan->cmr); - regmap_read(tcbpwm->regmap, ATMEL_TC_REG(channel, RA), &chan->ra); - regmap_read(tcbpwm->regmap, ATMEL_TC_REG(channel, RB), &chan->rb); - regmap_read(tcbpwm->regmap, ATMEL_TC_REG(channel, RC), &chan->rc); + regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(channel, CMR), &chan->cmr); + regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(channel, RA), &chan->ra); + regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(channel, RB), &chan->rb); + regmap_read(tcbpwmc->regmap, ATMEL_TC_REG(channel, RC), &chan->rc); return 0; } @@ -507,17 +507,17 @@ static int atmel_tcb_pwm_suspend(struct device *dev) static int atmel_tcb_pwm_resume(struct device *dev) { struct pwm_chip *chip = dev_get_drvdata(dev); - struct atmel_tcb_pwm_chip *tcbpwm = to_tcb_chip(chip); - struct atmel_tcb_channel *chan = &tcbpwm->bkup; - unsigned int channel = tcbpwm->channel; + struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip); + struct atmel_tcb_channel *chan = &tcbpwmc->bkup; + unsigned int channel = tcbpwmc->channel; - regmap_write(tcbpwm->regmap, ATMEL_TC_REG(channel, CMR), chan->cmr); - regmap_write(tcbpwm->regmap, ATMEL_TC_REG(channel, RA), chan->ra); - regmap_write(tcbpwm->regmap, ATMEL_TC_REG(channel, RB), chan->rb); - regmap_write(tcbpwm->regmap, ATMEL_TC_REG(channel, RC), chan->rc); + regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(channel, CMR), chan->cmr); + regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(channel, RA), chan->ra); + regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(channel, RB), chan->rb); + regmap_write(tcbpwmc->regmap, ATMEL_TC_REG(channel, RC), chan->rc); if (chan->enabled) - regmap_write(tcbpwm->regmap, + regmap_write(tcbpwmc->regmap, ATMEL_TC_CLKEN | ATMEL_TC_SWTRG, ATMEL_TC_REG(channel, CCR));