Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3792339ybp; Sun, 6 Oct 2019 20:33:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwz6o/CtAFPV3Bu5Lm0EqzPiOHluGZf1keBFVpyWbrJ6omXRSvqLYrKBB/52uF7glOQk90g X-Received: by 2002:a17:906:d0d2:: with SMTP id bq18mr21712156ejb.233.1570419234366; Sun, 06 Oct 2019 20:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570419234; cv=none; d=google.com; s=arc-20160816; b=hMg9150vMHOM7xYP3lRhP5Z0c7CHKpTyJ03qYyYNhwv05Bz/GxxbljYq+cMpuru5JA 8mAaA1qrgNI8S8QCqmr4150Exej984RUCMl0T8aJWiJ7SSZGaQE5rPrxr+PS529zSmfg AmwYg1GmI1J8UE0s31TNq1r5TpggAG4l0pBZgDW7u/J9aNpKFRwI9JEZy3ylg+J8x55v QjzSe42Dmjzi5h3cyQVrD+yDBSu1JNXbEWRcts6xFO0eSIsvugQeZ3KN/cpelEaKArAF 9ySVp9LN3db1kBB5J8FT+ni3HEwzTylrqrLiRRICXg3CWJ+Pr/f6cKIXFp8oTyVTlzNP xkIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3BPysl6DVnolWKLxLF4VbdfeZy6f97Qv6aum3TgQhxM=; b=vj4Gt5LV2PrgERx5fryXbJD/v5aZBtEBf4EbHzLZLN10EsN+8ZXezT9xK8hZEE1GST pAkJYmWBZQGJhW/j5RDDAwomSuFqUtE1J/Ji7uRzRnXxA6T3GMPbgwQH4QxbkND3xIPp 2EJt74qk/9L521ZhlZQkTzgz9iZg1Wn+jGv5s3tzkjJKRdVpxubcgBiCmIvu33+XBwgJ xcdUsZeogwl/AuKFdafZiTHoBdUfV/AYXhQw3J0xjO2jkQ4azylH+KRKF17KwF7ToOmz OZjxOda9YZCwnTFmkYvaTg1DRm9/iKAzVmIoanX3AlFyZ3swxwPx2Vd8GBghMteeScZM p9/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=y+TYcOku; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i40si7912210eda.225.2019.10.06.20.33.29; Sun, 06 Oct 2019 20:33:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=y+TYcOku; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727295AbfJGDcZ (ORCPT + 99 others); Sun, 6 Oct 2019 23:32:25 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44456 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727212AbfJGDcL (ORCPT ); Sun, 6 Oct 2019 23:32:11 -0400 Received: by mail-pl1-f193.google.com with SMTP id q15so6172028pll.11 for ; Sun, 06 Oct 2019 20:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3BPysl6DVnolWKLxLF4VbdfeZy6f97Qv6aum3TgQhxM=; b=y+TYcOkuUhELANoszr4a3gmhyWWSDY+vzJu611GB87ScAdJ/pXChF4r0b/+6blLSGl BUcsrkNzV5otX3RewLR8/ISN1NQj6hvS2qEGuRtZukxoSVQY5mMHJBf9orIetMkyogEe mziAl7VWTOgcKRKmfHh+xtHXVdOiyEJkpYvwM31fawB2JvgQdoelG3fpb4T18TIuWxo8 e0cvbKmSdZUhbAv2AbFvrMM++vdtHF9jEsAcLrXuH1hNQiYLN26eOfdAlJjlvvu/PJzc spy3UaKYw41JS/hoOWHPUFQWEeR50Y+YGG6IYla/Scg+AlsPJGD/7g5fXT5QMOwBE7tC P6iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3BPysl6DVnolWKLxLF4VbdfeZy6f97Qv6aum3TgQhxM=; b=rh3/OLdmSvjAdlh5xl53Wl0nMtj/zzWPzWQkZcigoD2CjBtA4hAeWEXsBUoMqXXr2c 06GgbD4p0Ml0EqX64zAT+Tq1+l6ZHhcK8vyrqEjTSppbx53kAZLfg5O1onezJif7HB82 DzU6Z1XLyzJYcWU+Hgq5ZF/UDTKFuXlUpHfioftqqzOpncedRhMinXkTC98cMAlSd29H g+4Qm7deUnLo4hxyfhyrv0rQXpbMYBS8mkE7K+ZNdSHyidEXxM2z+BdL1rHWcPgAsKM5 TZLTPFEQA1ndMOOlJbkvTvSUWTlT5nV2ALh8lRrRQnItsJwEHfG+MDUVlyhqYKvtgEc4 vyFw== X-Gm-Message-State: APjAAAW5YIQ7P5RX+uvEJmi2T8K9jGb+RBcS9RnwnPlOJH2hCkc0wCkF 3OWGhlooa01HyfL3x2WDroZAEQ== X-Received: by 2002:a17:902:d887:: with SMTP id b7mr26427545plz.297.1570419130968; Sun, 06 Oct 2019 20:32:10 -0700 (PDT) Received: from debian-brgl.local (96-95-220-76-static.hfc.comcastbusiness.net. [96.95.220.76]) by smtp.gmail.com with ESMTPSA id x10sm16377720pfr.44.2019.10.06.20.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2019 20:32:10 -0700 (PDT) From: Bartosz Golaszewski To: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , Andy Shevchenko , Jacopo Mondi Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v5 6/7] backlight: gpio: use a helper variable for &pdev->dev Date: Mon, 7 Oct 2019 05:31:59 +0200 Message-Id: <20191007033200.13443-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191007033200.13443-1-brgl@bgdev.pl> References: <20191007033200.13443-1-brgl@bgdev.pl> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Instead of dereferencing pdev each time, use a helper variable for the associated device pointer. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 20c5311c7ed2..6247687b6330 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -71,25 +71,25 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl) static int gpio_backlight_probe(struct platform_device *pdev) { - struct gpio_backlight_platform_data *pdata = - dev_get_platdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev); struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; int ret; - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; - gbl->dev = &pdev->dev; + gbl->dev = dev; if (pdata) gbl->fbdev = pdata->fbdev; - gbl->def_value = device_property_read_bool(&pdev->dev, "default-on"); + gbl->def_value = device_property_read_bool(dev, "default-on"); - gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_ASIS); + gbl->gpiod = devm_gpiod_get(dev, NULL, GPIOD_ASIS); if (IS_ERR(gbl->gpiod)) { ret = PTR_ERR(gbl->gpiod); if (ret != -EPROBE_DEFER) @@ -101,11 +101,11 @@ static int gpio_backlight_probe(struct platform_device *pdev) memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.max_brightness = 1; - bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev), - &pdev->dev, gbl, &gpio_backlight_ops, + bl = devm_backlight_device_register(dev, dev_name(dev), + dev, gbl, &gpio_backlight_ops, &props); if (IS_ERR(bl)) { - dev_err(&pdev->dev, "failed to register backlight\n"); + dev_err(dev, "failed to register backlight\n"); return PTR_ERR(bl); } -- 2.23.0