Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7373697ybi; Mon, 22 Jul 2019 11:58:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLEA+7T6SuEqlRQGiIafNM1SkN4HUhZqeCX1+aninBzvUkZ+hMHFXttkemB48HhRHhNtYs X-Received: by 2002:a63:124a:: with SMTP id 10mr72247795pgs.254.1563821928406; Mon, 22 Jul 2019 11:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563821928; cv=none; d=google.com; s=arc-20160816; b=Pl6ZX9dHPkjvgoy+5LTjDRx5zKY+BWrJPyN+4CnfFEELNPlhgu1t1JIolV2dXi/Z1h fq3ILGycMABoBuz1k/70wZLJK/pYmuXVPzC1DYX2t3Ooq8Tf4JxqsqdjFYP5YZSAsLUv 2xNBp4hi/oqz/78BcIJKsrD4Exoy/eIPIyRnu/Ojx0Du0DeAJ0is1jBPxUkTLHYbkI7w Vmw9KnNgdT2I1qBqwzsOuwBxxOyfw4jK6uHbBOo4MLxDjXYU/qQOd2f6pnkVePc5hc2T z+jgWBbf8smK2wQh7GYgwxFmJGQ89a4+YrgZf+ugw7ZGFWyKLh3dPdu8gXk566nlHRtT ifLg== 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=8zJTPUvP+hqISFeooYsrQz9ymOrtJOaEeguggmTOq/k=; b=iBqw2wnkHffA/LAEni7q5zwtz+r3Lazk5+cV1NSUgZEHbLnbaMXvhzBIA9+/RY5t5m SqpKg10EAmfBaMaxrE8H3hIBB1R8rwtNRV9HP+h4+oT4e9s6v3RA5dMYB+LaWhl/1Uqe cyUpnphZ67Df5BjzKS308gcZtvwb90BtJ39SoXQT3EjFRlHhqIB+BfzHE/UkBp0MzDnj o1k09gkbjZkTkEt5t1krqZw3rEboZUOggDyuTDd0MD0SJ0uf8RDZctghnBuxwgv49RK4 zTISycNKQ/Vamme+ogIphXOBd3lVe8CIbGOlWsebPmiHe3hHuwIKfeCdcAS9bzv72WqR +mng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=PCiSprjX; 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 s66si12386918pfs.120.2019.07.22.11.58.33; Mon, 22 Jul 2019 11:58:48 -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=PCiSprjX; 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 S1727531AbfGVPD1 (ORCPT + 99 others); Mon, 22 Jul 2019 11:03:27 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44396 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727375AbfGVPDY (ORCPT ); Mon, 22 Jul 2019 11:03:24 -0400 Received: by mail-wr1-f66.google.com with SMTP id p17so39754395wrf.11 for ; Mon, 22 Jul 2019 08:03:23 -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=8zJTPUvP+hqISFeooYsrQz9ymOrtJOaEeguggmTOq/k=; b=PCiSprjXoELIP7AMmcbBALqlNtlT1CQZuIXj5Wrl6j/YOz0ypnf9wGGwfuxfWWG5AW 5In16oK8Cx1DrA84pvaI6AR2rBGQGDW1+q2nWlhI8DTMOTUHCETVzyuju7HlwqTjBx8n ck0D9O44NO3Hl7hwl/6qoWy77e/Qpm0+F4beiorACJn+rBdn8e+NmNrANJoSkP6xvFdM ZqX+aBUsZ9BsCfcwzPPZEFM7IER//yZQ8jQiMMylWhKnn5mabG7/qjjinKzXTGRyIOaJ 1HXR35ZJQIxFhr2CalNwGxfF6TgdjOVf9jWAv4SyK15IjCfB0JKvaaFHISVN5GfO159y LTzw== 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=8zJTPUvP+hqISFeooYsrQz9ymOrtJOaEeguggmTOq/k=; b=Jj3nOdnW/evzW8Cf4xDKFZ9Goax1R/hzob4QxP/9HhIKpBZL41v7fsG9H4jgGnNkHs RQKMJCHLTxnV+C4j7i6e3t9wIGIPohr+n3Wl68kHleQ7W7kzc/6UHDsjpRB/t9AGtACx pHCZjhZ+uBazoFQpfk6AHCvs3JL2udUbUyHRkUFKoROyuIfcSujJzZh4VkazbBuvpZ+N Mol3Fb5Yj9hb1qfwBtkOOwYPuiJyrHZay8Bv5vlHOdP8wV7nsx/qpkTEsPOgXRkNLQtv tKMiTt72AcQankFz0Iz0ZFo5HJX9octkc8+AuvJVUYhtUDNCumOP0rCgCNu+MMnm2jF8 Homg== X-Gm-Message-State: APjAAAWu7XkkB91vaMqgMOKObtyRRf5pe1htDMYrLFvumw4qwg6EIYH2 +4czVuxUREdhW3yyK31oOos= X-Received: by 2002:adf:a299:: with SMTP id s25mr67876484wra.74.1563807802560; Mon, 22 Jul 2019 08:03:22 -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 v23sm36310460wmj.32.2019.07.22.08.03.21 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 22 Jul 2019 08:03:22 -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 v2 6/7] backlight: gpio: remove def_value from struct gpio_backlight Date: Mon, 22 Jul 2019 17:03:01 +0200 Message-Id: <20190722150302.29526-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190722150302.29526-1-brgl@bgdev.pl> References: <20190722150302.29526-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 --- 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