From patchwork Wed Jul 24 08:25:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056723 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 C5F441399 for ; Wed, 24 Jul 2019 12:20:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B18E0286B5 for ; Wed, 24 Jul 2019 12:20:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A4ECD286AD; Wed, 24 Jul 2019 12:20:57 +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 459BC286D4 for ; Wed, 24 Jul 2019 12:20:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6081F6E4F1; Wed, 24 Jul 2019 12:20:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2744F6E4AB for ; Wed, 24 Jul 2019 08:25:15 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id z1so45897454wru.13 for ; Wed, 24 Jul 2019 01:25:15 -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=fKxkD02366JB5IdAqT4wbLtrtWIwI1gSRslxcR13y+o=; b=hgAdQZCy/mwauUVpHdct6oEQcDoLp0y2xLW3+hZTxmSmmZOe+3ELyN72jNPxsydGC7 Q7A75AMpH6r0/rFLACqahGcfKmkXLWtBssn83DctbE60aQn4MIUKii0F4Tf3Z6uh/AqC rDQd3AsM2xzZO1LsFtrBF1kLeyRphlCWMn2aHVqfGSiHGaAyGVVT2xGUH/AXHmDnwhOT BbwE/BkSgUi7Nfx5pyzlX+n3ifeAD63R7y8t/30Lw1Vr4pzGk5K+ranGeGc7zVdX+fwM ivpeQASi6E/h7x0hrTeeTqKuvZBzTAPuQJuFuh/lPitL4D2op1CLRfRC8wy9/UAR0PQZ LyCQ== X-Gm-Message-State: APjAAAVG2w6pcIm5gGKE8vNnCR8FQw4Zt03SUm+cAEGUpHoahXZt8olW iO3HbvIDftmLKElO0ov8VtU= X-Google-Smtp-Source: APXvYqxE5ySVYgSPMcOzXIlVOzVvl/0vcbAThP9xQsCe5hN1x3daHr7gg6o2hBdJ3+G8SsYPeq5fzw== X-Received: by 2002:adf:ec0d:: with SMTP id x13mr36709389wrn.240.1563956713776; Wed, 24 Jul 2019 01:25:13 -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.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:13 -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 1/7] sh: ecovec24: add additional properties to the backlight device Date: Wed, 24 Jul 2019 10:25:02 +0200 Message-Id: <20190724082508.27617-2-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=fKxkD02366JB5IdAqT4wbLtrtWIwI1gSRslxcR13y+o=; b=T4HKhvlgZIWgcdonCwhUhZ3z+OEMFR/VSNhly7EEEAg7ipweH4u94whK9fTSYtNalr A/ZDt1qF8tnciMbF2GaMwoANWwTw7ibVTh+qpbN9eBDzTNuBikvlgWFT3/W8yXiQ65o+ L/Kfld+bCNV5HT2TCqpZdB3NEHBbGHbb7eXfQ34QumXq6miX6zEK0ZL6/RoERC8e7NXf aAgZY1kRFmPwv/Eftv11bIuUf9DzGT0ijX+XdWtnBOLMkYwa0ok6QAqfUmY823CadqWv 34VWd5C7zkUqo3+hjF9c0SbM7Dzuz9p8gjzOV3rlJsApgvJndtsV5/LhA45zTSLsby8S u4VQ== 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 Add a GPIO lookup entry and a device property for GPIO backlight to the board file. Tie them to the platform device which is now registered using platform_device_register_full() because of the properties. These changes are inactive now but will be used once the gpio backlight driver is modified. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/sh/boards/mach-ecovec24/setup.c | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index f402aa741bf3..6926bb3865b9 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -371,6 +371,19 @@ static struct platform_device lcdc_device = { }, }; +static struct gpiod_lookup_table gpio_backlight_lookup = { + .dev_id = "gpio-backlight.0", + .table = { + GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH), + { } + }, +}; + +static struct property_entry gpio_backlight_props[] = { + PROPERTY_ENTRY_BOOL("default-on"), + { } +}; + static struct gpio_backlight_platform_data gpio_backlight_data = { .fbdev = &lcdc_device.dev, .gpio = GPIO_PTR1, @@ -378,13 +391,15 @@ static struct gpio_backlight_platform_data gpio_backlight_data = { .name = "backlight", }; -static struct platform_device gpio_backlight_device = { +static const struct platform_device_info gpio_backlight_device_info = { .name = "gpio-backlight", - .dev = { - .platform_data = &gpio_backlight_data, - }, + .data = &gpio_backlight_data, + .size_data = sizeof(gpio_backlight_data), + .properties = gpio_backlight_props, }; +static struct platform_device *gpio_backlight_device; + /* CEU0 */ static struct ceu_platform_data ceu0_pdata = { .num_subdevs = 2, @@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = { &usb1_common_device, &usbhs_device, &lcdc_device, - &gpio_backlight_device, &keysc_device, &cn12_power, #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) @@ -1464,6 +1478,12 @@ static int __init arch_setup(void) #endif #endif + gpiod_add_lookup_table(&gpio_backlight_lookup); + gpio_backlight_device = platform_device_register_full( + &gpio_backlight_device_info); + if (IS_ERR(gpio_backlight_device)) + return PTR_ERR(gpio_backlight_device); + return platform_add_devices(ecovec_devices, ARRAY_SIZE(ecovec_devices)); } From patchwork Wed Jul 24 08:25:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056729 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 A1F2713A0 for ; Wed, 24 Jul 2019 12:21:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9177B287F9 for ; Wed, 24 Jul 2019 12:21:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 856FA287FB; Wed, 24 Jul 2019 12:21:05 +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 20F80287F9 for ; Wed, 24 Jul 2019 12:21:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A3B626E4F3; Wed, 24 Jul 2019 12:20:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34BB46E4AD for ; Wed, 24 Jul 2019 08:25:16 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id y4so45952603wrm.2 for ; Wed, 24 Jul 2019 01:25:16 -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=8VOxOTv40kWNEJHTWrrT/jLtfVvkKD73o3YTvSQ9LmQ=; b=nN3H/je2/NWhmOhJMNqDOE9n0MS83gjE0IYB1vTYcJooRMy9b/6RDJXRfvYyS5wzJ5 F/4RnuCn1ci4H+6wAdHv88la/HHOwfYCdvlI+8+RgSlCVbstWm4VXb1hqPZ/OY1WPc4t pzWuL8/kDTMiQ6f4nCLQ/SZD5GMn/BYoI/3os+ivFd1O96PV9e58laLQPO37sPXt1278 LodakBgs4jA8qWmVwBjnfiZB1n99Qzuc13NIiQLH1qMnZCLKbzNO8zzdv3KcsX5Q5Tds /m48CINXs0nmN7LWii3xFFJaiMWmFfRU3ztg+/Ydp6VTAwiMi4TJVeGYnp6m4zPk0R5q dmkw== X-Gm-Message-State: APjAAAWRGi4+0TNBrwJZGpDKaML+ENajcbJU88ZEmJa97sJJHD3paoTQ mDs3aslSH4wk5G75ThKP3Xo= X-Google-Smtp-Source: APXvYqylEG+5UwTbcaSwczxEISEgX+vxsc2ZxbxeF0HClQcWNGuQkAApx11b3CnWSJnzqEygUClIyQ== X-Received: by 2002:adf:9d8b:: with SMTP id p11mr53138350wre.226.1563956714814; Wed, 24 Jul 2019 01:25:14 -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.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:14 -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 2/7] backlight: gpio: simplify the platform data handling Date: Wed, 24 Jul 2019 10:25:03 +0200 Message-Id: <20190724082508.27617-3-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=8VOxOTv40kWNEJHTWrrT/jLtfVvkKD73o3YTvSQ9LmQ=; b=A9RjNrSpXlzPhVNZCXaDwouPHTi7TIFzDls2JACrq3+/shRWFCWrnrspTHTM4I91jH ezoziNRBN2DQ5bIkHzan2QY0fid7sIZpj+W90xAKtLRzy5mL1NxRp24QUfHTwrqT1rfx SeS/Go55UuBU+CS4L/Z9MgOIcU0MpICJL3kpXsMK1FqUwUkjm3pjrjKWnN9Wcb/W1ITz G9DtjzD0Z+mZOITUKKR0MLN6FYml6GeYFEJSF41qOE9P9NAI8NWDod7eDWBSAbqQDWCm XQPYIUVcqWdPPTBMLGe1uOA9+MXjiuCeZ8xuvV22AGuAK2GA0lLZDJAdjh9VDaF/qDO+ a/uQ== 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 Now that the last user of platform data (sh ecovec24) defines a proper GPIO lookup and sets the 'default-on' device property, we can drop the platform_data-specific GPIO handling and unify a big chunk of code. The only field used from the platform data is now the fbdev pointer. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 64 +++++------------------- 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index e84f3087e29f..01262186fa1e 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -55,30 +55,6 @@ static const struct backlight_ops gpio_backlight_ops = { .check_fb = gpio_backlight_check_fb, }; -static int gpio_backlight_probe_dt(struct platform_device *pdev, - struct gpio_backlight *gbl) -{ - struct device *dev = &pdev->dev; - enum gpiod_flags flags; - int ret; - - gbl->def_value = device_property_read_bool(dev, "default-on"); - flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - - gbl->gpiod = devm_gpiod_get(dev, NULL, flags); - if (IS_ERR(gbl->gpiod)) { - ret = PTR_ERR(gbl->gpiod); - - if (ret != -EPROBE_DEFER) { - dev_err(dev, - "Error: The gpios parameter is missing or invalid.\n"); - } - return ret; - } - - return 0; -} - static int gpio_backlight_probe(struct platform_device *pdev) { struct gpio_backlight_platform_data *pdata = @@ -86,6 +62,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; + enum gpiod_flags flags; int ret; gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); @@ -94,35 +71,20 @@ static int gpio_backlight_probe(struct platform_device *pdev) gbl->dev = &pdev->dev; - if (pdev->dev.fwnode) { - ret = gpio_backlight_probe_dt(pdev, gbl); - if (ret) - return ret; - } else if (pdata) { - /* - * Legacy platform data GPIO retrieveal. Do not expand - * the use of this code path, currently only used by one - * SH board. - */ - unsigned long flags = GPIOF_DIR_OUT; - + if (pdata) gbl->fbdev = pdata->fbdev; - gbl->def_value = pdata->def_value; - flags |= gbl->def_value ? GPIOF_INIT_HIGH : GPIOF_INIT_LOW; - - ret = devm_gpio_request_one(gbl->dev, pdata->gpio, flags, - pdata ? pdata->name : "backlight"); - if (ret < 0) { - dev_err(&pdev->dev, "unable to request GPIO\n"); - return ret; + + gbl->def_value = device_property_read_bool(&pdev->dev, "default-on"); + flags = gbl->def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; + + gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); + if (IS_ERR(gbl->gpiod)) { + ret = PTR_ERR(gbl->gpiod); + if (ret != -EPROBE_DEFER) { + dev_err(&pdev->dev, + "Error: The gpios parameter is missing or invalid.\n"); } - gbl->gpiod = gpio_to_desc(pdata->gpio); - if (!gbl->gpiod) - return -EINVAL; - } else { - dev_err(&pdev->dev, - "failed to find platform data or device tree node.\n"); - return -ENODEV; + return ret; } memset(&props, 0, sizeof(props)); From patchwork Wed Jul 24 08:25:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056721 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 0991A1399 for ; Wed, 24 Jul 2019 12:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE29F27E5A for ; Wed, 24 Jul 2019 12:20:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E241D28718; Wed, 24 Jul 2019 12:20:55 +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 A06A627E5A for ; Wed, 24 Jul 2019 12:20:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40B076E4E6; Wed, 24 Jul 2019 12:20:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 588036E4AD for ; Wed, 24 Jul 2019 08:25:17 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id p74so40907771wme.4 for ; Wed, 24 Jul 2019 01:25:17 -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=bZYb/2BvCTI7DdfJeewjmu59+q6QA8Ct5o62NPSlXLQ=; b=kcavIqabbXy5Is77Ywy8cFLCTCR+I/QZhPwdX5Az+bimTFoVAkyZFPav15PtQgvy5z HmcmCvp1mvuhBAbAAr9JMmqENjHn0RBWB6VViDXy8wQzosQSUvWFyvuGFQV+b/USOmIq CFDZlwFjh3aZD0tMbdRYioFNptZP2PsKbrMiAaCQBaX3/L62Q8PMQnfMtj9BtnSiK56K bs6BKI9q6a9+l8ZRtXKhUG2DbStc+E6nPdycK955fYopn/3peJazuHOJZ7iLOe47mcZw rrK+VuqreP513lqy7U/7UQXJRtZrc9s3BTRxN+NaYFw0x13aVzLYzi/UDtAjEDqq/5Jz RmZg== X-Gm-Message-State: APjAAAXMQIjzxpXJl5x9euo3YiSusYLaQOGvZ9FLC3uLCgEGAp0af+Fz wQTlPjNyCBHqsPKcnbWTU4Q= X-Google-Smtp-Source: APXvYqxOORrgcEepfDSEgrObXsBtxM+8pGNSKgl7s1yaroVXpQpRAWrFwTKiJdvbP27wuH9VC4s4Vg== X-Received: by 2002:a1c:f116:: with SMTP id p22mr71783247wmh.70.1563956715936; Wed, 24 Jul 2019 01:25:15 -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.14 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:15 -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 3/7] sh: ecovec24: don't set unused fields in platform data Date: Wed, 24 Jul 2019 10:25:04 +0200 Message-Id: <20190724082508.27617-4-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=bZYb/2BvCTI7DdfJeewjmu59+q6QA8Ct5o62NPSlXLQ=; b=eMMmroR7V1M+etXX4tYfPBtj+QEIIIUXtNJYKhwTIwvxfRUNRc3IZfzvWJXAvrNYWU advngdJeEYxOqTd3iZl5xGYkFNxm0CngMKJr18xOtSwvzlW1dOyGy1oMF0bxwqwpA37w 977smMjcPWCsg44JwBkhdWtYAWEcH+IT+EP22quG88BckRt4EAY+nM9q2ekhzOHyZB5+ wGgvDvDbX2/qq7WwZtSuhRJcSqByopwj1f7ukQWn41YQi/HWvI0u/IC1pTwK5CTvgKhC etBqD7P2AQBsWj+uSkD+VetwheS4bWknvZ6JCCK9BfFIxj4I6ij4mc8vc1cACyjhgPCn imvw== 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 Platform data fields other than fbdev are no longer used by the backlight driver. Remove them. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- arch/sh/boards/mach-ecovec24/setup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 6926bb3865b9..64a5a1662b6d 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -386,9 +386,6 @@ static struct property_entry gpio_backlight_props[] = { static struct gpio_backlight_platform_data gpio_backlight_data = { .fbdev = &lcdc_device.dev, - .gpio = GPIO_PTR1, - .def_value = 1, - .name = "backlight", }; static const struct platform_device_info gpio_backlight_device_info = { From patchwork Wed Jul 24 08:25:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056731 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 B405713A0 for ; Wed, 24 Jul 2019 12:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A61C828726 for ; Wed, 24 Jul 2019 12:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A43C28817; Wed, 24 Jul 2019 12:21:10 +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 3EEBD2880A for ; Wed, 24 Jul 2019 12:21:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32DBF6E51B; Wed, 24 Jul 2019 12:20:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55DC56E4AE for ; Wed, 24 Jul 2019 08:25:18 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id x4so45895334wrt.6 for ; Wed, 24 Jul 2019 01:25:18 -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=PtXEm5EHLkMfau18VS0/ndTlnG64/pDTlbKgiSCBHXM=; b=S8pGlH+DtoE0bFokt4L2RjtUucdSEPtHD/rqNTVpYPGOlmZMYpf5eR7tOSBUdu7YE8 Gjg8r/1cSnis4wuz+u7KuSuFTLhcnNEFl9JCxJB81fUeL5pNgarqWCTCLWquZqCSQxdC wC5lq4CNJT5Tp4z7792MjhbsfNhauiiaajlzyZnN3F4gvdpqoQnP5M+zySM1KLtreU0w 2lGsUlupM5xL7Q/IWg7ONR8oZeqoGM2td3buAvtITsVD4XneYuGOXQvnDCvTP1RBg4nz CF7n9aHMH+6DOZouCShIPyYKPgZf77Af6La8XtO+qFr0291SJ8PCKonmEhvBtZw/oWMR pcEA== X-Gm-Message-State: APjAAAVfJ/EeEUintQK6A7fbAwLwj4Hjch/xjKngDw2YPs6L4+gbNe+s DorfU73tHS6mjReENxD5bHw= X-Google-Smtp-Source: APXvYqwzyOuZJqgrEqGk5ckOvAjzeH6Yh+/HufAQdFV4AXpJer4oPxFe3x+2qPBsY0spQGgjJr4fWA== X-Received: by 2002:adf:ea45:: with SMTP id j5mr11543282wrn.11.1563956717025; Wed, 24 Jul 2019 01:25:17 -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.16 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:16 -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 4/7] backlight: gpio: remove unused fields from platform data Date: Wed, 24 Jul 2019 10:25:05 +0200 Message-Id: <20190724082508.27617-5-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=PtXEm5EHLkMfau18VS0/ndTlnG64/pDTlbKgiSCBHXM=; b=pjvnwWlg1S0JJObJ4VAQYglevZH6RzmSr9LO8Vogmks9DNfq/Ol7Vv994gV+BUd3ea BzBvGJRFZG460Sx04z9WdPLd5/AWYUsRQsPfSbsvEdQZbEzWUWAM2vwkxE7EBHXG+iQY h3q3/kwA6euG7dAy9zWHIe292Lm41qMYTqLzrGHC6RXOOWBrDIlBoML4fRdfoSzJrh1v 8924F2s+Z5KscpUb/O8kWJ0k9TcHopYH2o18DLKSTopAiitXP7ZveOS4UIOKF6zdZHJm QGVgGP4zLRsWceIkaRs7WzkZzgwaK5qgmUcXdwmgxGYb9fTRcWyQYB+4fwYPsXpV6aCj u2xA== 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 Remove the platform data fields that nobody uses. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- include/linux/platform_data/gpio_backlight.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h index 34179d600360..1a8b5b1946fe 100644 --- a/include/linux/platform_data/gpio_backlight.h +++ b/include/linux/platform_data/gpio_backlight.h @@ -9,9 +9,6 @@ struct device; struct gpio_backlight_platform_data { struct device *fbdev; - int gpio; - int def_value; - const char *name; }; #endif From patchwork Wed Jul 24 08:25:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056727 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 A10081399 for ; Wed, 24 Jul 2019 12:21:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91B022863C for ; Wed, 24 Jul 2019 12:21:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 863AF2864B; Wed, 24 Jul 2019 12:21:02 +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 396332863C for ; Wed, 24 Jul 2019 12:21:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE3DD6E4EC; Wed, 24 Jul 2019 12:20:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 59FC86E4B0 for ; Wed, 24 Jul 2019 08:25:19 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id n9so20859588wrr.4 for ; Wed, 24 Jul 2019 01:25:19 -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=MWh9VGd2JwifXWatter5gVNCFGQvFvQYl1wPUfmq6BA=; b=tLSXPHEaN6iFY3hWIGE+5/IxrNyG+Ad1s8MWuOg7DXBvdNmPIcku6sj6W2ICjgSasH TbnZCxx9+eySUvGru8pOSw2pEIY1OV+TVLTvfSZZBzIlMQKEa/YaFG4eOYt+D9fvG8cD XGts3DFDVZtJ2QVNeJfoq2g2L3QgYtO04KPqSloqr94voNMcY9kXl6ouDgRDAy8KliVv X9Af/5K1zddYZ+TQgs/Q74l63kJ3+FstgPSILzzMovHBhEb4LS5w/qQ70VeDzaUMDBkD ECgnflUiRSvi59VWDTUVSm9hHTp8fS3FBIhAPzPWzmqyaILAb1+vklxq1DCr0OKDbSam 5K1w== X-Gm-Message-State: APjAAAUUKHQVdUDFyNKJDumj3aq4PR2gyYx2qbat3vhDaKNoJ7afwt+s xNRYhArrhBVcqEMw6nqKcTk= X-Google-Smtp-Source: APXvYqzovu25Xh93eS5i9WI728LZP4TFmEiOkc764Y7T62dKsCFZMLaetBHEt9+L/8KfHBSTKqd9ZA== X-Received: by 2002:a5d:518d:: with SMTP id k13mr29586503wrv.40.1563956718056; Wed, 24 Jul 2019 01:25:18 -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.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:17 -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 5/7] backlight: gpio: remove dev from struct gpio_backlight Date: Wed, 24 Jul 2019 10:25:06 +0200 Message-Id: <20190724082508.27617-6-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=MWh9VGd2JwifXWatter5gVNCFGQvFvQYl1wPUfmq6BA=; b=Ru8/V2KuUXMTU8q4g8iglT+1D551XJ1jRu1e/mkMhxZ41/k+vNUX9+CBHpMMATMLcL qA7G90MOkXL0es1XDru84jIee/hoFp5YxCFwfo0CgWKkTkJSlHOqCEr1iMF31PkLvpAm vxWfi3/v9hnpL85NJbcn84NuLHK8ZwfNr8R1aicwnOSGGBohMr4+VtbWERpElGqBQvj4 J7dN+52l7aCDWASYucxYNDxixUcCvgVIwkPoWyDWNVcMPfl8K9m6vSmglYR+bwChB6TE SabhVALFMspdy8q97T4skJ5NHKGlkr5mA0aqOWlMKI4cH00E1sSr0uZYF75qmVgmJd/s Tr9A== 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. Remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 01262186fa1e..70882556f047 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -19,9 +19,7 @@ #include struct gpio_backlight { - struct device *dev; struct device *fbdev; - struct gpio_desc *gpiod; int def_value; }; @@ -69,8 +67,6 @@ static int gpio_backlight_probe(struct platform_device *pdev) if (gbl == NULL) return -ENOMEM; - gbl->dev = &pdev->dev; - if (pdata) gbl->fbdev = pdata->fbdev; 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); From patchwork Wed Jul 24 08:25:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11056725 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 ED0ED13A0 for ; Wed, 24 Jul 2019 12:21:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCB942863C for ; Wed, 24 Jul 2019 12:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D039D286B5; Wed, 24 Jul 2019 12:21:00 +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 8564428668 for ; Wed, 24 Jul 2019 12:21:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED97F6E4D7; Wed, 24 Jul 2019 12:20:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 944516E4B5 for ; Wed, 24 Jul 2019 08:25:21 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id n4so46004051wrs.3 for ; Wed, 24 Jul 2019 01:25:21 -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=HpxCRy2V5Agh4JLerbqys83epZFNSOhcfRgJphFvhIM=; b=PZ/Vk8UgeuYCaP/UAMDuvFxOSLPn5d0DgUTVMpg8/Etprr3Mqv6ufuw64S9E0wt5tp QD+Eu/fgCO3pZFdqN3gLDF9GNwJp4H9CSgZ92A8nN3BnkEL+Cep2Mybw6EsAJQsB+yuL 8nq+Hm5dfvvDmWuKgNJXYm5v/4Lv4qs70sApg1NfrhwyecMiRkMAf3Y9aQQ8GJr01uuD e+arYOlTSBCuf/klbV14iiVFpnpr1VV5VX54xjfkNpJJMLkWjdrguXZqoob84wyY9vsK isa5dfJerJndit9d/0bxibIyX2voemtnUO0niavQxJdk6ENw4G4iFvKuSSN4hTPT3NAW 5HYQ== X-Gm-Message-State: APjAAAWs0FDACOCA8zQ0G3n42awqvrnKRn81bkw6ODlUAgJxDyJ6WLhM JAjLYlNu+9K4l11aPelOADs= X-Google-Smtp-Source: APXvYqwH9jsfXEOv3fcGiDqEzST6zq9dWSrvlyiiGgXaYsEM7ZSrxfCt9vxBHSk4uEnWLIx49qhpiQ== X-Received: by 2002:adf:8bc2:: with SMTP id w2mr3587116wra.7.1563956720281; Wed, 24 Jul 2019 01:25:20 -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.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 24 Jul 2019 01:25:19 -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 7/7] backlight: gpio: use a helper variable for &pdev->dev Date: Wed, 24 Jul 2019 10:25:08 +0200 Message-Id: <20190724082508.27617-8-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=HpxCRy2V5Agh4JLerbqys83epZFNSOhcfRgJphFvhIM=; b=x19yNdi/wQM2QHEWsQ8Fml/XsADvHcBE6EJCk5MVdtjRIYLdcz8QxPF6qBAO/K2CdR FPqD88r5piJ1E8YFxjZL6g97vhm37EM9ZEeqHPRtITeuG9dgMFd6OI2rl3kcxyRxGr2/ AR5YqqHwRuiTh7exj0tZLBHZKBFwKtKGR3YMgT21+68aAndEk8RQF7rg4NUK2SiKQcHO rRqpGbAwY3EMvnAmAf58IAZZ3pEMM/x10whrww55L/YQ+PzmVafOq5xEQhagdFtY4f7R irg/VdMVaHIJMgs+Tc3kf4xhNgxgrtaUSIa1o0gFgToMLgCzbjz/eaoyeBumRIhB+oEA b5Jg== 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 Instead of dereferencing pdev each time, use a helper variable for the associated device pointer. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko --- drivers/video/backlight/gpio_backlight.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index cd6a75bca9cc..7dc4f90d926b 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -54,29 +54,29 @@ static const struct backlight_ops gpio_backlight_ops = { static int gpio_backlight_probe(struct platform_device *pdev) { - struct gpio_backlight_platform_data *pdata = - dev_get_platdata(&pdev->dev); + struct device *dev = &pdev->dev; + struct gpio_backlight_platform_data *pdata = dev_get_platdata(dev); struct backlight_properties props; struct backlight_device *bl; struct gpio_backlight *gbl; enum gpiod_flags flags; int ret, def_value; - gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL); + gbl = devm_kzalloc(dev, sizeof(*gbl), GFP_KERNEL); if (gbl == NULL) return -ENOMEM; if (pdata) gbl->fbdev = pdata->fbdev; - def_value = device_property_read_bool(&pdev->dev, "default-on"); + def_value = device_property_read_bool(dev, "default-on"); flags = def_value ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; - gbl->gpiod = devm_gpiod_get(&pdev->dev, NULL, flags); + gbl->gpiod = devm_gpiod_get(dev, NULL, flags); if (IS_ERR(gbl->gpiod)) { ret = PTR_ERR(gbl->gpiod); if (ret != -EPROBE_DEFER) { - dev_err(&pdev->dev, + dev_err(dev, "Error: The gpios parameter is missing or invalid.\n"); } return ret; @@ -85,11 +85,10 @@ static int gpio_backlight_probe(struct platform_device *pdev) memset(&props, 0, sizeof(props)); props.type = BACKLIGHT_RAW; props.max_brightness = 1; - bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev), - &pdev->dev, gbl, &gpio_backlight_ops, - &props); + bl = devm_backlight_device_register(dev, dev_name(dev), dev, gbl, + &gpio_backlight_ops, &props); if (IS_ERR(bl)) { - dev_err(&pdev->dev, "failed to register backlight\n"); + dev_err(dev, "failed to register backlight\n"); return PTR_ERR(bl); }