Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9288537ybi; Wed, 24 Jul 2019 01:26:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjndIgjN5sb3yBmDmp3UZGC/tcFnxdjgNEaKudpyCqW8HrShTgs4gEgoMMZ1GJKRHJt0s2 X-Received: by 2002:a17:902:381:: with SMTP id d1mr82803796pld.331.1563956788919; Wed, 24 Jul 2019 01:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563956788; cv=none; d=google.com; s=arc-20160816; b=HQhTjPBZb0M8YmEg3pe9sq4yz9zpJ3+eUUCMIeeagb092kUZSKjO5bV7U1RdnBnym2 fsYDfjYe1yzzlsFELcmTFUb7LWnq4cU9WmphkYVdd9A42oPD2iteA/D4uNHWJ3svSp6y d8Z15z3yWLz81oIJMLvimzvnMeuM53XXw4oIc8keCNK7eUy7zFWBt8mTIrs+bic1RwEu u0m0HD5KoVun0hsutopcJ3Lw9rXUxsG/sHJPKDYaA1d+sLHSlcoZBOi27VJSHt7GVOjP HqJ/Q79w/WYB/LVf/AqOtnBiPl0NloZ8OAiO6vJOIoiW12sa0qGRaCm37KPeo4Fo87Oa HFwg== 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=HpxCRy2V5Agh4JLerbqys83epZFNSOhcfRgJphFvhIM=; b=v445Y7DglZWVPmP+/y0FZlHLeFc1SpnHjkgBWTGbvtPZNhTQ8ycFRRBrthgS2FIu8t T8WSMr9CVmc+V4MYADnjkP6h8cE/bC9OlobegitvC87vfZWsoZj/68u6+PyOggHhvDW2 w0SWMKJiJJKJR9vRc/bk8K36Iw98py7U8PuqYkaBmYpRKYPnmBDMrYWUdo4var76meqS KciCYZhsexW1xkurnial+EVV9+pMljOzRB7to8WgyrW0dYX3twjWXiP3plX1YKm6RbRn QlbRcQIBErlezFjinrlJhpT0lzuA6YM3vjTn8b90mQbLR48RTV28dwy/2YtT7bWYfTf0 87oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="x19yNdi/"; 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 d27si687561pgd.328.2019.07.24.01.26.13; Wed, 24 Jul 2019 01:26:28 -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="x19yNdi/"; 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 S1726546AbfGXIZ0 (ORCPT + 99 others); Wed, 24 Jul 2019 04:25:26 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33969 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbfGXIZV (ORCPT ); Wed, 24 Jul 2019 04:25:21 -0400 Received: by mail-wr1-f65.google.com with SMTP id 31so45979414wrm.1 for ; Wed, 24 Jul 2019 01:25:20 -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=HpxCRy2V5Agh4JLerbqys83epZFNSOhcfRgJphFvhIM=; b=x19yNdi/wQM2QHEWsQ8Fml/XsADvHcBE6EJCk5MVdtjRIYLdcz8QxPF6qBAO/K2CdR FPqD88r5piJ1E8YFxjZL6g97vhm37EM9ZEeqHPRtITeuG9dgMFd6OI2rl3kcxyRxGr2/ AR5YqqHwRuiTh7exj0tZLBHZKBFwKtKGR3YMgT21+68aAndEk8RQF7rg4NUK2SiKQcHO rRqpGbAwY3EMvnAmAf58IAZZ3pEMM/x10whrww55L/YQ+PzmVafOq5xEQhagdFtY4f7R irg/VdMVaHIJMgs+Tc3kf4xhNgxgrtaUSIa1o0gFgToMLgCzbjz/eaoyeBumRIhB+oEA b5Jg== 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=HpxCRy2V5Agh4JLerbqys83epZFNSOhcfRgJphFvhIM=; b=FlYvf6jtuTpO6XeM8EilojrfIExJf9otKXMNYqR19AQOdNXzrhr7uN0Dj7XVzqHlPV x8LNHm6rIP3bmOvcW39h7LvQPDJ+SRakHcjN+O6eAw2qiNmhhNi9Fs4/LxbDvuzZtuox 1w4Pj1AkND9bChHdYgBxO3IVH6hXVpUSXiBMayIvNKR5G6glwD35yazFOpKefcqxiqOj 6OfF2SmAOsP8Y/r0wIY1T7xTFbUBpvh6lDyO/6Raxaq4EZRtykpwNy+iqRSOkSvjngRy nGUSYAKC6q8kTilO1DQ8NzUwk1Ed2omPpM5Wnrd53KG7IuQ1IwpsSe2LN3VeW9cFjERi HHdQ== X-Gm-Message-State: APjAAAXMYCMMdhkGBE4iebN7wbrQq4PcS5MMvzM1crbV86JmpHJc3Zyq oCro2yns/xVW++ylmQ3hlwp0Ux5I X-Received: by 2002:adf:8bc2:: with SMTP id w2mr3587116wra.7.1563956720281; Wed, 24 Jul 2019 01:25:20 -0700 (PDT) Received: from localhost.localdomain (amontpellier-652-1-281-69.w109-210.abo.wanadoo.fr. [109.210.96.69]) by smtp.gmail.com with ESMTPSA id z7sm42393880wrh.67.2019.07.24.01.25.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:19 -0700 (PDT) From: Bartosz Golaszewski To: Yoshinori Sato , Rich Felker , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , Andy Shevchenko 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 v3 7/7] backlight: gpio: use a helper variable for &pdev->dev Date: Wed, 24 Jul 2019 10:25:08 +0200 Message-Id: <20190724082508.27617-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190724082508.27617-1-brgl@bgdev.pl> References: <20190724082508.27617-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 --- drivers/video/backlight/gpio_backlight.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index cd6a75bca9cc..7dc4f90d926b 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -54,29 +54,29 @@ static const struct backlight_ops gpio_backlight_ops = { 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; enum gpiod_flags flags; int ret, def_value; - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; if (pdata) gbl->fbdev = pdata->fbdev; - def_value = device_property_read_bool(&pdev->dev, "default-on"); + def_value = device_property_read_bool(dev, "default-on"); flags = def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); + gbl->gpiod = devm_gpiod_get(dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { ret = PTR_ERR(gbl->gpiod); if (ret != -EPROBE_DEFER) { - dev_err(&pdev->dev, + dev_err(dev, "Error: The gpios parameter is missing or invalid.\n"); } return ret; @@ -85,11 +85,10 @@ 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, - &props); + 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.21.0