Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5610303rwd; Mon, 12 Jun 2023 07:25:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XqAbGQiqSpvjvJmnRQnsZjmYde/WVJBshTW4oZfTb4Gycyf2fKJ4OvBdL2xcKHKIQEDBJ X-Received: by 2002:a17:90a:303:b0:256:d4a:ea4c with SMTP id 3-20020a17090a030300b002560d4aea4cmr8277114pje.30.1686579900520; Mon, 12 Jun 2023 07:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686579900; cv=none; d=google.com; s=arc-20160816; b=fxvPuxxjDb5FPb9m+8AamUgdU5toR8E38r7YVaS2sy3uqmOI973edxIvsOPe7lm3x1 eNkIM0iTII6qWiQY/D7pBezdO/9YrQNAqfNtZKs7l9JceZ2paXda8vunk3P7JCBd+tO/ qkAdjSwzxKBqOsZnrped+vr4/2157iVB6EyFy34igN1IpEpUOob6G1HWSAEpz0dngLND zMkmvwKtEWi1K+wFI/3e1ZFSsW757FEVnbg5mb0RNaF3vWxICgjTj+vSeeZDm0m1BRgL 3ME1UN8MqJ6PvOnSWf2dUr1aP7iURDMbSzxNHdlh2s4d3EozszbsPHZ6pvO6hfeUJR7b UMXg== 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=JlVcmvzQv7LlXsgvsBhpy1neAHLfhVIo6jMpaCVHhbM=; b=ZoK6JEidQdi82Ds74j6ogwTYIPoK2dJML+1hZ3Xft41RcwEo3A1xyYz+B3kZIJdmQh FRidaK8VIWeCaQsU8LD1R+/RjCXFqswDlD1UZkjoEWswHWn6q3ANG1SIehMLe2G5P06O MJkfWfhuHhc4T4UMmYQWTB74YJvx/3truRGjKwLDKNOE6foiI3+UiwNFS50wkZ0XNVe6 FG7822putBeMD19wZcYKOZRRc8wB0iFjeWKiCLGsfI80c3QHk+CHnWOP2KXp1snpvHKh PPp/5DPryjWst9lPHVSnyvBLZTwzk2GNfKdabEG+X/Hb4Bqd3kF2BfzjNebkzsCT1N7R BZhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=wUxmfirh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=B8siKHLL; 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 lk3-20020a17090b33c300b0025690b76c95si7388925pjb.10.2023.06.12.07.24.46; Mon, 12 Jun 2023 07:25:00 -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=wUxmfirh; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=B8siKHLL; 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 S237723AbjFLOOo (ORCPT + 99 others); Mon, 12 Jun 2023 10:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237264AbjFLON7 (ORCPT ); Mon, 12 Jun 2023 10:13:59 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A25210E6; Mon, 12 Jun 2023 07:13:58 -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-out1.suse.de (Postfix) with ESMTPS id 2BC3222838; Mon, 12 Jun 2023 14:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686579237; 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=JlVcmvzQv7LlXsgvsBhpy1neAHLfhVIo6jMpaCVHhbM=; b=wUxmfirh6VNkcGRn6mKsulbVu7QH8bYevkHyb0yYz8XOtHUU9lQb9UBbLCe2ra5EFuFeAI GHLtlmCFTLzGg7xPsoaPpwUKAz9MWA+jd429AluaVrvtYWo6PdjACsDUN8HgPDjNZsJt3b /St0XSCdNwukFwRgPZzlj0KmoO1X94A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686579237; 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=JlVcmvzQv7LlXsgvsBhpy1neAHLfhVIo6jMpaCVHhbM=; b=B8siKHLL2vcweQADuS5kOj3W2q2DepX36jW8jW9Pcc4DwS/BlKpty2EBbvgi9gWuZe+Lgs 5sZmH38mKQTYHsBQ== 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 D06C51357F; Mon, 12 Jun 2023 14:13:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sNXyMSQoh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:13:56 +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 07/38] fbdev/atyfb: Reorder backlight and framebuffer init/cleanup Date: Mon, 12 Jun 2023 16:07:45 +0200 Message-ID: <20230612141352.29939-8-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 The driver's backlight code requires the framebuffer to be registered. Therefore reorder the init and cleanup calls for both data structures. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/aty/atyfb_base.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index cba2b113b28b0..51504fe39054c 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2654,11 +2654,6 @@ static int aty_init(struct fb_info *info) USE_F32KHZ | TRISTATE_MEM_EN, par); } else #endif - if (M64_HAS(MOBIL_BUS) && backlight) { -#ifdef CONFIG_FB_ATY_BACKLIGHT - aty_bl_init(par); -#endif - } memset(&var, 0, sizeof(var)); #ifdef CONFIG_PPC @@ -2751,6 +2746,12 @@ static int aty_init(struct fb_info *info) goto aty_init_exit; } + if (M64_HAS(MOBIL_BUS) && backlight) { +#ifdef CONFIG_FB_ATY_BACKLIGHT + aty_bl_init(par); +#endif + } + fb_list = info; PRINTKI("fb%d: %s frame buffer device on %s\n", @@ -3716,12 +3717,13 @@ static void atyfb_remove(struct fb_info *info) aty_set_crtc(par, &par->saved_crtc); par->pll_ops->set_pll(info, &par->saved_pll); - unregister_framebuffer(info); - #ifdef CONFIG_FB_ATY_BACKLIGHT if (M64_HAS(MOBIL_BUS)) aty_bl_exit(info->bl_dev); #endif + + unregister_framebuffer(info); + arch_phys_wc_del(par->wc_cookie); #ifndef __sparc__ -- 2.41.0