From patchwork Tue Nov 8 16:12:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9417691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4BB516022E for ; Tue, 8 Nov 2016 16:12:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E08D286B6 for ; Tue, 8 Nov 2016 16:12:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32EB2287EC; Tue, 8 Nov 2016 16:12:46 +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=-4.2 required=2.0 tests=BAYES_00, 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 B1074286B6 for ; Tue, 8 Nov 2016 16:12:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00EC16E583; Tue, 8 Nov 2016 16:12:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 611D46E583; Tue, 8 Nov 2016 16:12:43 +0000 (UTC) Received: from wuerfel.localnet ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0LvkMO-1ctZxk1Hum-017UNe; Tue, 08 Nov 2016 17:12:32 +0100 From: Arnd Bergmann To: Lukas Wunner Subject: Re: [Nouveau] [PATCH] drm/nouveau: fix LEDS_CLASS=m configuration Date: Tue, 08 Nov 2016 17:12:30 +0100 Message-ID: <7299445.oinG8ujhC7@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20161108160701.GC6983@wunner.de> References: <20161108135721.2142330-1-arnd@arndb.de> <12373137.2mgsQIhOfV@wuerfel> <20161108160701.GC6983@wunner.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:XlPTDgRN7j4c1pA8H8ZsI9s2lzPWi1SNcUFbbtwTC6xlDIg/Avk i6lZ+NOXscq4Jj3zLDjEFQTRF7+rRFeDtl6TEEjADFHdyGI40JA+LAQP7AqeOkP+no/t3rn da1E5+wGb+i43bS5oAuLrjctmYooncr5QkzHQamYFyTePXnefNtW62jk3R4oPoX36oDzzb0 e8N0v80tNTKudgLD+qhYg== X-UI-Out-Filterresults: notjunk:1; V01:K0:yL2r85cKF0Q=:pxYtnEIfoOSHOB1hFIeatI jun70Epluh1RRgu7i4GWRNM3Cfd5vlY+NqQtHO6rrvL8+LSGTB9cmwSzY8tDb5qhUPMZ+LNIn Is+faHZ0TVZm8teplW9xQK59WNpAUggIaGTcNWK/kXChEWBWHfENhNeAUfqNcIZP3Caj8Fw59 WWmCYdsr1cwxt6UnA6ehiFJxxIo5BV907UuwLQFsBbBSVTJjtvXULdLAhSo8erabof+ZDXpSw igcxnS12UTu2G+LnfrxSpCtVPOxIj2eVlo3S4D/8aESi4eLCjxA5Mh23Vnf/o5uBX0dQ6Pyoh qRJMwmZ81ArUys9nuhIDkMbruLw23SnJOwCi5F3qtCRhTvuOjoEu947d7RC4xdDnv/cqysQ7l Q/MA/khIiF7T6KkEebgECq7R+Ae2sUuvZMZG+9Wm31FKsCXY9L/sxZ4ALCQACRs59BHj/C9vC 2GexQnA6+U/IZ/UgvDzG7T6P3jwNO8WCaWxGT+Jvi1Uht4lrlAGlyATaY3Zv/N9x15yeB0mn5 YcRhOhOXGI8xV12LBtTGEAAvVIchwH8C1E9EjLby7AHlY85VYhQLMMsQMRQ1gtUzOocDhXIo8 KJoK5zVznzA+t4hklJ/IYWKhUevUEr5IDx498a2EnCCrVbjaJ2XnjBtuyCcWRVX0ZJ/8PQq6J id/q0yOJ9sn9R8R4BEI/HNQLlcGkPfHu9exWZiUi/l/eV/O9yBNCoqevj8mjx/8RAKtCDOQsu /9Ipd1zsLfdPunl3 Cc: "nouveau@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , Ben Skeggs , "linux-kernel@vger.kernel.org" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tuesday, November 8, 2016 5:07:01 PM CET Lukas Wunner wrote: > On Tue, Nov 08, 2016 at 04:52:49PM +0100, Arnd Bergmann wrote: > > The underlying problem is that we already have a number of other > > symbols that either have "depends on LEDS_CLASS" or > > "select LEDS_CLASS". To clean that up properly, we should either > > make the symbol itself hidden and only select it from other drivers, > > or use "depends on LEDS_CLASS" everywhere. > > > > Another option is to use the IS_REACHABLE() macro instead of IS_ENABLED() > > in the header file, to stub out the calls into the new file, but > > that can be a bit confusing. > > Why don't you just add empty inline stubs for nouveau_led_init / _fini / > _suspend / _resume? > That's what I was suggesting: The downside is that now the nouveau_led_init() just won't be called if CONFIG_LEDS_CLASS=m and CONFIG_DRM_NOUVEAU=y, which can be surprising to users. Arnd diff --git a/drivers/gpu/drm/nouveau/nouveau_led.h b/drivers/gpu/drm/nouveau/nouveau_led.h index 9c9bb6ac938e..bc5f47cb516b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_led.h +++ b/drivers/gpu/drm/nouveau/nouveau_led.h @@ -35,21 +35,21 @@ struct nouveau_led { struct led_classdev led; }; static inline struct nouveau_led * nouveau_led(struct drm_device *dev) { return nouveau_drm(dev)->led; } /* nouveau_led.c */ -#if IS_ENABLED(CONFIG_LEDS_CLASS) +#if IS_REACHABLE(CONFIG_LEDS_CLASS) int nouveau_led_init(struct drm_device *dev); void nouveau_led_suspend(struct drm_device *dev); void nouveau_led_resume(struct drm_device *dev); void nouveau_led_fini(struct drm_device *dev); #else static inline int nouveau_led_init(struct drm_device *dev) { return 0; }; static inline void nouveau_led_suspend(struct drm_device *dev) { }; static inline void nouveau_led_resume(struct drm_device *dev) { }; static inline void nouveau_led_fini(struct drm_device *dev) { }; #endif