Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9288820ybi; Wed, 24 Jul 2019 01:26:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWCgObbytdPh384nCZuCC/Fvp2zkY3QMyQjR7qcyHulSML92bug0Hfus6n+RUgA/slRlEo X-Received: by 2002:a62:198d:: with SMTP id 135mr10020895pfz.169.1563956807850; Wed, 24 Jul 2019 01:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563956807; cv=none; d=google.com; s=arc-20160816; b=T2yJYKcF4wXxodiUwWTxe+F/XQVcUaYTc3xxdflfkIg+NsCYXbRzRIyoe54OHCLz/P 83Cb4z2AtCtF6qqNHBI9ywIiP1GvfoIbklnlwUis280zMQdnUJv5SEy9ZLazJbK5m263 AWQ4bo4zoGOFV3JswA+4VqpDNM93UGERK9wcpU2+q0R/KXeNYX4Iu8VxuxCaAXFH5IvC +3tXZ0X3QM52ve8f1zF1Ilh4oSe6JWaSS94r49KhTpbMIUFHh2xG/GQP+7Hb/NUmaxs3 55B+Lm+3r1sginfMh+NDxTbcyTV35/v7SASdceE74O3Mu2D3s8I6swxb2mwhw2ks9H/i jv0w== 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=ARbd1V2PTR/7B70DXuDpAAyS9eCMhAVKqqbb1qk0e7w=; b=IsSVb9889IzDeZm9NqMLn2bgBlRC29tWzjmBc1ugD8VvNqZ4tYiGQO3Vb01//5vuTe OEVfsJu6chPT41apCLhwcOF6Jm/hbAIdXByeG1M+msUvpWHYCh26csqR2/nNLLc70nOC 9ItyW7R/9cFa0UixSzXzDgVFwQeapT8WeoGjbZEDs059KBDAXOAcWGYlbMNfV0EZuoEc 2IQNoXmF3dAwq3HhbzyZ/FT+Y2wj1KLSwqECueZMK/pFPgwJ37vYVVS4Yhv9W+rHfMYK 7uWSwEOur6zSXcXeU3Oouepl7motKAQ3UN1VMTB/EUUuxDZTu0ReOILyVnmhHfl56wm7 F6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=wyVGQpD+; 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 w18si14673575pjn.74.2019.07.24.01.26.33; Wed, 24 Jul 2019 01:26:47 -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=wyVGQpD+; 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 S1726604AbfGXIZl (ORCPT + 99 others); Wed, 24 Jul 2019 04:25:41 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:40616 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbfGXIZU (ORCPT ); Wed, 24 Jul 2019 04:25:20 -0400 Received: by mail-wm1-f68.google.com with SMTP id v19so40777055wmj.5 for ; Wed, 24 Jul 2019 01:25:19 -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=ARbd1V2PTR/7B70DXuDpAAyS9eCMhAVKqqbb1qk0e7w=; b=wyVGQpD+T3uiZkn3LiRgv0LYR+71l0MHfD4iNRDIwOQSK1f0Vsijy1ZdZwYSok7pGz z6LQ/p4UKx3DYKA1xd/DhH3xxwduColASNq35D+f1bZwGtV1216ArwUnZkLSVo0OtHQT v37sruntHU3mWDOLAWr7Rdt/I5/oCDYSICOp/dVFtoGCsJBP+j6iLKLMDQWiklPMQGRj /MD5+fKLNv8D2Y26FgKUwdHv/cC7IUtLWGtnucaCJ8jkJKrcEF5Z4bcCeTM3atrAeCXh qHm6EZZVaObTXL7NmmkRvgeBJ7fNCV1kZMYsReZIJ7ScJgSUHLEuRxbDDoy2a9VXOHJm N2Cg== 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=ARbd1V2PTR/7B70DXuDpAAyS9eCMhAVKqqbb1qk0e7w=; b=kL7GbhGeld2zSWggScIAC6I9PgGEyALnDeOrmKV6teiKLi53j+bxmgxngHlO087Dv2 chIPs1aaDQb3oAOiry8XUbLkNZMHCJJSUUCDr1ktulxgJwRXPpCGudayYAw+7A4zPT1E YOvlDIhjyrzkwN5SUJyWzq4X3nt1U8VlKiJoLmVtFNrDTMHDjs2frgUR00jHtq59XSAj /fG37lEmT896MM2xqGY/jvOw7jhHDAvCad+2lLTBPqoU5gFUoLge6n3KbGdF/8e2TffP G7ygbf9BYGW6vsfLvmSziFYzS8rbXxXCUiIhAw1LmQ37AN6AcL9Z4Bc/a9RR/MVwIo/k VJ0w== X-Gm-Message-State: APjAAAUAu1Uq5wlVqPmPEAq3GdzzdaRyGDDaNcsPLWrzhOPzVMD7DnjY /i+9PGKuYWH1IFqi0B7nDRs= X-Received: by 2002:a1c:f018:: with SMTP id a24mr71172006wmb.66.1563956719095; Wed, 24 Jul 2019 01:25:19 -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.18 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:18 -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 6/7] backlight: gpio: remove def_value from struct gpio_backlight Date: Wed, 24 Jul 2019 10:25:07 +0200 Message-Id: <20190724082508.27617-7-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 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 --- 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