From patchwork Tue Sep 14 14:38:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 512461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B03AC433FE for ; Tue, 14 Sep 2021 14:38:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4B227610D1 for ; Tue, 14 Sep 2021 14:38:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234018AbhINOkD (ORCPT ); Tue, 14 Sep 2021 10:40:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233876AbhINOkB (ORCPT ); Tue, 14 Sep 2021 10:40:01 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D91D1C061762 for ; Tue, 14 Sep 2021 07:38:43 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:d46f:7eb5:4a37:9d14]) by andre.telenet-ops.be with bizsmtp id tqef2500P2aSKa101qef69; Tue, 14 Sep 2021 16:38:41 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mQ9a2-004VGg-TQ; Tue, 14 Sep 2021 16:38:38 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1mQ9a2-0028yG-HL; Tue, 14 Sep 2021 16:38:38 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Miguel Ojeda , Rob Herring , Paul Burton Cc: Greg Kroah-Hartman , Pavel Machek , Marek Behun , devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 04/19] auxdisplay: img-ascii-lcd: Add helper variable dev Date: Tue, 14 Sep 2021 16:38:20 +0200 Message-Id: <20210914143835.511051-5-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210914143835.511051-1-geert@linux-m68k.org> References: <20210914143835.511051-1-geert@linux-m68k.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org img_ascii_lcd_probe() has many users of "pdev->dev". Add a shorthand to simplify the code. Signed-off-by: Geert Uytterhoeven --- v6: - No changes, v5: - No changes, v4: - No changes, v3: - No changes, v2: - No changes. --- drivers/auxdisplay/img-ascii-lcd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/auxdisplay/img-ascii-lcd.c b/drivers/auxdisplay/img-ascii-lcd.c index e33ce0151cdfd150..2b6e41ec57544faa 100644 --- a/drivers/auxdisplay/img-ascii-lcd.c +++ b/drivers/auxdisplay/img-ascii-lcd.c @@ -365,26 +365,25 @@ static int img_ascii_lcd_probe(struct platform_device *pdev) { const struct of_device_id *match; const struct img_ascii_lcd_config *cfg; + struct device *dev = &pdev->dev; struct img_ascii_lcd_ctx *ctx; int err; - match = of_match_device(img_ascii_lcd_matches, &pdev->dev); + match = of_match_device(img_ascii_lcd_matches, dev); if (!match) return -ENODEV; cfg = match->data; - ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx) + cfg->num_chars, - GFP_KERNEL); + ctx = devm_kzalloc(dev, sizeof(*ctx) + cfg->num_chars, GFP_KERNEL); if (!ctx) return -ENOMEM; if (cfg->external_regmap) { - ctx->regmap = syscon_node_to_regmap(pdev->dev.parent->of_node); + ctx->regmap = syscon_node_to_regmap(dev->parent->of_node); if (IS_ERR(ctx->regmap)) return PTR_ERR(ctx->regmap); - if (of_property_read_u32(pdev->dev.of_node, "offset", - &ctx->offset)) + if (of_property_read_u32(dev->of_node, "offset", &ctx->offset)) return -EINVAL; } else { ctx->base = devm_platform_ioremap_resource(pdev, 0); @@ -408,7 +407,7 @@ static int img_ascii_lcd_probe(struct platform_device *pdev) if (err) goto out_del_timer; - err = device_create_file(&pdev->dev, &dev_attr_message); + err = device_create_file(dev, &dev_attr_message); if (err) goto out_del_timer;