Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5618145rwd; Mon, 12 Jun 2023 07:31:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VWQRjkbM33jmHoUwRX+PpjwfPBHIyvEgpIdVJa9RdKKZdWnwKX41hG1Fq1qVgbRZPxWZ5 X-Received: by 2002:a17:907:31c6:b0:96f:afe9:25c7 with SMTP id xf6-20020a17090731c600b0096fafe925c7mr10405564ejb.10.1686580276707; Mon, 12 Jun 2023 07:31:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686580276; cv=none; d=google.com; s=arc-20160816; b=pwkIRkcsOPsNVo8IvsAJw6RoAYZCNvLniS9aOyt4JOcoIF6nKXG69C4N/QAZAgseSh gTQlZfwZNCMevdRhrmWuBWul7PrmyaZjpDsTSBCRypn8sVptNbTgGNsVmulS09YRDUUu zCDAXpadY9PcWzKHAOA26xViagnbrANs0UVnUgJU85adImJT+hSeg8xcO2imoeycapZE V92b6BbzW/I8FzvhMW4jBHLTrrGBKlLBX1lFbqvbWC4S7xoimJ6/0i2fYaYqRoq0hwYZ uVRlYRWc5aosl7DcCyv7UQePW9vTQm9ELftFY2g0ya2dH6pZUtbY7OAELTeTOARZ2cto HKhQ== 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=ZMezLYvd1wM4r2U5/PT+E1dmbhnJeOMuc4XP7gGAyts=; b=MLq/4VLA0dn5U95jXv9OyyKKpOgFeeZCoqVRh/QAYMb0Bwe3ZlOnf/yPc8maN8TTQc VykgRvn8+aZYM+qBTTqdQ8Sj6/XN0d2xkIc9Bf2xM7DCBbW682hCmbxZBUXN94bPxhHJ pqT1F6q+7GyuQnPWNPCMEFzP4Y+zBOAX+Hff9wpdCTqpHRGhMpAzNU9Q7hGLMAUAARDV x8WBbi4tNMdXDmZFguB46zAn4EtfK7gBAilCueX3FxktrUpCdVZPYn1pEo83ySMmX4zW Nao9JCUk2r7dXMBTcvqnF0SpoyG51TX/yuuhs59nZ2GNvhecysW9Fkn3ZR3Ys1uPEAgL uVAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=pos53zcO; dkim=neutral (no key) header.i=@suse.de header.b="N7FSzby/"; 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 v18-20020a17090606d200b00977ce0ef56fsi2686739ejb.90.2023.06.12.07.30.49; Mon, 12 Jun 2023 07:31:16 -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=pos53zcO; dkim=neutral (no key) header.i=@suse.de header.b="N7FSzby/"; 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 S237876AbjFLOP4 (ORCPT + 99 others); Mon, 12 Jun 2023 10:15:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237420AbjFLOOL (ORCPT ); Mon, 12 Jun 2023 10:14:11 -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 4E71A170B; Mon, 12 Jun 2023 07:14:04 -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 CA1C02283D; Mon, 12 Jun 2023 14:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686579242; 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=ZMezLYvd1wM4r2U5/PT+E1dmbhnJeOMuc4XP7gGAyts=; b=pos53zcO3/7qNVyViUFnRcWKhP5plrKrze/JvjwKxn8GCfYQA8qH/Uo9OF/pHPgJ2U8PWe +UAmY2CDeLJWlQVQv9U7ustyi+70xxhrdngHuM0nW+ziQRpTbcAdUhjut6iSHOwt4x7Kec VkgHiAAvJnhLnqC/KrZV0ATDTKea1HU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686579242; 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=ZMezLYvd1wM4r2U5/PT+E1dmbhnJeOMuc4XP7gGAyts=; b=N7FSzby/wxuYdzkiF+jH2GY6MlRjrhrIYQKfeIFzxZEcoBUt+c5a+Gz0cFdVBRSJXb+DF8 g39ye9qbPWa4MEBA== 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 793521357F; Mon, 12 Jun 2023 14:14:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qDmsHCooh2RwGQAAMHmgww (envelope-from ); Mon, 12 Jun 2023 14:14:02 +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 23/38] fbdev/rivafb: Reorder backlight and framebuffer init/cleanup Date: Mon, 12 Jun 2023 16:08:01 +0200 Message-ID: <20230612141352.29939-24-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/riva/fbdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c index 41edc6e794603..e328b2d39e2b6 100644 --- a/drivers/video/fbdev/riva/fbdev.c +++ b/drivers/video/fbdev/riva/fbdev.c @@ -2031,9 +2031,6 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) pci_set_drvdata(pd, info); - if (backlight) - riva_bl_init(info->par); - ret = register_framebuffer(info); if (ret < 0) { printk(KERN_ERR PFX @@ -2041,6 +2038,9 @@ static int rivafb_probe(struct pci_dev *pd, const struct pci_device_id *ent) goto err_iounmap_screen_base; } + if (backlight) + riva_bl_init(info->par); + printk(KERN_INFO PFX "PCI nVidia %s framebuffer ver %s (%dMB @ 0x%lX)\n", info->fix.id, @@ -2084,9 +2084,9 @@ static void rivafb_remove(struct pci_dev *pd) kfree(par->EDID); #endif + riva_bl_exit(info); unregister_framebuffer(info); - riva_bl_exit(info); arch_phys_wc_del(par->wc_cookie); iounmap(par->ctrl_base); iounmap(info->screen_base); -- 2.41.0