Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1054647rwd; Tue, 13 Jun 2023 04:21:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eC9ATztXIs01T1ISJh6v4rY4m4yJcf/6Q5qG+SXI1HOuFERTLtftufGcUwtmpZzJhSfD1 X-Received: by 2002:a17:903:124d:b0:1ac:aba5:7885 with SMTP id u13-20020a170903124d00b001acaba57885mr11032008plh.47.1686655292743; Tue, 13 Jun 2023 04:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686655292; cv=none; d=google.com; s=arc-20160816; b=fB7qGKaseuzN9srdoJ/o4SQWPF271aX9ZlJq3CKAaTM3rpLN2tFJ5wgZWJMFhTPqP9 L7qeDcRBz9RWEGsvg/CWLQ4BWwYABzE8zDCgpNEPH8REeiyaXQ1zkM5vxOkKlz4z9DhF 2h0k4DKC8XrfLeSbuUdKP/5ajL/Ij7A8OrNf9+1YbjyzbgbaHfua47fQyUq117i1f+eM SAlrlBPyYIo5Bl+jfTB1n0+UzPMk7iM1Fe4FOIAT9GR54grMXfFUp88QXNxwuQg7lh96 tgLPXAXMBePrAbzK/tRmqZBHDrkS71CzvtPJGT+34tvdwcZB4tuIqFJyEd1QEJeMQI3n 9/Dw== 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=eAk2/6ibdZH0kfzQKlGiXlQ0sdOrgLY8cFw5r/ejdU0=; b=XlN7QaNhRrtGugf1FhpXjzSdKMW7Z7NIeXn8ubw1m5LDhm8YzMBxYZ+JTs2jtOeww1 Oqz+K5qV5+G3Y3dHzbfwqPAsIvEx8Iche3NEUx+0MhLJ3TfMYpPUNbmcs1MBpuZ0kL3p GTUwe2jy+wh7IZJTzvyGlOhu4H2ZKto5yEQfJBby3GDGNsXhU9kHNXMNBjm2rO1d4xd0 L0zFtH7vY/WpqNS/sptdlvfrvaz4cwxIeP3gd/mRiMuCNwCO913Sq0kYBaERiQKODuv0 f4GmbP3CGATtxWSXhWiDOY8nC+CjLcLksc3MEonOdFeOdLyegZymVcA5wtQ4p9MVzpI8 NnUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=UAeqG60H; dkim=neutral (no key) header.i=@suse.de; 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 n9-20020a170903110900b001b176dc95dbsi2633240plh.593.2023.06.13.04.21.20; Tue, 13 Jun 2023 04:21:32 -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=UAeqG60H; dkim=neutral (no key) header.i=@suse.de; 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 S242333AbjFMLMo (ORCPT + 99 others); Tue, 13 Jun 2023 07:12:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242133AbjFMLKK (ORCPT ); Tue, 13 Jun 2023 07:10:10 -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 D07DE10E2; Tue, 13 Jun 2023 04:10: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 654481FD9B; Tue, 13 Jun 2023 11:10:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686654607; 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=eAk2/6ibdZH0kfzQKlGiXlQ0sdOrgLY8cFw5r/ejdU0=; b=UAeqG60HF96B34Zb8zAbsUHqHdqePI2Hx+bnLL2Px0TLj8a3mnzADulBJ3wVGidBG0o4Ko GlRFMR0g+DavopvYU02zi+YPIXlu+Mwqsmkb89lFkWP0LZCqqiMRg6G8kWKD1l3QKjqMRm 9Ueg7GU1QujWs6zJj1+WUvWDZd2mw1M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686654607; 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=eAk2/6ibdZH0kfzQKlGiXlQ0sdOrgLY8cFw5r/ejdU0=; b=n/47xsMt6I3VTPwwvPdH3F4k2gEB1fB8VpAdKGbLNVTKuiWzNRDqSR0yvco+uSJm7HMV+e TvFvFmys1fyp9LAg== 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 180FE13483; Tue, 13 Jun 2023 11:10:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wPfyBI9OiGR8CQAAMHmgww (envelope-from ); Tue, 13 Jun 2023 11:10:07 +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 v3 34/38] fbdev/core: Add fb_device_{create,destroy}() Date: Tue, 13 Jun 2023 13:07:09 +0200 Message-ID: <20230613110953.24176-35-tzimmermann@suse.de> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230613110953.24176-1-tzimmermann@suse.de> References: <20230613110953.24176-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,URIBL_BLOCKED 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 Reviewed-by: Sam Ravnborg --- 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