Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9446231ybi; Wed, 24 Jul 2019 04:16:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7Sl2/YOC63Bejldc95HOUxg92dg5LvZZqKS/x1DWGwXu9V/hasC8ezhiD+psA6digglLW X-Received: by 2002:a17:90a:7d09:: with SMTP id g9mr85364380pjl.38.1563966992293; Wed, 24 Jul 2019 04:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563966992; cv=none; d=google.com; s=arc-20160816; b=d4jSeD+J8gEORqQAWGNHCzzPgt6NTyRmTvkxmlaL4ejLeAXxIisedRD/3ZiAWqNA6Y CTKhksUy/c3q/IkGzJwtBREnAkpaL/Z7V1YeAG7IorpT0WLb0YFh05ZHEMHO7XelXu8k bMMKswvSrh2McBHLBjdlXWrp6wYv67G6G0nqnwEkh/CsYlDhdJyFSIycJxQraWgtO7Ls pbpZfP+GRlz28optE6USNWN4d/TfgyIVq//4C6t1vpCi5Y0X12gau/v+Cth/f+20OWnq YwrWUvsBmRkhFZkzmu8K8OJRpRJFYY+ApVg3ajbT1DmHLkME1rQctq5Jh3e7C6N33m3v tHUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7NyRu0tx3w+dLLQ6/dneDxJh1D9iVMTSGGH2CPUAo/c=; b=Xam7o3UaEPdUyESbFhGpcE4aOOeKTTaTyEbxPvGnXivxfe6oeQWfyP5Kg1fAkt7kls zV9x4aj09EEXd3Xauf8gvwqqiy6zyXZBpLb55QNsKKrtO+GN75plRNGBl3zhTzYDyICM KzUVj/kHMLj5D2pgzoOekQzpf+mQOGfPBq4jWw6Pmy5ETTBrZ957cVtW1AvfRV2rJ4gG PJv2zMuJ80dLyL360TdrhfMvl8atsDdbYYlhYPw71SutqPaG9TxrwGAJU25iPyBmObUb 5uiBE7Fk4HM7mJo0jorfGL7z/vYZnQMRUgjhUMNGIE+UtQ2L5jMnf86YeD5o/NVi83W+ OAZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ufYYjVec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59si14299696plc.425.2019.07.24.04.16.18; Wed, 24 Jul 2019 04:16:32 -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=@linaro.org header.s=google header.b=ufYYjVec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbfGXLOD (ORCPT + 99 others); Wed, 24 Jul 2019 07:14:03 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39007 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726960AbfGXLOD (ORCPT ); Wed, 24 Jul 2019 07:14:03 -0400 Received: by mail-wm1-f66.google.com with SMTP id u25so30883406wmc.4 for ; Wed, 24 Jul 2019 04:14:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7NyRu0tx3w+dLLQ6/dneDxJh1D9iVMTSGGH2CPUAo/c=; b=ufYYjVec/kvhmg39Q3zq/jFjiLdLC9vtny5aJgVO4Lp225heuEYfYuddTPewKY68GB GFd9hONJsyc/pjx7948e2iiOHpwjxBH1adsyByDlp2IVTXsmBc5J/T2Q13mP4Je306Ah whztj9zZujrWsLF/GxRhou1EKUfVQDIs4rhTUix2oaCIlIXcFEK7YVAGTTNpgg1S3bcc cTG22FbrfXPgn1yleXnMI4R3t7xJeEXNJ42G4rL0u1j+slO9cBA/AeIeUBd4PW1SQ3EE GvXB6ePJhAsLZCprxL28nuwbJtvJZvpQlsOm/o+9bMvbOG8wD/nXyunAit68PGMWKZEh CkoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7NyRu0tx3w+dLLQ6/dneDxJh1D9iVMTSGGH2CPUAo/c=; b=E8jBvCn4MnCO7UaIYSqye13h26pxJ7Iaiji2EzVF5R6/OP2IwkaQlHt2w9dVJH3Nou DMkz4i3vAvXas8BpOBzLtQzGj8WmQZWj7z0KxdnN1LLJmHUcpfTP+EfSODtpIHPGV2kT /rlIfs8YXVexzF7rDiRqOjZu2F5DOtEXzf+SnkOn+Z9PWv0MxXTirEX8+alUpOlSmUqT SuEicmLCLTxMGoXgMzGQ0LWogjCsh73csZ39UcmTrQus8DD+B9vwpKUuqcSz9LmntneB f2YzGsJ9sdKNHP60qH6eY31E6zPx+EGXep3U1hSlCd+m1tB38anPitjsoNSfSrqCoTlV JMLg== X-Gm-Message-State: APjAAAVZfI7AooioAIbY2c16iOypD2vi36qOy9TC7pfaHS7gwEKw14Ih a7v6IKt5RJrYCrxJIXn6dQORpA== X-Received: by 2002:a1c:c742:: with SMTP id x63mr78332968wmf.0.1563966841429; Wed, 24 Jul 2019 04:14:01 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id u13sm54703536wrq.62.2019.07.24.04.14.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 04:14:00 -0700 (PDT) Date: Wed, 24 Jul 2019 12:13:59 +0100 From: Daniel Thompson To: Bartosz Golaszewski Cc: Yoshinori Sato , Rich Felker , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , Linus Walleij , Andy Shevchenko , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v3 7/7] backlight: gpio: use a helper variable for &pdev->dev Message-ID: <20190724111359.c262dcwwikn3j7fu@holly.lan> References: <20190724082508.27617-1-brgl@bgdev.pl> <20190724082508.27617-8-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724082508.27617-8-brgl@bgdev.pl> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 10:25:08AM +0200, Bartosz Golaszewski wrote: > 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: Daniel Thompson > --- > 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 >