Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7298045ybi; Mon, 22 Jul 2019 10:31:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAzGubOaOv4U7a8FRHfOPhBVFK5CBoeW0Cpsiwz6wf7eb++J2NY1EqjLVN2U5SzBrop6xr X-Received: by 2002:a65:6104:: with SMTP id z4mr35585656pgu.27.1563816706128; Mon, 22 Jul 2019 10:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563816706; cv=none; d=google.com; s=arc-20160816; b=CbjkhRFap0tvMjKwBbN+UxKr2CiZLdkRmYL//Fk+J3OTErFQQkTOq4BhlcMup9d+78 +6Tr7FalJY5gQZJkOFM28TYevwpUsDBc7L5JTogBzUbXEfTPKS+pRYODVPvhiOdN7KkT uMME0ifnVqxqhr0/XWgEKVsVHPjjg25IisnUuigTU+H707izzVU3RLWZbZbGqiVTbEnt lSixGjKPmqz4kvgv3z6lqhAVy5NrEIribBW9ayF9mPjpXnf8V3ReVxdVSBbcULzIthVz /NTWspz83CdnNKXmx+PRvJW1LitcrOnPa+wch11iTQ72hRTkAkj0yz56cYBk8/9fj/tN 8/rg== 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=CjN06kskuSN63zvz3I8U6ASqKJRxwYLJel4cw/9K0lw=; b=c0NAQZhK1yCOjxnVGAhtSx7kDAG/jnx2Mg+4fN61X94u161jTqXTGmfpCyqOsiHs8b HBIIHgTq8AS5EsUo0UneNHZklD/2SB/UQkC4ykaLmCsjp2Suxh/x4kE/bwg9BWtwbIvf 2nEPXlPRw40kSqojnFAo7gdY6JGSO2rrMCkmCiFhZgVdq0LfqdtBe4sE3fo8+4b3mxV2 8Ts7T3qKEZVIxhzx++VxOMSqBu15BR5kh6bNCe8Dr2nZJXA6B5kYXZMcpujz0sYdz5b9 +I+GdVUWMmjmj9Q8fKo01ralRIq7Mj66ovb0q4MiP/Wh97bGD4N15WiFCVWKsccXpoIx orAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SW2BLq/I"; 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 f4si11385321plb.38.2019.07.22.10.31.30; Mon, 22 Jul 2019 10:31:46 -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="SW2BLq/I"; 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 S1728790AbfGVPWL (ORCPT + 99 others); Mon, 22 Jul 2019 11:22:11 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40729 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728288AbfGVPWK (ORCPT ); Mon, 22 Jul 2019 11:22:10 -0400 Received: by mail-wm1-f66.google.com with SMTP id v19so35765569wmj.5 for ; Mon, 22 Jul 2019 08:22:09 -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=CjN06kskuSN63zvz3I8U6ASqKJRxwYLJel4cw/9K0lw=; b=SW2BLq/I4O/PnHgn1NA2q1TeVho/oHOeDcYpL3qFIQggNojxG22k4aZiFGmAg3qjZw sNH03/H7fUd1hP+JYWFhSUX8oVoTRU3bnRNRtsbc1lJviN3M++fuo80AkU9hWv+dRbu6 mg0kIKTw66qN8Z3uRv1t8IVBOT8WAVgLsmzb74vtLhqfx+4hcnmk6kNrJvkgbtcno8JY 0FDCNFNg9zgMDxr5NKN1TXvrZYwVniccPCYF6S1oN3eH/gHp9jUbauxk12vI4YbezNDT UsyQt5Z+DG/nC780HdW0gYFTNsc/rKkiLemjOICIiX9L0i2dF+lRJlhDPXFtvtYGgReH kIiA== 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=CjN06kskuSN63zvz3I8U6ASqKJRxwYLJel4cw/9K0lw=; b=dWgQPSKD1JnCQyqOouY/7jIlOMzKkZXrjC8CiE9+cSFtBzrLTvAXe9pLQVcUm14TuO AoYrSaPndJzlSqCscpDiZBWhana1s5E0xLgJgraQnbUeewLquiH6dzx/apTgCxdFCCas 2foPtUcFV0DAR2gWm5aS4zCSyGGpHER15QV6kkvzhawWgEz7OGo3FsBPBGMlHJGyWQL3 dhC8N16PAydoQSASgtQVMoXv6dUT1QydCVqfbsTUJ8g/vt/2L67VWj2xMaOKSvVyp4Bu X3otbYARFewKdDSOIKw0dkArImHRc+vQdX8ECvlngCTvO750Fp/0VTMQc0deDco6Tv7F Gd8Q== X-Gm-Message-State: APjAAAX58xbWrpH3rksQQI4y80VUKGr2iJz55vWZHIGn9+vfH7ocke8G PMn6OTzkOPwtsn5XYtkSiRHoGw== X-Received: by 2002:a7b:c74a:: with SMTP id w10mr61057896wmk.99.1563808928497; Mon, 22 Jul 2019 08:22:08 -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 i18sm51360450wrp.91.2019.07.22.08.22.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 08:22:07 -0700 (PDT) Date: Mon, 22 Jul 2019 16:22:06 +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 v2 6/7] backlight: gpio: remove def_value from struct gpio_backlight Message-ID: <20190722152206.bfjlws53yknq3xv4@holly.lan> References: <20190722150302.29526-1-brgl@bgdev.pl> <20190722150302.29526-7-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190722150302.29526-7-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 Mon, Jul 22, 2019 at 05:03:01PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > This field is unused outside of probe(). There's no need to store it. > We can make it into a local variable. > > Signed-off-by: Bartosz Golaszewski Reviewed-by: Daniel Thompson > --- > drivers/video/backlight/gpio_backlight.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c > index 70882556f047..cd6a75bca9cc 100644 > --- a/drivers/video/backlight/gpio_backlight.c > +++ b/drivers/video/backlight/gpio_backlight.c > @@ -21,7 +21,6 @@ > struct gpio_backlight { > struct device *fbdev; > struct gpio_desc *gpiod; > - int def_value; > }; > > static int gpio_backlight_update_status(struct backlight_device *bl) > @@ -61,7 +60,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) > struct backlight_device *bl; > struct gpio_backlight *gbl; > enum gpiod_flags flags; > - int ret; > + int ret, def_value; > > gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); > if (gbl == NULL) > @@ -70,8 +69,8 @@ static int gpio_backlight_probe(struct platform_device *pdev) > if (pdata) > gbl->fbdev = pdata->fbdev; > > - gbl->def_value = device_property_read_bool(&pdev->dev, "default-on"); > - flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; > + def_value = device_property_read_bool(&pdev->dev, "default-on"); > + flags = def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; > > gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); > if (IS_ERR(gbl->gpiod)) { > @@ -94,7 +93,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) > return PTR_ERR(bl); > } > > - bl->props.brightness = gbl->def_value; > + bl->props.brightness = def_value; > backlight_update_status(bl); > > platform_set_drvdata(pdev, bl); > -- > 2.21.0 >