Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp1330681rdb; Mon, 21 Aug 2023 04:51:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAbw2jHhA7YBFfcwEnu2/K6Uy4sFlTlJUTVHOTGvFEbAaFu3rf2ZlY++n2aLJro6m5r7Ry X-Received: by 2002:aa7:d058:0:b0:523:406a:5f6 with SMTP id n24-20020aa7d058000000b00523406a05f6mr4789693edo.12.1692618716927; Mon, 21 Aug 2023 04:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692618716; cv=none; d=google.com; s=arc-20160816; b=sc0Ck2nZvaXmwmD5m4gXqDpkdRVT9M8LOEL3taYpfB2Mj6Irff+FRfUH8q7GV+nJP6 yfbK2JisTa2DL0H39gMFCr1+iQs3oc3GVugGYDjOkuOutq0YrbEguu86gKPtnNJyfBwV k0TovFqzDlCAuo2S4cyGkzmUhZOV2F0N+R1bk68hNKurAtxS78IBDxmr61X9Xw7Mlvls p7utNb4tUqDbrxNSjEsL8Yt3eWuXJNI8XjMZOPxw2Yq7Q1lO/SfaI4Fs+5DQk509O/hs N6M9cmkYH6nTbbufOJeAh/42RkTac4u8Dewt97nR+El/+VTBLtHX29rtKmRWNCFR3wIb Jrbg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020aa7d84f000000b00523384d70eesi5402563eds.416.2023.08.21.04.51.32; Mon, 21 Aug 2023 04:51:56 -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 S230487AbjHTMiw (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-Type: text/plain; charset="us-ascii" 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 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 */ -- 2.40.0