Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9444722ybi; Wed, 24 Jul 2019 04:15:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6mJLEU+aJdvbK49VJngODxqXtTVEwqu4nHVi6mS9o7w/566MBH7/Y8AS0EMCeaEc6bCxr X-Received: by 2002:a62:2f06:: with SMTP id v6mr10882003pfv.195.1563966905367; Wed, 24 Jul 2019 04:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563966905; cv=none; d=google.com; s=arc-20160816; b=DiejgygSi2M+BNrnGgtBnshABvzVNnFO0oJiGShxoEFrW9Flp0pR1hfQN+nTyFqUKy R4C6iz1/Ku1B3G4pak1fjwf2TKQP5m/p7COSLQq1xZkl0rgNe2Mvltf+UZCQzg6KcntA nH5J5l+zHHepfgbTwyEKUt/hDCfNRrZqUk6CbG6xTQIbdjL3RDKb4ZC7XK728j125e0v A48nfngnhsfcva6ZpMZm/4G/wgqtydJ65i9vzQXV9JCCFa7B+B4V5M+E5YOcRdzQS9Oz i1H+YONmRxfqljyTKVunG239bTcq1gO9moruZe4CDRivzP+jKA7Fa9PwLdWmO7t2g0xR 63Gg== 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=NvtrvMV4Nt63Balca848q6E3+ZhiwJtTkFp748N0uOg=; b=I4hf7FFpzDLS4YGzg+WT4cBptA+Wl8a1KFsYVGEbAcxLgmjagepeL974Bdw8jEZcug yKQznWWEuSyT5qkLIdJIER2BXcR5gaXdV+SEGEcR1CN3TJEUsHu6cSZOWjGHILW8MnQS 2SCtpi6Hqys16xnLQzlTGyd5KQYDXhz+8HmX/DqzirRdZYXpTMCMywp4q7EXoTqRmsmc 0Tra6xz1RMOevGMZMW/RwkxUvmXEVTxSdTO7Oy+BuxbO5S4QHYCPYrHqYWTAyBQ8tpsJ dQB3n26lB/86tc1o3jsLpZ1L6Za4VVd3ig4Gt0L/6pnCyD0rvJegc/izm+PnYtNeUiQE 7RDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KNjXtO5n; 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 y6si14473526pfl.288.2019.07.24.04.14.50; Wed, 24 Jul 2019 04:15:05 -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=KNjXtO5n; 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 S1727607AbfGXLN2 (ORCPT + 99 others); Wed, 24 Jul 2019 07:13:28 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39701 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726981AbfGXLNY (ORCPT ); Wed, 24 Jul 2019 07:13:24 -0400 Received: by mail-wr1-f68.google.com with SMTP id x4so46493666wrt.6 for ; Wed, 24 Jul 2019 04:13:23 -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=NvtrvMV4Nt63Balca848q6E3+ZhiwJtTkFp748N0uOg=; b=KNjXtO5njYFUIck/ozHOGMIWJ6z+FSABuu2c1L59UTM9K87f1GzdoroCF41tDBxyrR 7k+3fRTPUuhaq3B9Hijc4O3kz+rsb715JXcHhmvy1cm/35kj00R/EzG/AUcxC0wYxppv iBNLNR0Qu5clqaICWCeBMs7+LCiY7oa2wyFkQ4Nr6JaJiBv0yc9XgOn8jvykpYj4jW3W V7sQmX8uE7OD2tdKkFLBFOh541lVAexffqWUb9dR4X2gRStG/Mh45aD1PUGXtyWMOwnB /9zrSd3j+rQ0U9jRbeOYdTkoQdGX8XweZvzgaNJlPlXtjl8+spgMq1rkvRyuwBZuvav9 Bcfw== 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=NvtrvMV4Nt63Balca848q6E3+ZhiwJtTkFp748N0uOg=; b=jw4FiWZtPFvS9vNBLXUqanWi8cfDBLrrKBgIYNgpZvEaNfxNIaULdrh5qYiIG+pAXw DMt22QVuMdXeVGOuWSEV80cJ59sMIjMcTDq6EgCdHIxMRC89wp0jTvqK2aVEBEe28LXH qIbqXWDMBb1Xe6oD7GUhfHeBVtp96HPIYd7IfIIJmiM13o8mJWI1m1JkxGXxw2AroAmK A7JORuTE44cEM9YeMCm7bnZcWlNlJW4fbwSEKU2p+XeBzkfPrBi/F5+2K3fos86gjU3R gjLYxYWIochyzIOvaTn1xFCsQeeKYqA4qB5liH7XOLJJx1CGUh1CDoDHWCW0lDS4QhFu DzNQ== X-Gm-Message-State: APjAAAWOSKENPyvexum1ZDAgE1EfvFvprl0MsW113kAcIJ5QFKtaC+ii zZHifIN2qOXWwOFKm0AkzS0zbw== X-Received: by 2002:adf:ed4a:: with SMTP id u10mr93203495wro.284.1563966802936; Wed, 24 Jul 2019 04:13:22 -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 c30sm80678542wrb.15.2019.07.24.04.13.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 04:13:22 -0700 (PDT) Date: Wed, 24 Jul 2019 12:13:20 +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 6/7] backlight: gpio: remove def_value from struct gpio_backlight Message-ID: <20190724111320.wqcquhmlylgfkv6f@holly.lan> References: <20190724082508.27617-1-brgl@bgdev.pl> <20190724082508.27617-7-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724082508.27617-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 Wed, Jul 24, 2019 at 10:25:07AM +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: Andy Shevchenko 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 >