Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5599593rwd; Mon, 12 Jun 2023 07:16:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iv2lwlC0Y67ZZnOQs3yuNjEbNkLYe3eJ26XM3c8xF5CFozxHoxVOVlVj7Dzhiqg4eQVaj X-Received: by 2002:a17:907:7207:b0:978:9e92:f903 with SMTP id dr7-20020a170907720700b009789e92f903mr9880693ejc.46.1686579418343; Mon, 12 Jun 2023 07:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686579418; cv=none; d=google.com; s=arc-20160816; b=Jc6/NcTya4ofs6LFCezxIuTi+TaIa/xbHGS4JN/LtJ0JrPO9ZcKcLd5zI6cFxHCexU Htqw426a7Tc+bLog94P5So8+O2skL6KZrs0v8jT+6Pxl5hR3ZGh9DdEBIKHH0S0fnYDI 4Bsk8C8NfH2BFKW+PHcrAZ7eO5fw/vbX9YSQb4y1ej1M6EetOnDGce7bDp41sDII6M4M ihBS6VzxL7PCPlLTKj8a2IPiZSRnFgGKDYXiTZJHTFx2m0cqEPzjxFG1uP9p9xefnfFd CW3eomfyUzAzMdNwtmzrSLILr3cUIacaXcy4IoDpX4l8RnA2pRUAZR30ADnUbcO6rL5t mWYw== 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=EhX11v3xhAS4lpyLHOu95ewhCONPfJzHyC0tG2hvu+8=; b=HMnBJC2ffwv6BOvCRXDwFGb7hrJQv4QVl1p+quXkceExgL9hXWiCPkvOGdppKufgYN JnPoqJAzyq4ZLkYNdXyGhou4y/KOCMfpCFqdAe+FaCJHWDL0elyKEBJKDNmRcSzxhKSi 4FICOMD/UHFQ5715XXZuQ+JyC/uZMVJrLV3vj91/xWHkg5mQSti1hVNzMN+GA3EYrojK 1XErHxSrXZnwhJ7Fe1+pQgwv9jhxur2Az3Mt2wswIuRUMbu9fsf7QFZ8qQx4fzjfFkdH EsfDfHC7yGL7mYNJjRi+PyBDiU53PmYd574tNS8SoNZ39/CdFzhz3aqtuTSTp+e3CrgU AL8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="k0h/AQn3"; dkim=neutral (no key) header.i=@suse.de header.b="DaoKM/63"; 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 o11-20020a170906288b00b009745de8db9dsi4546152ejd.194.2023.06.12.07.16.33; Mon, 12 Jun 2023 07:16:58 -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="k0h/AQn3"; dkim=neutral (no key) header.i=@suse.de header.b="DaoKM/63"; 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 S237235AbjFLOO2 (ORCPT + 99 others); Mon, 12 Jun 2023 10:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237282AbjFLOOA (ORCPT ); Mon, 12 Jun 2023 10:14:00 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3967EF0; Mon, 12 Jun 2023 07:13:59 -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 CEFC8203D5; 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=EhX11v3xhAS4lpyLHOu95ewhCONPfJzHyC0tG2hvu+8=; b=k0h/AQn3ulq4fJqWuASei26YySfG7Gb9Bc6fXvFyRUCbvcDKnmSK8xz7tIWEQuEFfHXE3/ Uti9k8xKT7AiWbtkfUWSsQj4BL6Vsnhn07J1EHoPFC0uV35XHe6h2nIrRGe1C3QwS7lhji oxmTGnePZMIh4uY+0l+h32XQEMYK1vk= 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=EhX11v3xhAS4lpyLHOu95ewhCONPfJzHyC0tG2hvu+8=; b=DaoKM/63/Zu2UQ3GoGRpA5GROMnfH8KNosfT91Bi9zrS2uPpnAHXPPbhVsQDzvVZ2l7ZbZ kX9uNX25xZ51eLBg== 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 820331357F; Mon, 12 Jun 2023 14:13:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id yO/iHiUoh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:13:57 +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 09/38] fbdev/aty128fb: Reorder backlight and framebuffer init/cleanup Date: Mon, 12 Jun 2023 16:07:47 +0200 Message-ID: <20230612141352.29939-10-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/aty128fb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index 36a9ac05a340f..b4a49068a522f 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -2028,14 +2028,14 @@ static int aty128_init(struct pci_dev *pdev, const struct pci_device_id *ent) par->asleep = 0; par->lock_blank = 0; + if (register_framebuffer(info) < 0) + return 0; + #ifdef CONFIG_FB_ATY128_BACKLIGHT if (backlight) aty128_bl_init(par); #endif - if (register_framebuffer(info) < 0) - return 0; - fb_info(info, "%s frame buffer device on %s\n", info->fix.id, video_card); @@ -2167,12 +2167,12 @@ static void aty128_remove(struct pci_dev *pdev) par = info->par; - unregister_framebuffer(info); - #ifdef CONFIG_FB_ATY128_BACKLIGHT aty128_bl_exit(info->bl_dev); #endif + unregister_framebuffer(info); + arch_phys_wc_del(par->wc_cookie); iounmap(par->regbase); iounmap(info->screen_base); -- 2.41.0