Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3499429pxf; Mon, 22 Mar 2021 07:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygoEwnLnBNXkMMDOQEHsQYmcJMvHd+nhnXhkOS3qrH5OnSBZrSTX+FuNslYdpIGH1mPIG9 X-Received: by 2002:a17:907:9e6:: with SMTP id ce6mr102104ejc.207.1616424671967; Mon, 22 Mar 2021 07:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616424671; cv=none; d=google.com; s=arc-20160816; b=RywlmU54vDucjArs2ARvvGkDV0QVgifGp2uzCm82qmHaW/ZhLf6sroLgITRYnHl23H xC2cVsiwG2coEvEQdS91xXrHSxa37vbJruZ2tMaEs8Gu63mBNUfQy4wi8sLFYTsdGYE8 SG1UZtGAwczzp1Tmytn22nRtOCie5Vjit25GaFhZoIJCDOAGk+FkRrplhhju85ujSbMM X0BauNZA+H53eIp92UFOEJ1hbZ0sg9K7kkWRldtr78PGkln1EZqbx4s91DOjM2owzaV2 8ex6XnGQ1QWyM8AimUlkrO0CxexeMG2hkFbBShjB6iahYoFCZ8gce2KU04Wg+1OFr8iJ jQsg== 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=utZjdApAB+9QfhZjLqr3kKjjakYWb9c+vZBxiObmOh8=; b=Zh9rfN1XiWT3yVFQc0DSsmmyX4/gQQJe1MRJvIef+9A2XlEbU4UFtKMy/Qd+ztRm6V x5Az8vZ1MXGpusx5av2/IbZWe/kNQ92BdAEOOtLBUFYNEnbPr07qmLD+vu9+T6zQZLUU 9Oek0iRME8tnOdDEV66z1VLWwgfwUA0xugvzFoLO0RN5h8HEwS5HPLY3LMtwQ3cVntNi wPpsY+lADbSSeM2mxeSYFuR04ZwkJBUcXcwhpaHhFkT0iwlTdI6dKBwGtevqtH30XCQK 7qY6q0qGBP2+UjDqlq2k1LYJKk40TY5Gtu5f8VgioDcZXxbFxW+uH48uyKLFZs2D/xFP wsZw== 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 x14si11945532edd.207.2021.03.22.07.50.48; Mon, 22 Mar 2021 07:51:11 -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 S230477AbhCVOt4 (ORCPT + 99 others); Mon, 22 Mar 2021 10:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230310AbhCVOtB (ORCPT ); Mon, 22 Mar 2021 10:49:01 -0400 Received: from michel.telenet-ops.be (michel.telenet-ops.be [IPv6:2a02:1800:110:4::f00:18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C748CC061794 for ; Mon, 22 Mar 2021 07:48:55 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:250b:f16c:c5e2:505d]) by michel.telenet-ops.be with bizsmtp id jSot2400W2HDxaV06SotqG; Mon, 22 Mar 2021 15:48:53 +0100 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 1lOLrQ-009ZWD-Qt; Mon, 22 Mar 2021 15:48:52 +0100 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lOLrP-004T5q-HL; Mon, 22 Mar 2021 15:48:51 +0100 From: Geert Uytterhoeven To: Robin van der Gracht , Rob Herring , Miguel Ojeda , Paul Burton , Greg Kroah-Hartman Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 04/17] auxdisplay: img-ascii-lcd: Add helper variable dev Date: Mon, 22 Mar 2021 15:48:35 +0100 Message-Id: <20210322144848.1065067-5-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210322144848.1065067-1-geert@linux-m68k.org> References: <20210322144848.1065067-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 --- 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