From patchwork Wed Jul 24 08:25:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FE8913A0 for ; Wed, 24 Jul 2019 12:21:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 501E428814 for ; Wed, 24 Jul 2019 12:21:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4356A2881B; Wed, 24 Jul 2019 12:21:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E94122880A for ; Wed, 24 Jul 2019 12:21:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DBAF16E52C; Wed, 24 Jul 2019 12:21:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E8446E4B0 for ; Wed, 24 Jul 2019 08:25:20 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id h19so32873490wme.0 for ; Wed, 24 Jul 2019 01:25:20 -0700 (PDT) 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=gYPqcZ/U/xjulkSsbh59ueSO+hYAB/Q5l8g3fruf1JR3QOZf+4UJv0MSTNimtFbbmE iDW3uvx6q3HNoud9S2s1G7O9B7iS8NPW7L43rJjLhzgwy2DbJtzUQK9uOCYmlsbtQvh5 rJA08FfmtjgrQk9vU+lcrrCpzHS02oIv+rTrSChCm3WxTaFegahw2aXToVm155Hrsf5x bSQ97MnIh61N6Y8H1ePbR9sDdIoi2a+Dc6Fk5UsY9Cq85ohPIMwo6B1p6CmHWyZwQPjL prePWYmgVc17tWsCGI3CS1r+xLl7J2On10zFXwYFJKwH+8uE7x9j7xdDW33mqOGhg17L KKJQ== X-Gm-Message-State: APjAAAUvtj1898ZIfVuVljXmgEUxTVPnII7Xtsms3C47ftJvRMyawnoK so/J4GK+gUHPot4Jq9LvVXM= X-Google-Smtp-Source: APXvYqzkgEv3bgw2h6q7V26EkyUVPqeJGTwwUSYmcdpXaPZAm+K0dgiQU1XSSJC6xbDuOYYXG2bWGg== 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 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 X-Mailman-Approved-At: Wed, 24 Jul 2019 12:20:46 +0000 X-Mailman-Original-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sh@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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);