From patchwork Sun Aug 20 12:36:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Jinchao X-Patchwork-Id: 136255 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2476311vqi; Sun, 20 Aug 2023 06:19:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHtVztoYQyVh5Gfqar/P7MFKvsESP9i6a3LFkfG0ODV/aeXueqVMjGjZAo0P7i6QNh309Q X-Received: by 2002:a05:6870:80d3:b0:1bf:26f0:6b5b with SMTP id r19-20020a05687080d300b001bf26f06b5bmr5837892oab.32.1692537582528; Sun, 20 Aug 2023 06:19:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692537582; cv=none; d=google.com; s=arc-20160816; b=hOsb3QVkNxwGpLsOObrVmlb9S5+fRaQwxaopFmLoFyozyYpUXSRDAJeXOy5qwgmrjK iSVg3yKuNeOtkDzgQ6Vx/ykJ5Lot6A/fdxMPEjztl3jvMbg7D/jWoTFiLJsecg47vSW3 1PcfcLPG7qGUbYuLY9XiGzCF8cT+mtzXWaH++GDOfk5+S1UfTUbnn2NO/EMzswi4Bjap LRe7csdeE38d+CUYbR7QN7niLD1IDzS/wPYOe6LwsTZyCY7jgtnlNjAvdxVDNfj8W6Jf BG0SZc1VtiQsWbXockfWEYeNJ2Pa9pERo4LVuJ03H3A8YayA4M6xdq297vhz2jv38hgq U/TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:reply-to :message-id:subject:cc:to:from:date; bh=f/QFdML5dCKA8iUWrPO+h9UQBLmcGvZ9300xDYAXJGo=; fh=+NJ84h4fOLCbnqbXn2wYmfOGCAp7FfvVWHx+50aaS5Q=; b=SgC/rbl63S0IN/66R6+kX++OEucjqMga+FGwEVBtk2cBDrJMqd1BSSZYa+1vZmRCHY HQwLHetofc66MGM0dV7i/9O6DnZLSBRopoMzgwET3XMIZAo/kGPipcBRXCztIzXj6S/U laFhivXwd9wGOCoEozxFKZ3SvUkYM4qXDax7x2LgMjE6WX7vpJ5qsx5CkktMmHuTtYfm mKGRgikbY7rjebjaW8AG33famhl6oOTaclU5Szqs/eGuHuxXQNMcHL8xqGOw1UAUUjL6 UbDkIEsacogdw+1kqb22PaE/e5xHYlcmwLdvI0A5z3Oig9cgUcL3STH35pG89UvTC5EC mD+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id az23-20020a17090b029700b00262ff3a4545si6832773pjb.169.2023.08.20.06.19.29; Sun, 20 Aug 2023 06:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjHTMiw (ORCPT + 99 others); Sun, 20 Aug 2023 08:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbjHTMis (ORCPT ); Sun, 20 Aug 2023 08:38:48 -0400 Received: from wxsgout04.xfusion.com (wxsgout04.xfusion.com [36.139.87.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4534E30DA for ; Sun, 20 Aug 2023 05:36:52 -0700 (PDT) Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4RTFSV37CMz9v7dp; Sun, 20 Aug 2023 20:35:22 +0800 (CST) Received: from localhost (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sun, 20 Aug 2023 20:36:46 +0800 Date: Sun, 20 Aug 2023 20:36:45 +0800 From: Wang Jinchao To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , , , CC: Subject: [Intel-gfx] [PATCH v3] drm/i915: Fix Kconfig error for CONFIG_DRM_I915 Message-ID: Reply-To: MIME-Version: 1.0 Content-Disposition: inline X-Originating-IP: [10.82.147.3] X-ClientProxiedBy: wuxshcsitd00601.xfusion.com (10.32.135.241) To wuxshcsitd00600.xfusion.com (10.32.133.213) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774754288024588711 X-GMAIL-MSGID: 1774754288024588711 When CONFIG_DRM_I915 is set to 'y' and CONFIG_BACKLIGHT_CLASS_DEVICE is set to 'm', we encountered an ld.lld error during the build process: ld.lld: error: undefined symbol: backlight_device_get_by_name >>> referenced by intel_backlight.c:955 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_register >>> referenced by intel_backlight.c:971 >>> vmlinux.o:(intel_backlight_device_register) ld.lld: error: undefined symbol: backlight_device_unregister >>> referenced by intel_backlight.c:999 >>> vmlinux.o:(intel_backlight_device_unregister) This issue occurred because intel_backlight_device_register and intel_backlight_device_unregister were enclosed within \#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) and #endif directives. However, according to Kconfig, CONFIG_DRM_I915 will select BACKLIGHT_CLASS_DEVICE only if ACPI is enabled. This led to an error when ACPI is not enabled. Change IS_ENABLED to IS_REACHABLE and use IS_REACHABLE to encompass the implementation of intel_connector_register() to solve this issue. Signed-off-by: Wang Jinchao --- drivers/gpu/drm/i915/display/intel_backlight.c | 2 +- drivers/gpu/drm/i915/display/intel_backlight.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c index 2e8f17c04522..d812cdc74a84 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.c +++ b/drivers/gpu/drm/i915/display/intel_backlight.c @@ -795,7 +795,7 @@ void intel_backlight_enable(const struct intel_crtc_state *crtc_state, mutex_unlock(&i915->display.backlight.lock); } -#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) static u32 intel_panel_get_backlight(struct intel_connector *connector) { struct drm_i915_private *i915 = to_i915(connector->base.dev); diff --git a/drivers/gpu/drm/i915/display/intel_backlight.h b/drivers/gpu/drm/i915/display/intel_backlight.h index 339643f63897..207fe1c613d8 100644 --- a/drivers/gpu/drm/i915/display/intel_backlight.h +++ b/drivers/gpu/drm/i915/display/intel_backlight.h @@ -36,7 +36,7 @@ u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 leve u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 level); u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val); -#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) +#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE) int intel_backlight_device_register(struct intel_connector *connector); void intel_backlight_device_unregister(struct intel_connector *connector); #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */