Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1119223pxv; Fri, 25 Jun 2021 06:01:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxns10hy8TS34bJZ4uzE3pkmWMC7dcQJrbyBJ4/31bBR3cMC8oXAUs/OzGPx9G8RKwk/Vz9 X-Received: by 2002:a17:906:4b15:: with SMTP id y21mr10653076eju.261.1624626080809; Fri, 25 Jun 2021 06:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624626080; cv=none; d=google.com; s=arc-20160816; b=VG+9d/XtZ7aYPW53lbzLamTuUVL5wLUrVxtue8KeKny71POGlOaXCC8+rpCKWQqaR1 PWUI2k3bmI2m4SE/FUqYfnFSXStFuO53kRMudA5TZx0Cy2fM+wA90HLzmV7OuD33ZQhZ 6435fhzTaIs6mPIYlYnkuR20DbA0aYet+KxIyoBv9YkmqMxRjeualGO2L2Nupw8QCGyU 4K7M3qSlM5dY2HENPWJfef0rl7wOll8xeibwuJpPi/jg6ZNkUKHo702oi6/mpNhcxY7/ MnXeKLO99RDhAX2DszcngPKM+hIRvxfzAD4bj6nUn3uX7MJS5U6cLHuBe9xixYMrpgdw FjSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=F5X/0D8rXwB7G+v1XcFK8+yr+HbUGorskJycroaRdjk=; b=BnK8rFcYfyuvPACAQ7QZCdDrkGtIKQhYnCyio3yvAF4z3BCxijjH8ADTxi+NHe8ttv WrUq/v+vBlEqRDUzhdKSF5d67aX2DiQxgQ+AZho1r4R22Nh+Id8E2ZhJvvqBqqSUK847 WLmXGzGQHW71Zj1AKlPTDDrWix0LYD3DByHKeM9G29rhRc90oIIKupDQHC3TLQN/OkUc JKKf2oGphTfVoOVvlpAuntciQ+Cstywd0TnMmL8pHLlJw1i9149FVNqHGDD/Xn6y33s1 GMgGtpiOHxlivoUY1P8kZFNIDrmWW/sO3d4qk3YC6HkxmYj19iJ4lzV3JorEbAGCvhn2 UifQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si6136013edh.196.2021.06.25.06.00.55; Fri, 25 Jun 2021 06:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231880AbhFYNCG (ORCPT + 99 others); Fri, 25 Jun 2021 09:02:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231669AbhFYNBl (ORCPT ); Fri, 25 Jun 2021 09:01:41 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4BF2C0611BC for ; Fri, 25 Jun 2021 05:59:17 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:1476:ce84:e216:add8]) by baptiste.telenet-ops.be with bizsmtp id MQzC2500H2B1U9901QzC7N; Fri, 25 Jun 2021 14:59:13 +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 1lwlQO-003TMD-3z; Fri, 25 Jun 2021 14:59:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lwlQN-004sQL-HO; Fri, 25 Jun 2021 14:59:11 +0200 From: Geert Uytterhoeven To: Robin van der Gracht , Rob Herring , Miguel Ojeda , Paul Burton , Greg Kroah-Hartman , Pavel Machek Cc: devicetree@vger.kernel.org, linux-leds@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 04/18] auxdisplay: img-ascii-lcd: Add helper variable dev Date: Fri, 25 Jun 2021 14:58:48 +0200 Message-Id: <20210625125902.1162428-5-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210625125902.1162428-1-geert@linux-m68k.org> References: <20210625125902.1162428-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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; -- 2.25.1