Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5612425rwd; Mon, 12 Jun 2023 07:26:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7AGOIPGAo99Ko6KV0ig/zNolfquUrJxGL0exJmebI0LPd/Y6RRq/o+E+6NytgAoPnm2Mkw X-Received: by 2002:a17:902:d2ca:b0:1b3:8aea:cac8 with SMTP id n10-20020a170902d2ca00b001b38aeacac8mr6750106plc.49.1686580002019; Mon, 12 Jun 2023 07:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686580002; cv=none; d=google.com; s=arc-20160816; b=s38jziEwELvZqm99H/gNiHowfNzCmEAoEmE6XhBSlOxdG8PCao22ipRsKnRX21T/aR 6IFjywRcQRMXcd4dsSyIbHrN3o2hgt7tNRfNCMBxsYN9caiyeEjoDctpQC7+K9GWYFBN 58IPqi/7puoh4LPw62qTi1zjmudFKQJXKEqhBi/zSwhIx/abBFToMhkY2RaDjcK6s0Wu DMJsMtv6acU9+nT7Bvv/oC5Xjz5EKbgG6b+9xPGCy9bsO8k3M0xIvyHj6fow12vp+Ooa 0BExX+kJsORn2DluUGAzCTcSXHUDL4k+E7wZMZukYTrhewHNAIt/Nk1B6kJzhYmYH+Q5 mstg== 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=4C46o8uYDdrEdTWuVBPChdiMr7SKVkGgLXmMwmSf+iU=; b=Q5V8GwaJiIXyV4EhQnysVQ/eCdyfXuSTOhUbWMXBlTiVnaKf+kJjpoh2nVgXRq0840 jlybAR75Yfyr1MvqnovIpwtQZ0B6AiKIESw7irARiWniBSCfy6WdvK4/Y8WeZWu718Kx sn1sTLV35JUntz82RBz7waPbldEJaoJkNvO/pCZOq6G2FOMTivwLkyJc/MvaDaTLpKDy T0B3a918gRtkcm9m7m5bwxNa/dWc44SGBNARPq4cc/jgadqaa+NltX/fyd7HzNhnBl0v zrcNqwQEm1rOLzw8dTILwdGRI8vwgymteKIl1lf11MoP0dxG0i4m0SQ+TmEdeLZT4D0Z U8kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kzIVjaEq; 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 t8-20020a170902e84800b001adc4babc70si7450577plg.72.2023.06.12.07.26.27; Mon, 12 Jun 2023 07:26:41 -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=kzIVjaEq; 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 S237704AbjFLOPU (ORCPT + 99 others); Mon, 12 Jun 2023 10:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237377AbjFLOOI (ORCPT ); Mon, 12 Jun 2023 10:14:08 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A90010FC; Mon, 12 Jun 2023 07:14:02 -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 0419C2048C; Mon, 12 Jun 2023 14:14:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686579241; 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=4C46o8uYDdrEdTWuVBPChdiMr7SKVkGgLXmMwmSf+iU=; b=kzIVjaEqce3dAEaknrxPIJZ6lS6+Ya8hqQX3c1byB+YH0jLXNK64oQP4mxcjAaEe17tzMF /54DMlCe520D+fEa1qAjq5ZpYDiXizZMP+q9iTR+wrGBb3fxCyQoMkA6aV8KUqfVjN5sm3 yQTK0xPgy5xeK2MxrsmKWGfCVRJDUjg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686579241; 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=4C46o8uYDdrEdTWuVBPChdiMr7SKVkGgLXmMwmSf+iU=; b=YbBVmDjgAzUdv7zuZTl3RcbhtJJDzUBE5FFcKWqKWE9Pvajj1QDa6s5B7Fj0S6k4nIsyW9 BrCZqArWSVN0mNCQ== 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 A20D21357F; Mon, 12 Jun 2023 14:14:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id GIuQJigoh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:14:00 +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 , Antonino Daplas Subject: [PATCH v2 18/38] fbdev/nvidiafb: Reorder backlight and framebuffer init/cleanup Date: Mon, 12 Jun 2023 16:07:56 +0200 Message-ID: <20230612141352.29939-19-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 Cc: Antonino Daplas Reviewed-by: Javier Martinez Canillas --- drivers/video/fbdev/nvidia/nvidia.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/nvidia/nvidia.c b/drivers/video/fbdev/nvidia/nvidia.c index ea4ba3dfb96bb..039e886346fa6 100644 --- a/drivers/video/fbdev/nvidia/nvidia.c +++ b/drivers/video/fbdev/nvidia/nvidia.c @@ -1400,14 +1400,14 @@ static int nvidiafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) pci_set_drvdata(pd, info); - if (backlight) - nvidia_bl_init(par); - if (register_framebuffer(info) < 0) { printk(KERN_ERR PFX "error registering nVidia framebuffer\n"); goto err_out_iounmap_fb; } + if (backlight) + nvidia_bl_init(par); + printk(KERN_INFO PFX "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", info->fix.id, @@ -1439,9 +1439,9 @@ static void nvidiafb_remove(struct pci_dev *pd) NVTRACE_ENTER(); + nvidia_bl_exit(par); unregister_framebuffer(info); - nvidia_bl_exit(par); arch_phys_wc_del(par->wc_cookie); iounmap(info->screen_base); fb_destroy_modedb(info->monspecs.modedb); -- 2.41.0