From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9C86C433DB for ; Thu, 21 Jan 2021 08:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A1C923977 for ; Thu, 21 Jan 2021 08:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726396AbhAUI15 (ORCPT ); Thu, 21 Jan 2021 03:27:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727999AbhAUI0f (ORCPT ); Thu, 21 Jan 2021 03:26:35 -0500 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0C77C061786 for ; Thu, 21 Jan 2021 00:25:51 -0800 (PST) Received: by mail-oi1-x231.google.com with SMTP id p5so1324989oif.7 for ; Thu, 21 Jan 2021 00:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=YufljbHlHbmx/xR31VlXerp95BT7cxahfNrgURan972flhmsJdRcjQQZPRQWrNUYh4 CnnyhIjhUyKVgMeBMcRkWiTtjRH1msLOlPhiWTVc6MPBTrLwIF55Jy/g9n0z5adm/DV4 9g0IgTn9NeBXXyMQuIXUYV37SgwCy062PaU3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=omijWxzcyJQaDiy6NfN6rG7IR1kiOxYUZEWvIr/w+nn9Z2BYkiS7J7lGbB8DIwOR9d qwXcne7+1CMjn48NDuT3JqfMp1jkNs9OdlWhXFQ96h9hGg7pSQzH6eiGKnDqtpGlRGSw VyF+KL8CvINN85fVB4Zk0JmXFUH9cfF4Psb835gZjR1IrvWH/GbsAD1CMRrzUX9aQYcr N4203DkArqXtMTDdXKlnSVJI15UcbWoOHSCmgWi5iDv4H1pbuEDZ9r8vJ03O3uVau33p X0joezbmqT1kDq1C77sRVZ54bJs8sKQ0Zk75wpHgLDE3rtcJLY5UF303oIh0lochZNb9 PMBQ== X-Gm-Message-State: AOAM532dCgYiwPfpohAoB16FCkVx0uJtoKC7sBNFGyC74qrqMaRKU5p7 q75OQ9KmYiQLXoeNMpUTrb0b3l1E8G4jqcb/DA6t4A== X-Google-Smtp-Source: ABdhPJzz0JkV/k4V0avoNCaP5d/Ro05hcp5CHt9s45BuCIcuqAorp3oRURqBTkqgwJQymAvgou+9FyRGO03Vf0s8NqQ= X-Received: by 2002:aca:ad92:: with SMTP id w140mr5398682oie.128.1611217551051; Thu, 21 Jan 2021 00:25:51 -0800 (PST) MIME-Version: 1.0 References: <20210121074959.313333-1-hch@lst.de> <20210121074959.313333-9-hch@lst.de> In-Reply-To: <20210121074959.313333-9-hch@lst.de> From: Daniel Vetter Date: Thu, 21 Jan 2021 09:25:40 +0100 Message-ID: Subject: Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit To: Christoph Hellwig Cc: Frederic Barrat , Andrew Donnellan , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Jessica Yu , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , Masahiro Yamada , Michal Marek , Linux Kernel Mailing List , linuxppc-dev , dri-devel , live-patching@vger.kernel.org, linux-kbuild Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE. > > Signed-off-by: Christoph Hellwig I didn't spot any dependencies with your series, should I just merge this through drm trees? Or do you want an ack? -Daniel > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 16 ------------- > drivers/gpu/drm/drm_kms_helper_common.c | 26 +++++++++++----------- > 3 files changed, 13 insertions(+), 39 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index ce6d63ca75c32a..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,19 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - > - if (!module_loaded(name)) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..b694a7da632eae 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,19 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT) && > + !module_loaded("fbcon")) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6872C433E0 for ; Thu, 21 Jan 2021 08:35:06 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B1F023976 for ; Thu, 21 Jan 2021 08:35:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B1F023976 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DLwgW553mzDqhH for ; Thu, 21 Jan 2021 19:35:03 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=ffwll.ch (client-ip=2607:f8b0:4864:20::22a; helo=mail-oi1-x22a.google.com; envelope-from=daniel.vetter@ffwll.ch; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=ffwll.ch header.i=@ffwll.ch header.a=rsa-sha256 header.s=google header.b=YufljbHl; dkim-atps=neutral Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DLwdF6Xx6zDqCY for ; Thu, 21 Jan 2021 19:33:04 +1100 (AEDT) Received: by mail-oi1-x22a.google.com with SMTP id w8so1375678oie.2 for ; Thu, 21 Jan 2021 00:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=YufljbHlHbmx/xR31VlXerp95BT7cxahfNrgURan972flhmsJdRcjQQZPRQWrNUYh4 CnnyhIjhUyKVgMeBMcRkWiTtjRH1msLOlPhiWTVc6MPBTrLwIF55Jy/g9n0z5adm/DV4 9g0IgTn9NeBXXyMQuIXUYV37SgwCy062PaU3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=oIB66tqlNYl9RFy15BqH8T84Ra/X/w7GIIBhSzlJLph5ll21dhRRf5Q6NO2GvepsRL 7wHZQWc5Yo8k8rPH99+UmuqtWWZ96G8ph/WjyDf64JcF2tsfLYPIw4ufFWHo4aGwhzDA KC65VuIU9qiMwy3Nwk5PJN5wOwHcH4FhGBZuGUpuSzRZyBGnOkOC26DZUSDdJqC3vIvf C80XbfAiPWTzDLnZEQ2DxT9eiKZQrb6bUWbagsAaVpOzzudVAAIAWnFpqBmEF3ZUt8q9 XlrPqOOqKDph59XhTa15kOeQ4RyZzU8ed4J3Zdp5mdT8CFXZ5Saw1DGmmxoTKsvKez5Y 5LtA== X-Gm-Message-State: AOAM531sTivEOcywsS/hYiyRJjYXUXP29xkTIWxkUK+AUCWsZd0A12MZ 5S6spvIicU6CEtmoWT/kLz1kCljIGcRdIT5tPptO2MsUXEOmbA== X-Google-Smtp-Source: ABdhPJzz0JkV/k4V0avoNCaP5d/Ro05hcp5CHt9s45BuCIcuqAorp3oRURqBTkqgwJQymAvgou+9FyRGO03Vf0s8NqQ= X-Received: by 2002:aca:ad92:: with SMTP id w140mr5398682oie.128.1611217551051; Thu, 21 Jan 2021 00:25:51 -0800 (PST) MIME-Version: 1.0 References: <20210121074959.313333-1-hch@lst.de> <20210121074959.313333-9-hch@lst.de> In-Reply-To: <20210121074959.313333-9-hch@lst.de> From: Daniel Vetter Date: Thu, 21 Jan 2021 09:25:40 +0100 Message-ID: Subject: Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit To: Christoph Hellwig Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , Jiri Kosina , Andrew Donnellan , linux-kbuild , David Airlie , Masahiro Yamada , Josh Poimboeuf , Maarten Lankhorst , Linux Kernel Mailing List , Maxime Ripard , Michal Marek , Joe Lawrence , dri-devel , Thomas Zimmermann , Jessica Yu , Frederic Barrat , live-patching@vger.kernel.org, Miroslav Benes , linuxppc-dev Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE. > > Signed-off-by: Christoph Hellwig I didn't spot any dependencies with your series, should I just merge this through drm trees? Or do you want an ack? -Daniel > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 16 ------------- > drivers/gpu/drm/drm_kms_helper_common.c | 26 +++++++++++----------- > 3 files changed, 13 insertions(+), 39 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index ce6d63ca75c32a..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,19 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - > - if (!module_loaded(name)) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..b694a7da632eae 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,19 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT) && > + !module_loaded("fbcon")) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FD6FC433DB for ; Thu, 21 Jan 2021 08:25:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D1C25239A1 for ; Thu, 21 Jan 2021 08:25:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1C25239A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E43996E516; Thu, 21 Jan 2021 08:25:52 +0000 (UTC) Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by gabe.freedesktop.org (Postfix) with ESMTPS id C64CC6E516 for ; Thu, 21 Jan 2021 08:25:51 +0000 (UTC) Received: by mail-oi1-x22b.google.com with SMTP id q25so1308950oij.10 for ; Thu, 21 Jan 2021 00:25:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=YufljbHlHbmx/xR31VlXerp95BT7cxahfNrgURan972flhmsJdRcjQQZPRQWrNUYh4 CnnyhIjhUyKVgMeBMcRkWiTtjRH1msLOlPhiWTVc6MPBTrLwIF55Jy/g9n0z5adm/DV4 9g0IgTn9NeBXXyMQuIXUYV37SgwCy062PaU3k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dcZ1FYPsDBKXN3hC2IcAkzYMcxDaDlTQqW6wszGPCkA=; b=Mf8AOZprfvCQkQUdh4tW5SGM2sSF/oROX/DfhetEk8e+NBdTaHGH9Pdv4IqCoXNxb5 7TX39UpwUwhSmHSBW7GXVgthd/D+g56AC8T4TSPb5j3T0if8d35PeHWXjcFvEejJ0mhm 8b2Q3VO8/Jg7ljhVbsLI5+0K5M/Kn4bs5dgFnk7Hsy2HP+we3phxE32Ilwhk28XTe+Oa ghbNbJbdhiPwxgYvWy6KwcI0JZHx6wrfYxoiSEcr4riUticR6U+RGSiGtosfuLN5CP1L y8Yvh7h1UVnmlY95ULXzlTXFz7cnW7mCkx3WA/HpRHiElcHm6nzSJwL0D8pEySPcg3/6 KGyw== X-Gm-Message-State: AOAM530sKQ1DIVFdEBHivhMuIoY7QZPVwnY81W6zxujLL09IR1fKD8mp H9tAPgW+ssYmhgOWVfJTWUH62uBJm5FAjdIISqv8XQ== X-Google-Smtp-Source: ABdhPJzz0JkV/k4V0avoNCaP5d/Ro05hcp5CHt9s45BuCIcuqAorp3oRURqBTkqgwJQymAvgou+9FyRGO03Vf0s8NqQ= X-Received: by 2002:aca:ad92:: with SMTP id w140mr5398682oie.128.1611217551051; Thu, 21 Jan 2021 00:25:51 -0800 (PST) MIME-Version: 1.0 References: <20210121074959.313333-1-hch@lst.de> <20210121074959.313333-9-hch@lst.de> In-Reply-To: <20210121074959.313333-9-hch@lst.de> From: Daniel Vetter Date: Thu, 21 Jan 2021 09:25:40 +0100 Message-ID: Subject: Re: [PATCH 08/13] drm: remove drm_fb_helper_modinit To: Christoph Hellwig X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , Jiri Kosina , Andrew Donnellan , linux-kbuild , David Airlie , Masahiro Yamada , Josh Poimboeuf , Linux Kernel Mailing List , Michal Marek , Joe Lawrence , dri-devel , Thomas Zimmermann , Jessica Yu , Frederic Barrat , live-patching@vger.kernel.org, Miroslav Benes , linuxppc-dev Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jan 21, 2021 at 8:55 AM Christoph Hellwig wrote: > > drm_fb_helper_modinit has a lot of boilerplate for what is not very > simple functionality. Just open code it in the only caller using > IS_ENABLED and IS_MODULE. > > Signed-off-by: Christoph Hellwig I didn't spot any dependencies with your series, should I just merge this through drm trees? Or do you want an ack? -Daniel > --- > drivers/gpu/drm/drm_crtc_helper_internal.h | 10 --------- > drivers/gpu/drm/drm_fb_helper.c | 16 ------------- > drivers/gpu/drm/drm_kms_helper_common.c | 26 +++++++++++----------- > 3 files changed, 13 insertions(+), 39 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc_helper_internal.h b/drivers/gpu/drm/drm_crtc_helper_internal.h > index 25ce42e799952c..61e09f8a8d0ff0 100644 > --- a/drivers/gpu/drm/drm_crtc_helper_internal.h > +++ b/drivers/gpu/drm/drm_crtc_helper_internal.h > @@ -32,16 +32,6 @@ > #include > #include > > -/* drm_fb_helper.c */ > -#ifdef CONFIG_DRM_FBDEV_EMULATION > -int drm_fb_helper_modinit(void); > -#else > -static inline int drm_fb_helper_modinit(void) > -{ > - return 0; > -} > -#endif > - > /* drm_dp_aux_dev.c */ > #ifdef CONFIG_DRM_DP_AUX_CHARDEV > int drm_dp_aux_dev_init(void); > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c > index ce6d63ca75c32a..0b9f1ae1b7864c 100644 > --- a/drivers/gpu/drm/drm_fb_helper.c > +++ b/drivers/gpu/drm/drm_fb_helper.c > @@ -2499,19 +2499,3 @@ void drm_fbdev_generic_setup(struct drm_device *dev, > drm_client_register(&fb_helper->client); > } > EXPORT_SYMBOL(drm_fbdev_generic_setup); > - > -/* The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > - * but the module doesn't depend on any fb console symbols. At least > - * attempt to load fbcon to avoid leaving the system without a usable console. > - */ > -int __init drm_fb_helper_modinit(void) > -{ > -#if defined(CONFIG_FRAMEBUFFER_CONSOLE_MODULE) && !defined(CONFIG_EXPERT) > - const char name[] = "fbcon"; > - > - if (!module_loaded(name)) > - request_module_nowait(name); > -#endif > - return 0; > -} > -EXPORT_SYMBOL(drm_fb_helper_modinit); > diff --git a/drivers/gpu/drm/drm_kms_helper_common.c b/drivers/gpu/drm/drm_kms_helper_common.c > index 221a8528c9937a..b694a7da632eae 100644 > --- a/drivers/gpu/drm/drm_kms_helper_common.c > +++ b/drivers/gpu/drm/drm_kms_helper_common.c > @@ -64,19 +64,19 @@ MODULE_PARM_DESC(edid_firmware, > > static int __init drm_kms_helper_init(void) > { > - int ret; > - > - /* Call init functions from specific kms helpers here */ > - ret = drm_fb_helper_modinit(); > - if (ret < 0) > - goto out; > - > - ret = drm_dp_aux_dev_init(); > - if (ret < 0) > - goto out; > - > -out: > - return ret; > + /* > + * The Kconfig DRM_KMS_HELPER selects FRAMEBUFFER_CONSOLE (if !EXPERT) > + * but the module doesn't depend on any fb console symbols. At least > + * attempt to load fbcon to avoid leaving the system without a usable > + * console. > + */ > + if (IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION) && > + IS_MODULE(CONFIG_FRAMEBUFFER_CONSOLE) && > + !IS_ENABLED(CONFIG_EXPERT) && > + !module_loaded("fbcon")) > + request_module_nowait("fbcon"); > + > + return drm_dp_aux_dev_init(); > } > > static void __exit drm_kms_helper_exit(void) > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel