Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5626631rwd; Mon, 12 Jun 2023 07:37:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vzrGNaFnZLGUYepM9rWY3pD4dOujPMvpkH7eplfMD8fsXEBAJjm3iRIvX8oZoBPc1JyXR X-Received: by 2002:a17:903:110e:b0:1b0:3637:384e with SMTP id n14-20020a170903110e00b001b03637384emr7497243plh.25.1686580674131; Mon, 12 Jun 2023 07:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686580674; cv=none; d=google.com; s=arc-20160816; b=Pspv0H2bvhJ324Kdf63fRHnmbodU2Dnr1IC1oZeFRY5S+5IPQ2W1DNvMqYix4658C5 EwV2KQChBnKLCRtoOhiOPsEfX188219sCGZqrZy4YJXvinW6AeAosOh3PYRz+ppbSbSN E7+3dPp0p6j+jKwv8gYQem1ShfOHEQm+9Qvy2F1JIv7uKe8jE7IzevRNzaL4k8J6WKV8 dAHYhVg1VPPbyW/rONPfcEdsAPOSjIkyZScmX0vvvM+t7TI5Ox9y+N7W0ghL0N8PHnMv 9Nxu/CIc4mph+H3l84QO9eP8FyR6r2ZSp/1VnCHCzLgM1qJh7zpEwFqLvvj1Zn76QhU3 v8Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=cJZyjNOwYQoHbVrlw6qtebZPk+CJTUBPQCqoHfoIQlI=; b=yg84lq1k9AvA/tHvW+Jh7Gi0IA1STLxca1ygNOwDLgQP/isEQXX7LBQWxwdfLUvo9X AMGh79wVxzsSowBt7mI3R94MXTuW06B9f24HItn2OV15yGp8PzwX2q1pcPKoMpKkQTwF iiyIBsHlI5SLgIUEzsmnz4vSJptzmqVksexzCt+/WwbKX0vbG4LNO6aCbhHxoOmGwRFa VQIXw8ccppPS/an46G9l0xoClwv1q9wQLRt15BOifviIDBwSFDXII/JoBXLutK+702yC Lj98jM+N4S8RSg2t8H27IWpuLznU8KZTZDWJY2mlk769bqT+Dk3ZUr+rLnjW7M02cbx4 afew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=nGO2eer1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=wsq2gFqr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a17090322c900b001a92a507187si3278300plg.80.2023.06.12.07.37.40; Mon, 12 Jun 2023 07:37:54 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=nGO2eer1; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=wsq2gFqr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237238AbjFLOQ0 (ORCPT + 99 others); Mon, 12 Jun 2023 10:16:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237590AbjFLOOc (ORCPT ); Mon, 12 Jun 2023 10:14:32 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56B7310D9; Mon, 12 Jun 2023 07:14:08 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E8475203E7; Mon, 12 Jun 2023 14:14:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686579246; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cJZyjNOwYQoHbVrlw6qtebZPk+CJTUBPQCqoHfoIQlI=; b=nGO2eer1gSJqrO1RRtPneBZ4gSe4X9SM9UnQ7O4qb8hxBcT6j2NsHIGwZ/F5HmSM4mgHJZ 4L9l7WL6nNiZXjQfST+wJnpm9Re96pHOt+a8J1LlzSVW/PJxw8cCmeaBmwAXcUqKIM+jb9 IQ5g+9L2APZYhC7E0zD9lUCmlyfKYoM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686579246; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cJZyjNOwYQoHbVrlw6qtebZPk+CJTUBPQCqoHfoIQlI=; b=wsq2gFqrnbMnHngrRx9w4ay/NQkcTMxmLfTYcPvETAp92gGNxh5yU3oFAe8AJy/im0VJNZ hxNFLMIySYwrAjBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 88DF01357F; Mon, 12 Jun 2023 14:14:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id cJNPIC4oh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:14:06 +0000 From: Thomas Zimmermann To: daniel@ffwll.ch, javierm@redhat.com, sam@ravnborg.org, deller@gmx.de, geert+renesas@glider.be, lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com, dan.carpenter@linaro.org, michael.j.ruhl@intel.com Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-sh@vger.kernel.org, linux-omap@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Thomas Zimmermann Subject: [PATCH v2 34/38] fbdev/core: Add fb_device_{create,destroy}() Date: Mon, 12 Jun 2023 16:08:12 +0200 Message-ID: <20230612141352.29939-35-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612141352.29939-1-tzimmermann@suse.de> References: <20230612141352.29939-1-tzimmermann@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Move the logic to create and destroy fbdev devices into the new helpers fb_device_create() and fb_device_destroy(). There was a call to fb_cleanup_device() in do_unregister_framebuffer() that was too late. The device had already been removed at this point. Move the call into fb_device_destroy(). Declare the helpers in the new internal header file fb_internal.h, as they are only used within the fbdev core module. Signed-off-by: Thomas Zimmermann --- drivers/video/fbdev/core/fb_internal.h | 12 ++++++++ drivers/video/fbdev/core/fbmem.c | 21 +++----------- drivers/video/fbdev/core/fbsysfs.c | 38 ++++++++++++++++++++++++-- include/linux/fb.h | 3 -- 4 files changed, 52 insertions(+), 22 deletions(-) create mode 100644 drivers/video/fbdev/core/fb_internal.h diff --git a/drivers/video/fbdev/core/fb_internal.h b/drivers/video/fbdev/core/fb_internal.h new file mode 100644 index 0000000000000..0b9640ae7a3d2 --- /dev/null +++ b/drivers/video/fbdev/core/fb_internal.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _FB_INTERNAL_H +#define _FB_INTERNAL_H + +struct fb_info; + +/* fbsysfs.c */ +int fb_device_create(struct fb_info *fb_info); +void fb_device_destroy(struct fb_info *fb_info); + +#endif diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index f91ae7d4c94d6..66532774d351e 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -40,6 +40,8 @@ #include