Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3096595ybi; Tue, 2 Jul 2019 02:06:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqybV+zU5mnXJZNiRHXZc0/hCHykbrlWsbpYoEsoQHkaKEpI8ARVtAcjipGp7uuZjN0emXIl X-Received: by 2002:a17:902:722:: with SMTP id 31mr33509769pli.163.1562058387835; Tue, 02 Jul 2019 02:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562058387; cv=none; d=google.com; s=arc-20160816; b=cfYhw2NZJ2ZRWy03QjzOieMHTSPFBhWxFWaupefdInudWU7mul/KgsMrPBfZ4xeCGg zzudgvaqlqPpMuTnyCCwJ7G/RN4anzxzZcPFxVfFDv72XzkmTCiWurb6xdEFpFShO6Fq 6Ka1vzpeifQpU4VgQLJYEEbtT3JoGyF1bIc6/E5hN4/+dyhsrS5LTLtguRP1kMjoBpu0 scW9VJxcyT9MdRmmHlp5tF2CH4bK61jRS1uEjqhrxfn2QLkRVwNPXoUK9QTxhmnBHxCq lwYKcqfxGVA75NWdA4sswv8lCNG1kL52qbczmYfLhTAZ3NpVHWrB3vrP+NQ9oDV5LsKm TMhQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dGGbbVrqx3epkvQ7DyUVG6YDxBKrBKIRNUqt51MsijM=; b=TtHdFl8gVrE7EBVqcwa79Jv76fxLN0WLVUAL+YdzaGVlSF74saVh/aE+jseUt8t5Qi TJ436e4tTsISxt+mKDjYrogZbKLaaAlEXyovtiXxobsG6siQj9LW60wHO3bFDaLznHyG awW6lS4ioNaB1VaRZcSje5Km9+IbwfRyDGQCNrlBhlAvkSb+y1HuuEWqL5scVWi8HKAv Uy6+4Pfrnx+hPpdm52MCzf7TPvvgz0TPbTR7Cu0UCv5FDbcsoSw9PEl2QTh5OWwVifza Fb1HyS5/zxgUvzflYIz9NdNledZY+89OsiveUdAbRrjt7nLgk1LRRlUAV0Mo/l44Uo0B L7iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wqvvFWgt; 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 w4si11922816plz.323.2019.07.02.02.06.11; Tue, 02 Jul 2019 02:06:27 -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=wqvvFWgt; 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 S1727060AbfGBJFp (ORCPT + 99 others); Tue, 2 Jul 2019 05:05:45 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:35604 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfGBJFp (ORCPT ); Tue, 2 Jul 2019 05:05:45 -0400 Received: by mail-wr1-f65.google.com with SMTP id c27so9148627wrb.2 for ; Tue, 02 Jul 2019 02:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dGGbbVrqx3epkvQ7DyUVG6YDxBKrBKIRNUqt51MsijM=; b=wqvvFWgtmzbFxo8VIz+VxphSEkiKA5bEkqsSJbk4N9X6ToqP0Ug0T390wJ64sQNiSo 0dpDPjUpSc4dprK2hO+WKHjiVjvMnqJRTwJAKJ3pYIQBTCVP4fwcnojimRI6/XX58fK1 Zc/qyltOkfvRJdr7J9Ryjhfp1jccErLoyG6BY4djPD09BuaQMtJf2IjrxLSpyIi2ZR/E zFRrP032ysoweK5yydg5EfUMDUdCedbRQIlRBSZ4XFl4PjBhZIL8hUD54x073ZkjN3bv pptW0BFA1tZ9vGiIjVpOkl2MPRu/sV3gyYd8y+I81DB9m4RBX5JsYt2PXUULcovGkcGJ jyYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dGGbbVrqx3epkvQ7DyUVG6YDxBKrBKIRNUqt51MsijM=; b=DLhtZe3D0ii1+i2C4X34VpEVVM2daArL1++eQJ/AYphDdCjvWZ1YIIwfDOdmfuijjM AgS4vYB9ZJ2mwHZQD+soPwnGxcRDP5ooTW/Xz3WW7QSfBfltW+I6Q8PVBmUyGJzLUlgA Ci7uKwat4UomzyZlPxpi2WHt7msHwgzD/31A4TK4Z/GrTJygGHe+sCC2RxvVFCuc+oC7 /21iwt0CX0J+xDiXQ/+JzqL2q604smb7/U6ecx6oQXjXOE43id7pdU07Zb1hcOIxPCii HGFhXfh8aemjXzN09pkLPY+u/bVgpmTey6U6QKIVbWy6bebkDFq4gDolWGrS5JYdF8Ho mAcg== X-Gm-Message-State: APjAAAUlXHBj0CNFPdHc08+20rH9vW00YP6PHRnhofkMc1j4vEugWI1K DLVmnrldXGjzH2HephHo3QTEAQ== X-Received: by 2002:a5d:618d:: with SMTP id j13mr22383402wru.195.1562058342873; Tue, 02 Jul 2019 02:05:42 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.googlemail.com with ESMTPSA id u6sm2334585wml.9.2019.07.02.02.05.41 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2019 02:05:42 -0700 (PDT) Subject: Re: [PATCH 02/12] backlight: gpio: use a helper variable for &pdev->dev To: Bartosz Golaszewski , Sekhar Nori , Kevin Hilman , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , David Lechner , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Bartosz Golaszewski References: <20190625163434.13620-1-brgl@bgdev.pl> <20190625163434.13620-3-brgl@bgdev.pl> From: Daniel Thompson Message-ID: Date: Tue, 2 Jul 2019 10:05:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190625163434.13620-3-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/06/2019 17:34, 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 No objections but I think this will need to be respun against backlight-next (or v5.3). > --- > drivers/video/backlight/gpio_backlight.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c > index 654c19d3a81d..8adbc8d75097 100644 > --- a/drivers/video/backlight/gpio_backlight.c > +++ b/drivers/video/backlight/gpio_backlight.c > @@ -83,15 +83,16 @@ static int gpio_backlight_probe(struct platform_device *pdev) > struct gpio_backlight_platform_data *pdata = > dev_get_platdata(&pdev->dev); Why leave this one out? Daniel. > struct backlight_properties props; > + struct device *dev = &pdev->dev; > 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) { > /* > @@ -108,7 +109,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) > ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, > pdata ? pdata->name : "backlight"); > if (ret < 0) { > - dev_err(&pdev->dev, "unable to request GPIO\n"); > + dev_err(dev, "unable to request GPIO\n"); > return ret; > } > gbl->gpiod = gpio_to_desc(pdata->gpio); > @@ -123,11 +124,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); > } > >