From patchwork Fri Aug 2 12:05:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2837874 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B5249F479 for ; Fri, 2 Aug 2013 12:07:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1325E2051F for ; Fri, 2 Aug 2013 12:07:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8FEF2050D for ; Fri, 2 Aug 2013 12:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752333Ab3HBMGl (ORCPT ); Fri, 2 Aug 2013 08:06:41 -0400 Received: from mail-ea0-f171.google.com ([209.85.215.171]:51818 "EHLO mail-ea0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323Ab3HBMGj (ORCPT ); Fri, 2 Aug 2013 08:06:39 -0400 Received: by mail-ea0-f171.google.com with SMTP id n15so284868ead.16 for ; Fri, 02 Aug 2013 05:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Q9FBx2EXJZbb13lfSKPcl03Z5QBGRo7smsYqzWhZhLQ=; b=xU9uST7qFl6nvoj9uWc3gUYUKw0kVnahHkx/YV//M2ChMoHoROoAK6chxld6geLbs6 69O3YmTrWhSNktjcunGC/jtIvtKcdLlgVUugcPz1s/wSg+qPOOec4hulClE7LJa3Xk8Y hyegd3/D6Jvn3iyre95HE/PEiIwChBFmDIE0owpGRrdI5oVexwozQQLb+IBskn7/timp d8sr1J1WSyjkSLeh3P46zHCobRXp7oRZfdnmZCFltZiw60AjbR2YCMndH3zO5bv4+Uy8 bSX7cyqpfPiXhIvRr0npipalbL6eieRra2Ct2DwsTnWBacVGZN7y6UU65xEE8fLIO05o kitg== X-Received: by 10.14.102.72 with SMTP id c48mr5605495eeg.52.1375445198200; Fri, 02 Aug 2013 05:06:38 -0700 (PDT) Received: from localhost.localdomain (stgt-5f71a809.pool.mediaWays.net. [95.113.168.9]) by mx.google.com with ESMTPSA id t6sm2206447eel.12.2013.08.02.05.06.36 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Aug 2013 05:06:37 -0700 (PDT) From: David Herrmann To: linux-kernel@vger.kernel.org Cc: David Airlie , Geert Uytterhoeven , Stephen Warren , Peter Jones , Tomi Valkeinen , Jean-Christophe Plagniol-Villard , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , x86@kernel.org, linux-fbdev@vger.kernel.org, akpm@linux-foundation.org, David Herrmann Subject: [PATCH RESEND 7/8] fbdev: efifb: bind to efi-framebuffer Date: Fri, 2 Aug 2013 14:05:26 +0200 Message-Id: <1375445127-15480-8-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1375445127-15480-1-git-send-email-dh.herrmann@gmail.com> References: <1375445127-15480-1-git-send-email-dh.herrmann@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of creating a dummy device, we now bind to the efi-fb device which is provided by x86 initialization code. Signed-off-by: David Herrmann --- drivers/video/efifb.c | 68 +++++++++++++++++---------------------------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c index e493bcb..2a8286e 100644 --- a/drivers/video/efifb.c +++ b/drivers/video/efifb.c @@ -96,7 +96,7 @@ void vga_set_default_device(struct pci_dev *pdev) default_vga = pdev; } -static int __init efifb_setup(char *options) +static int efifb_setup(char *options) { char *this_opt; int i; @@ -153,13 +153,28 @@ static int __init efifb_setup(char *options) return 0; } -static int __init efifb_probe(struct platform_device *dev) +static int efifb_probe(struct platform_device *dev) { struct fb_info *info; int err; unsigned int size_vmode; unsigned int size_remap; unsigned int size_total; + char *option = NULL; + + if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI) + return -ENODEV; + + if (fb_get_options("efifb", &option)) + return -ENODEV; + efifb_setup(option); + + /* We don't get linelength from UGA Draw Protocol, only from + * EFI Graphics Protocol. So if it's not in DMI, and it's not + * passed in from the user, we really can't use the framebuffer. + */ + if (!screen_info.lfb_linelength) + return -ENODEV; if (!screen_info.lfb_depth) screen_info.lfb_depth = 32; @@ -323,51 +338,12 @@ err_release_mem: } static struct platform_driver efifb_driver = { - .driver = { - .name = "efifb", + .driver = { + .name = "efi-framebuffer", + .owner = THIS_MODULE, }, + .probe = efifb_probe, }; -static struct platform_device efifb_device = { - .name = "efifb", -}; - -static int __init efifb_init(void) -{ - int ret; - char *option = NULL; - - if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI) - return -ENODEV; - - if (fb_get_options("efifb", &option)) - return -ENODEV; - efifb_setup(option); - - /* We don't get linelength from UGA Draw Protocol, only from - * EFI Graphics Protocol. So if it's not in DMI, and it's not - * passed in from the user, we really can't use the framebuffer. - */ - if (!screen_info.lfb_linelength) - return -ENODEV; - - ret = platform_device_register(&efifb_device); - if (ret) - return ret; - - /* - * This is not just an optimization. We will interfere - * with a real driver if we get reprobed, so don't allow - * it. - */ - ret = platform_driver_probe(&efifb_driver, efifb_probe); - if (ret) { - platform_device_unregister(&efifb_device); - return ret; - } - - return ret; -} -module_init(efifb_init); - +module_platform_driver(efifb_driver); MODULE_LICENSE("GPL");