From patchwork Mon Sep 2 12:34:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7347114F7 for ; Mon, 2 Sep 2019 12:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52C7220820 for ; Mon, 2 Sep 2019 12:35:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="HKn491aj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731717AbfIBMe4 (ORCPT ); Mon, 2 Sep 2019 08:34:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45060 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731710AbfIBMe4 (ORCPT ); Mon, 2 Sep 2019 08:34:56 -0400 Received: by mail-wr1-f66.google.com with SMTP id q12so13812377wrj.12 for ; Mon, 02 Sep 2019 05:34:54 -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=u5S/jk4kN1cW3dXt1c4GIbV2CwRkei66gd1V6gGISEA=; b=HKn491ajfZEYRSluCvhIrCHY7+9bRctMymF6AhDpuHdPHdRZUKOHaHZKIecyzjhiW/ b1nAk+OBKgJldctBzlfm5v7WwX3UfptpC9zkiZgWztRCW2WMmxLCwXuW5F+xldmX9C9h lQx4iSLhLL6v2EUEg1hXv7Z/MvzrgN4omtwQjW09fsttzpGAAo+m28FH4LrGheRS2PwX 05VT34aZbkq1PV99nsYvuHFvaybdnwIpntv8H4Gi3i2XHEAXN9xr48gNL0pFf2Br+qDi WTFQPjefarIobm1KH/oPcVXCQrnlBQZ8b6DGHkAfO103tPJ3Xm08LIKUkqwclaay7pyN +4eA== 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=u5S/jk4kN1cW3dXt1c4GIbV2CwRkei66gd1V6gGISEA=; b=bri1wbpWuncxx1TCZrR55oSur52Gh3NDax8EXDkC5e5hewkeOu/WdiQ2Qv8AAlqp0A 5TD9y+bnck+Qo4LIv8/m3VXyWeq089MXJ/9d9bhVPzoo98glt6Epr0/VoItAeZBMcQ2N DGg/nz6wXMo98vGgzAQJG5QPih82djGx5uftAN8xK8m+MitI4Q8s2TH/OVJmZItMPh/o JGoTFm3Bwx5ELhzroLJKF7N6z1RXMVDq29kQAb4027WJI4O6ACsvULao89si2x9lZgvQ 8h5mPqqN36UE91bCTlNIZylI5UnPfJfyM/t9D7onOnDjj+7gjrOYCn9M3wXYY2iz/Vi3 ItSA== X-Gm-Message-State: APjAAAUBbNIdAVkxriDBkPF/dPdG+HkN+aCq06mNw06vhtjoxokYtnOU u8pDBCnAIYRewgCdGno4e5V0rQ== X-Google-Smtp-Source: APXvYqxTC0BM9tDm/ou/+6NHgIhl0sMhYD6xMWKqzgKkh8bJTTRx1y01GLTonCc+zkavzqLiw2nDkQ== X-Received: by 2002:adf:f705:: with SMTP id r5mr35411010wrp.342.1567427693786; Mon, 02 Sep 2019 05:34:53 -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 k9sm22645759wrd.7.2019.09.02.05.34.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:53 -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: [RESEND PATCH v3 1/7] sh: ecovec24: add additional properties to the backlight device Date: Mon, 2 Sep 2019 14:34:38 +0200 Message-Id: <20190902123444.19924-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 Reviewed-by: Linus Walleij --- 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 Mon Sep 2 12:34:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE9B2174A for ; Mon, 2 Sep 2019 12:35:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF09520820 for ; Mon, 2 Sep 2019 12:35:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="rmo8A0Zr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729962AbfIBMf3 (ORCPT ); Mon, 2 Sep 2019 08:35:29 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55180 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730428AbfIBMe4 (ORCPT ); Mon, 2 Sep 2019 08:34:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id k2so12966089wmj.4 for ; Mon, 02 Sep 2019 05:34:55 -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=BL5f9WSqt28IVM1CG9ys+RYTknuQ0t6Rc6b4s1XAIZ8=; b=rmo8A0Zr2T09cfLgGzsV0Bv0DY26U1tZoxBktgQg61gBBmcsgf7oBMC/JOqQUap7Vr Uxva4NKecBHq/4m6i7sdpbgu9CI/K679poVQjtDoeCzgT5Xwq3/1QcXUFf45+7bqRLq0 5CWLZLS4Vo1G3nUG1Xy9F9n9c4fynoLJZ/gE2KF3ZzwPFqw+sqwr/oBrrmloN/rnvkYi FkiGssbjvpCHYHWKU7uc2oxFkuZoOnZSh0Z6GOzJDmo8qYyOOEE2egU0TFImJ0P2qM7o eJaMEOjRkIzClQMCPKD/6LrBRaq8w4DAG5pvwgy+nuK+le1fggH+IeILoFvaKyujzQwV Md3A== 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=BL5f9WSqt28IVM1CG9ys+RYTknuQ0t6Rc6b4s1XAIZ8=; b=kUukURzwk+GdPVDDMcEQWo8MlXNZFfWASYdSnqJvZV4hLUQXYhq8Wkr+EIxualTNjk PAOYsN4Lz1yscVU8FfB+bhXErHr55UcYOqOWp8f33LwPkKndqTQYJIXk0sb26RPixL0C rbnwCQcbRw1tJsaAjxgWxXHJamdfW4AH0MsKwTRtq1oKA+0UjZPEbLyk17u/b4yVK/2f ueJ+9K+EIepP0tz4a/Pc+yZdsGuYhLaVhP9jKFq6uWmcwKn/T6MDQYmw1lsVsmc4icGT oEEuapGrN/wy036am9Er7HRp8FNYOpMU42CU6pek3YTeF51LWvjXFSrluWO31qCgfxzR RGNA== X-Gm-Message-State: APjAAAWacSQ37lddrEFPqOSwPcmDxVVHaCtReX4sdrsay1Ze2KLMsFkR dnGoni+h9IxMACQAUdEB5EU1BQ== X-Google-Smtp-Source: APXvYqw1vz/mtFNdoDGOV50/DImERrrRBV3tvDbaoTe+05TZiaB3djOsEA+nb+UY0M6oucgCg7AZUQ== X-Received: by 2002:a1c:2b85:: with SMTP id r127mr19669113wmr.30.1567427695064; Mon, 02 Sep 2019 05:34:55 -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 k9sm22645759wrd.7.2019.09.02.05.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:54 -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: [RESEND PATCH v3 2/7] backlight: gpio: simplify the platform data handling Date: Mon, 2 Sep 2019 14:34:39 +0200 Message-Id: <20190902123444.19924-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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: Linus Walleij Reviewed-by: Daniel Thompson 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 Mon Sep 2 12:34:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 872BE1398 for ; Mon, 2 Sep 2019 12:35:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 68E6E23431 for ; Mon, 2 Sep 2019 12:35:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="S02UO1ON" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730433AbfIBMf0 (ORCPT ); Mon, 2 Sep 2019 08:35:26 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:33653 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731719AbfIBMe6 (ORCPT ); Mon, 2 Sep 2019 08:34:58 -0400 Received: by mail-wm1-f67.google.com with SMTP id r17so11858270wme.0 for ; Mon, 02 Sep 2019 05:34:56 -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=XOZ9G7G9MWu3PapBqwm76MzTbTk7qh7g47mE4DOAzps=; b=S02UO1ON99M1ouFNv8Fx0Xfkw7LOATunblr4HuZkddsYv/0NpCFEoEpOmOcnwsI8nY VElm2FAR+R/tHlyAC8hk1GoYi6+xQwuNbqFjtLSO0CpOk3Tzs3VdS93tFz15As0KPeBH UPJ7XsSxHjHFbfU3clWqLaBu5DJoT+go9nASHDJLsIIUvm4cscKqWHqdTjyrvLVQbPsW LiSHRSxqkQpNj6t15AFHNOTC8jy+ckjaVKdloIB83XMyl6hKi02d1Js3e6kCUlsZRK4a WvMbpKsMfc3vqm3H/Ee0G8Lkc3dJSCDM6c3tKCCq/WXG1oKwVrALh2/fv9nq4ZpO3nO5 7Wlg== 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=XOZ9G7G9MWu3PapBqwm76MzTbTk7qh7g47mE4DOAzps=; b=SixXPfDf3qS6Lh2i23ewWg7ZCEBZMk4/tKqNckLiXB6FeeCilzwUMqgkyfeFDVHpFV A1RabJfaKAU4S0tZLuRXySys8KWjBq3zq1PQ3e+udW4iMQp272iA/Vz4orXsGwPEMhF9 Fu2pHLwHRxsl9EK8VUBixcvXUjGKClZ9oXWyFDyq5e3SLLpEeyxnpA8h729As86tkAit ds9xtWYdPvqGJZMm2gxQmlDXp7E2HJDQCmekFAYixo8nh6vQ49jPKKEw0oS8kg9KjIq1 gTD3p6gcA173tXQkNrpiEvKz53m1Wvq5NI4vacIYeJsRJdw2ztTABw76orpLfzyycGuI P4SQ== X-Gm-Message-State: APjAAAVzseGKacgJwvVRrlkoNsRpkVkod8Jf0uu705si10BQhszno50H aR4SALkNKXrkcUpTqUE3gAUfXA== X-Google-Smtp-Source: APXvYqyPyCZkVkGyJylO/Z4gFXwGq95akjDrBPerrKkIdPHewT4cqgI0NrgE4gHZcdxk3CuDm2BYqw== X-Received: by 2002:a1c:eb13:: with SMTP id j19mr33248298wmh.18.1567427696092; Mon, 02 Sep 2019 05:34:56 -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 k9sm22645759wrd.7.2019.09.02.05.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:55 -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: [RESEND PATCH v3 3/7] sh: ecovec24: don't set unused fields in platform data Date: Mon, 2 Sep 2019 14:34:40 +0200 Message-Id: <20190902123444.19924-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 Reviewed-by: Linus Walleij --- 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 Mon Sep 2 12:34:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C009E1398 for ; Mon, 2 Sep 2019 12:35:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0A9521881 for ; Mon, 2 Sep 2019 12:35:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="RiF6eugg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730660AbfIBMfT (ORCPT ); Mon, 2 Sep 2019 08:35:19 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:52350 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730893AbfIBMe7 (ORCPT ); Mon, 2 Sep 2019 08:34:59 -0400 Received: by mail-wm1-f65.google.com with SMTP id t17so14412820wmi.2 for ; Mon, 02 Sep 2019 05:34:58 -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=bHnB1L+P4+1aGMlVqMp08Ixue8e2E9v91GNi38QqZ9c=; b=RiF6eugg6V5iUB4obVg0sR7cypt5WU9YOMFriMux45aF+xW0zjazRTUXDi8WQsm1NS cprxfuxAqEy1Vi9GNJuDxtyOJDs3NxNE7C9s+QOaAzCiVDn2YZrr63DziJcnmI8NAv6z CuhKqFsWHUkId5jp1hhvWrNPeh89aSuhuLHbvxngPoxOuZPuhkBFz3kpHI3Jg0qgWfoc u8WqJ+8E8Y7kDB7zjnn4AFUOKg32D33j+AOOEfYjKVQeir7zocUMw1Wf9W8dQZVBlkyG zfDL4DzrWaWUq8JzI6ZajlZ06ZiDjw88IY5cycMsHkilxMazzMWK6wmmV/gSarzR6D2b kETA== 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=bHnB1L+P4+1aGMlVqMp08Ixue8e2E9v91GNi38QqZ9c=; b=nQRq8iVoMDY33jxYzIXAry8prZvw1/cJCQ/thm06QzITaoB30/SQ4HDQGB5qILoDa3 Qno6UjbvMidJo6B76+pNgctPBfhYXLs+QLw3qGX6NdDt3U2wyDDw+xNe0YEyOJ0ehLXH 3kcQygMrvE98XKKdPZS4DJB+zlIhpTuQUDHu81WPFTPS7KHbHOdYgAfPdT7inohWjYSQ B1v1h7j8gEFEEsPukwdQ97LMDBSYuep2AchXy7vGbafBzIqri5pTQW/TM/rGypXa+g7g g/UlZb2lfQ1sd8ws9NLQ1nsxfNVPulNLinBF7qSjx/c3QIrGrchUYexN6B/Eofbi9hsL 6V2Q== X-Gm-Message-State: APjAAAWUKMSGJ1OmkHIRsCiMsUQwumcZVqyaHLzEtRxiUVAdNustKd/l 6WvqGtBQstjZZopWwYOHHzYo7g== X-Google-Smtp-Source: APXvYqwFfCqx6lY10v5xazk7iXImJ1ceSZ7J4x9MKHeaOck5dr4/AvcHY1Tlp222xnKOcnKqL+InVA== X-Received: by 2002:a1c:7513:: with SMTP id o19mr34854600wmc.126.1567427697250; Mon, 02 Sep 2019 05:34:57 -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 k9sm22645759wrd.7.2019.09.02.05.34.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:56 -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: [RESEND PATCH v3 4/7] backlight: gpio: remove unused fields from platform data Date: Mon, 2 Sep 2019 14:34:41 +0200 Message-Id: <20190902123444.19924-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Bartosz Golaszewski Remove the platform data fields that nobody uses. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson --- 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 Mon Sep 2 12:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2727E174A for ; Mon, 2 Sep 2019 12:35:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07CFD21881 for ; Mon, 2 Sep 2019 12:35:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="C6XzL5/w" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730553AbfIBMfS (ORCPT ); Mon, 2 Sep 2019 08:35:18 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39217 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731752AbfIBMfA (ORCPT ); Mon, 2 Sep 2019 08:35:00 -0400 Received: by mail-wr1-f68.google.com with SMTP id t16so13860595wra.6 for ; Mon, 02 Sep 2019 05:34:58 -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=kgBvf4zqwAQJv/GXaUjvZU5ag1nyWnXo4YV3WG7Ae5o=; b=C6XzL5/waF9VCI8FKaC3DLJDZnEZWUCzbxeOgeeuNAvrmhTI3rHWakI5JfRxD1Cl3D JWafVk5sffNt/4RsCDXmKm724kCINFyKh57SDumOBlip733qO2wJrJYiREH0jg4o/gJM r28wVehv8yZFrfSpmUgHfNKd4llcfdb0GqTRxAEhj4kGlNCsKQfMjiDUTC1NtmC3RI2x lCzki+zzTTjTRH1KiGH5neRH0P+zQ3Xl7G9DfpVpBhrLjgZ/ns8Rs9cduq/Wem+2Bs3R EVEYNsM5VS1hmUaHZhnKV0trc0ESqu1KbxLtg/QQapY2oQ2OtqRhQddTU4kLvTc2IbtC TX/g== 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=kgBvf4zqwAQJv/GXaUjvZU5ag1nyWnXo4YV3WG7Ae5o=; b=qTckCUwlTbyklxkTnb1cttCyMfvaj7r107ScOU2Z1HSLAxSXlllZgkpHtbXXwSk+CJ wHpKQrogKK7u7SG3b4YcKbiqO3lr4EKElcueDBBtlhbAgFIfvsoZd9h2jm9J1yEtrE2X brFAhkpveeH4Z9blXo6DRSzRnIlb7N3Yzy0+tUSGItcRtKKzNy6legnze+qJWLQHjsHV NQqcDp2gk/hNTiol29aevtKmREhc5c4UmVrl0o9T4kpOfVwdC7KoE5Bi/PDX8L/GF110 QIq55A95KPFUkR8d+/pgWOcPIiFIxpmU6yyFU+rtJpR5m+Ez/iVUATaNpMvKgJNzfPsm ytAg== X-Gm-Message-State: APjAAAU89A6N4EImq5YzTH7dZ6I7f7C520/w4nVB628kFeBlVfnPuZjg yWy3IU60AK+hvQFNTMUuQvRbuQ== X-Google-Smtp-Source: APXvYqxTkcUgrlnixPmCpMUNG4mBIrhYfybJ1WjXE4s7spBPEtnz5QL08Sn51rgvc6+rNUL371Bx6w== X-Received: by 2002:adf:e7c4:: with SMTP id e4mr32496736wrn.62.1567427698362; Mon, 02 Sep 2019 05:34:58 -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 k9sm22645759wrd.7.2019.09.02.05.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:57 -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: [RESEND PATCH v3 5/7] backlight: gpio: remove dev from struct gpio_backlight Date: Mon, 2 Sep 2019 14:34:42 +0200 Message-Id: <20190902123444.19924-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Bartosz Golaszewski This field is unused. Remove it. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Daniel Thompson --- 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 Mon Sep 2 12:34:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126571 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F31A31398 for ; Mon, 2 Sep 2019 12:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D20C521881 for ; Mon, 2 Sep 2019 12:35:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="lwjSsLjU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730441AbfIBMfR (ORCPT ); Mon, 2 Sep 2019 08:35:17 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:40561 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731766AbfIBMfB (ORCPT ); Mon, 2 Sep 2019 08:35:01 -0400 Received: by mail-wm1-f67.google.com with SMTP id t9so14423089wmi.5 for ; Mon, 02 Sep 2019 05:35:00 -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=iBLJsFDHxwQO5fDJ/0XiJk/ChmWyJTLddlv7y7zlKto=; b=lwjSsLjUer1VFsgWsDkSA4eN6sALaf4s+oUA+k3XyXbOV0PLVLfHF1wEBKgjAUsM7B FqlsuujinuKAzlU/2L38daWRY1ekKA01/UqW69QBIURMfm6KK9bUojE4BNJvIZx0HFpC ISx/AmjTBTU9c30Fsu48V5cGMES1/BdDcqgBSsXZxUErSspRTJFgFwwYlOz+PnigdkOL eUPhvmAOL418pfzBbbfsKKpec96TNxLRjPJvpmP98sRtW2XO5kIoPn17kwq9sN/SQMjj 6B5pZamHMxUOAXR2CtMRs3dkTOVI/fxhmBZ0DPZW4nxgFnmr9naHl2XEp7Z20DmqMXUs UQ3g== 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=iBLJsFDHxwQO5fDJ/0XiJk/ChmWyJTLddlv7y7zlKto=; b=sN+zXy8hUbxwcWz9KuwsPSHcSP3yjsp0A5tKsn/qB4aoK3KPOMJD0Kf3xwUHGl1eW1 axbT2AmwnmOZ53N812ry/AKwlNQmYOSCBNmoxV6cVlX/WgK6vvalnyBK9172Dl64T3GC pWFbGeBGYmpP0VT0anfsYdywk6BWqyPZX1pel4dfJlG3TK13hpbYYP4o2F1KQBFRhPaA C4w4ESJpb8ufZUIYFAI9VkNVUF4rtnZKhq+V5Kc9kO4Xx+zFPriVxurK+fzMhH6kfmim RF5Bldm78ntA9ZcnHLr8zHjMFbmAPjVgVlP+3pVHOIG1hk9r5MdNKxNyr7yKBU5LxGO6 YytA== X-Gm-Message-State: APjAAAXMul7W3RSEQ6j3VahU174cfbCTAO2r4JHsXtlzw0IiD3N+sapk Gcu1P6FGFRGZ1X9Iw3X1L8qLGQ== X-Google-Smtp-Source: APXvYqwuZajd1J/NSYA/QGRzkfcMxV+ED2cD7wbF0dc30G/G6uOz9gOEoa4lQU/BcyHW3BPU/kspoA== X-Received: by 2002:a1c:f103:: with SMTP id p3mr34157179wmh.18.1567427699432; Mon, 02 Sep 2019 05:34:59 -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 k9sm22645759wrd.7.2019.09.02.05.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:34:58 -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: [RESEND PATCH v3 6/7] backlight: gpio: remove def_value from struct gpio_backlight Date: Mon, 2 Sep 2019 14:34:43 +0200 Message-Id: <20190902123444.19924-7-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@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 Reviewed-by: Linus Walleij 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); From patchwork Mon Sep 2 12:34:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 11126569 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 10B74174A for ; Mon, 2 Sep 2019 12:35:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E563D21881 for ; Mon, 2 Sep 2019 12:35:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="ix2RLbgR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729489AbfIBMfQ (ORCPT ); Mon, 2 Sep 2019 08:35:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43738 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731773AbfIBMfB (ORCPT ); Mon, 2 Sep 2019 08:35:01 -0400 Received: by mail-wr1-f68.google.com with SMTP id y8so13826416wrn.10 for ; Mon, 02 Sep 2019 05:35:01 -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=/jAAQVre0ugDaUipQgqAVWSbxc2RrUvIHMN/mo5I6Jk=; b=ix2RLbgRG+/MjkM1kHz/0CXUG+C5ZIK5V64NA/yDf8xWlkJ4nTutymQGoPCwn476MX QXnJ5G0wXg3iB0Z4oVOp1Fg9IF7rmCU24zFapX9nuNXsKCIyzOSR+ELh6CK177dlLV3p IbtSs2c6+mOp0J4Qg2WnET15lEKl3g/BPWztmy9be0IQiAH5qV8Fs3GYmQGjow3GTwdZ 77nl9rDpzIJuaxNNfSJe3LyACtKBt3cuB53O2TpphtrZ52yJjxFytYCLcCUcxuAnoN2J 0IMhGJfREq3FqBDrhOm1266/WCKLM1kqXAM8TnhvADcIcWigXhae1L6iap5xxZRkGnWD bcKw== 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=/jAAQVre0ugDaUipQgqAVWSbxc2RrUvIHMN/mo5I6Jk=; b=mYgWSXsXFX+AXcB5yCNnbJmsFSnUYml0PSiUOWrXT20Q+8T9RtOZVcDAH36FCxNIrr wFsJsWPSIVoJOOlUqZjukParhN1o+x68bGADeFgYukaohDuWnbneoaKAkBn7dxRrcVFk TofacHD84rvyeBlyUvxjBjiqYpcUEuc3RkjShP5L5UCr9EkpFXJ4yEtBcG76M6w7RejE cn20EtZqoJCtAF66CggGKBz2Zi+ueeIApJI/xT2C2oN+6lL4IswhCitlJN+YofA/kcPV kDc0gYweyTlvKUAtStRHaSYhLVSTRcV3i/USR0FydK5RrxxV4Mtkf95qwEyKC4GCxP+b H9Sg== X-Gm-Message-State: APjAAAVfMluRGJfcoeCTw0rIhik4boVGdWiPdMdKmoMhHGBkQlgTgSx/ xh+KKkbLAWvp4USLXwQB4ONTAw== X-Google-Smtp-Source: APXvYqwj4ObCHBjkI+G6B9G9wba9BtxdUwO5yxmXy1uG3RpakaYj27cBRQ5d9KFAlmxR7q5FsHOggg== X-Received: by 2002:a5d:5612:: with SMTP id l18mr18125016wrv.177.1567427700581; Mon, 02 Sep 2019 05:35:00 -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 k9sm22645759wrd.7.2019.09.02.05.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 05:35:00 -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: [RESEND PATCH v3 7/7] backlight: gpio: use a helper variable for &pdev->dev Date: Mon, 2 Sep 2019 14:34:44 +0200 Message-Id: <20190902123444.19924-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190902123444.19924-1-brgl@bgdev.pl> References: <20190902123444.19924-1-brgl@bgdev.pl> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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: Linus Walleij Reviewed-by: Daniel Thompson 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); }