Received: by 10.223.185.116 with SMTP id b49csp1090229wrg; Fri, 23 Feb 2018 11:45:35 -0800 (PST) X-Google-Smtp-Source: AH8x224RZc+ED9AWw+VuPXELTpO1MNrQHruc5v0tDlS65upTrLcrkG+Uh6ekaOwOl7lzwNh+8d5G X-Received: by 10.99.50.66 with SMTP id y63mr2311536pgy.207.1519415135874; Fri, 23 Feb 2018 11:45:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519415135; cv=none; d=google.com; s=arc-20160816; b=a80y0SWerMUkz4dSgIAL7t1nVVJU1QvQ3PJqKcJEiyMhUCDYzBIU61I+rmKWqrnz89 UoKOHlwM/zQhKrWGwvMYU1wqq6RlvC3zZMvrVe9CAlxk3m6x1KFoHACORCbUUwGPCdXq 4VtJU4vEUqBczUOGJeJ5v+wHYrmEotSIYASOeZq2m6odUzz8PRHcnxp+cJfGmos9mpbz uQvjMcpN8LftyoHO3TEpck2163BoSL3csmPPsrxo4TkjasdT6OwCwmdanZGiRsVcHSBP U/S06qwHxKyURS8m0mytQWRVH/iWyB3IAP6/W0ElOHGMVjEW1V11k4MGOUeCH2kj/ENj kpjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=bVDqvbewGWhETiK9GARdH1+nxuf2451qyiXfdpCGy04=; b=UaRiOug8QdlrlVHtdbOv/15XeCwnlQkO/MRPkPM1sKtBz1lrTWVmoF4WeKK2Six870 9p/d92vPuFaIjIrvFb1C5hkYH5WHUo+LUL+AWNpYc5OmCdhPECksV6LejBaxfBDS1En5 jOMr/qFSkVSDpIiJUsEulLMQhXR84muzNyr2fbIgeFoz+HUlfZaygXsozZxWuGmTQUvj DJlyOJWba5f/maf1uuqBrNHpUoYC1Zzx2Yx8Lb6b7noWjdSj+7Q9ZZp+f6+vfH04Shi7 ePXeX4o4oh5lXvK/kESV6Jx9iffdrNvqVeH8tqNYNHAwAwxDvVKb1d6C079YFdkCQUXU cDoA== ARC-Authentication-Results: i=1; mx.google.com; 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 p8-v6si2244154pll.84.2018.02.23.11.45.21; Fri, 23 Feb 2018 11:45:35 -0800 (PST) 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; 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 S1754883AbeBWToc (ORCPT + 99 others); Fri, 23 Feb 2018 14:44:32 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44888 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934356AbeBWSsU (ORCPT ); Fri, 23 Feb 2018 13:48:20 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 92B3E10B6; Fri, 23 Feb 2018 18:48:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Arnd Bergmann , Daniel Vetter Subject: [PATCH 4.9 134/145] drm/i915: hide unused intel_panel_set_backlight function Date: Fri, 23 Feb 2018 19:27:20 +0100 Message-Id: <20180223170742.096376139@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170724.669759283@linuxfoundation.org> References: <20180223170724.669759283@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit fd94d53e55bd487368dfee9f1af24da78b2bb582 upstream. Building i915 without backlight support results in a harmless warning for intel_panel_set_backlight: drivers/gpu/drm/i915/intel_panel.c:653:13: error: 'intel_panel_set_backlight' defined but not used [-Werror=unused-function] This moves it into the CONFIG_BACKLIGHT_CLASS_DEVICE section that its caller is in. Signed-off-by: Arnd Bergmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20171127151239.1813673-2-arnd@arndb.de [arnd: manually rebased to 4.9] Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/intel_panel.c | 86 ++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 43 deletions(-) --- a/drivers/gpu/drm/i915/intel_panel.c +++ b/drivers/gpu/drm/i915/intel_panel.c @@ -544,25 +544,6 @@ static u32 pwm_get_backlight(struct inte return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); } -static u32 intel_panel_get_backlight(struct intel_connector *connector) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 val = 0; - - mutex_lock(&dev_priv->backlight_lock); - - if (panel->backlight.enabled) { - val = panel->backlight.get(connector); - val = intel_panel_compute_brightness(connector, val); - } - - mutex_unlock(&dev_priv->backlight_lock); - - DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); - return val; -} - static void lpt_set_backlight(struct intel_connector *connector, u32 level) { struct drm_i915_private *dev_priv = to_i915(connector->base.dev); @@ -646,30 +627,6 @@ intel_panel_actually_set_backlight(struc panel->backlight.set(connector, level); } -/* set backlight brightness to level in range [0..max], scaling wrt hw min */ -static void intel_panel_set_backlight(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - struct drm_i915_private *dev_priv = to_i915(connector->base.dev); - struct intel_panel *panel = &connector->panel; - u32 hw_level; - - if (!panel->backlight.present) - return; - - mutex_lock(&dev_priv->backlight_lock); - - WARN_ON(panel->backlight.max == 0); - - hw_level = scale_user_to_hw(connector, user_level, user_max); - panel->backlight.level = hw_level; - - if (panel->backlight.enabled) - intel_panel_actually_set_backlight(connector, hw_level); - - mutex_unlock(&dev_priv->backlight_lock); -} - /* set backlight brightness to level in range [0..max], assuming hw min is * respected. */ @@ -1122,6 +1079,49 @@ void intel_panel_enable_backlight(struct } #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +static u32 intel_panel_get_backlight(struct intel_connector *connector) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 val = 0; + + mutex_lock(&dev_priv->backlight_lock); + + if (panel->backlight.enabled) { + val = panel->backlight.get(connector); + val = intel_panel_compute_brightness(connector, val); + } + + mutex_unlock(&dev_priv->backlight_lock); + + DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val); + return val; +} + +/* set backlight brightness to level in range [0..max], scaling wrt hw min */ +static void intel_panel_set_backlight(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + struct drm_i915_private *dev_priv = to_i915(connector->base.dev); + struct intel_panel *panel = &connector->panel; + u32 hw_level; + + if (!panel->backlight.present) + return; + + mutex_lock(&dev_priv->backlight_lock); + + WARN_ON(panel->backlight.max == 0); + + hw_level = scale_user_to_hw(connector, user_level, user_max); + panel->backlight.level = hw_level; + + if (panel->backlight.enabled) + intel_panel_actually_set_backlight(connector, hw_level); + + mutex_unlock(&dev_priv->backlight_lock); +} + static int intel_backlight_device_update_status(struct backlight_device *bd) { struct intel_connector *connector = bl_get_data(bd);