From patchwork Fri Aug 2 12:05:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 2837871 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1E4C5BF535 for ; Fri, 2 Aug 2013 12:07:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5FE020516 for ; Fri, 2 Aug 2013 12:07:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FEC82050D for ; Fri, 2 Aug 2013 12:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358Ab3HBMGm (ORCPT ); Fri, 2 Aug 2013 08:06:42 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:36207 "EHLO mail-ee0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981Ab3HBMGh (ORCPT ); Fri, 2 Aug 2013 08:06:37 -0400 Received: by mail-ee0-f42.google.com with SMTP id b45so287349eek.29 for ; Fri, 02 Aug 2013 05:06:36 -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=+HtgL4q7MvP9AjhKAi9LA/p/bpERenxrqCESq86ni6I=; b=g5HP9+IBLma9sawkJsXVWJbjbE+m9vUK83zoR+DgBIB4El8EcNmnTcGuaW7Vdj4Gbe vpWXvKomQuBDxUqTSJ8+UuotmG/ERWHYiLDsue5/pb36j1mZZ0SQrQATr4cSqWwVCnsp qGj3kfmkR2Q3IK97Bmu8ZKkcy3CqSUviAX8kPY8Zw/os2RX29Vfy5YOOUPNtmXEqyXfA lbJFKJlWGewSqMw0GEriqZ2BVaN3esQFtCaRifD8lkVJqijLKFSxOdvcJ6TZu1uSvbN2 FDFdyQSbjD+zBfEQafwgdRwTMscUqxfxljsp7ASnwgzJQiN9beZr1N+HKqiVXucA+0ev qZZg== X-Received: by 10.14.106.195 with SMTP id m43mr5572185eeg.60.1375445196193; Fri, 02 Aug 2013 05:06:36 -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.34 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Aug 2013 05:06:35 -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 6/8] fbdev: vesafb: bind to platform-framebuffer device Date: Fri, 2 Aug 2013 14:05:25 +0200 Message-Id: <1375445127-15480-7-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 x86 creates platform-framebuffer platform devices for every system framebuffer. Use these instead of creating a dummy device. This requires us to remove the __init annotations as hotplugging may occur during runtime. Signed-off-by: David Herrmann --- drivers/video/vesafb.c | 55 +++++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c index 501b340..bd83233 100644 --- a/drivers/video/vesafb.c +++ b/drivers/video/vesafb.c @@ -29,7 +29,7 @@ /* --------------------------------------------------------------------- */ -static struct fb_var_screeninfo vesafb_defined __initdata = { +static struct fb_var_screeninfo vesafb_defined = { .activate = FB_ACTIVATE_NOW, .height = -1, .width = -1, @@ -40,7 +40,7 @@ static struct fb_var_screeninfo vesafb_defined __initdata = { .vmode = FB_VMODE_NONINTERLACED, }; -static struct fb_fix_screeninfo vesafb_fix __initdata = { +static struct fb_fix_screeninfo vesafb_fix = { .id = "VESA VGA", .type = FB_TYPE_PACKED_PIXELS, .accel = FB_ACCEL_NONE, @@ -48,8 +48,8 @@ static struct fb_fix_screeninfo vesafb_fix __initdata = { static int inverse __read_mostly; static int mtrr __read_mostly; /* disable mtrr */ -static int vram_remap __initdata; /* Set amount of memory to be used */ -static int vram_total __initdata; /* Set total amount of memory */ +static int vram_remap; /* Set amount of memory to be used */ +static int vram_total; /* Set total amount of memory */ static int pmi_setpal __read_mostly = 1; /* pmi for palette changes ??? */ static int ypan __read_mostly; /* 0..nothing, 1..ypan, 2..ywrap */ static void (*pmi_start)(void) __read_mostly; @@ -192,7 +192,7 @@ static struct fb_ops vesafb_ops = { .fb_imageblit = cfb_imageblit, }; -static int __init vesafb_setup(char *options) +static int vesafb_setup(char *options) { char *this_opt; @@ -226,13 +226,18 @@ static int __init vesafb_setup(char *options) return 0; } -static int __init vesafb_probe(struct platform_device *dev) +static int vesafb_probe(struct platform_device *dev) { struct fb_info *info; int i, err; unsigned int size_vmode; unsigned int size_remap; unsigned int size_total; + char *option = NULL; + + /* ignore error return of fb_get_options */ + fb_get_options("vesafb", &option); + vesafb_setup(option); if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) return -ENODEV; @@ -496,40 +501,12 @@ err: } static struct platform_driver vesafb_driver = { - .driver = { - .name = "vesafb", + .driver = { + .name = "vesa-framebuffer", + .owner = THIS_MODULE, }, + .probe = vesafb_probe, }; -static struct platform_device *vesafb_device; - -static int __init vesafb_init(void) -{ - int ret; - char *option = NULL; - - /* ignore error return of fb_get_options */ - fb_get_options("vesafb", &option); - vesafb_setup(option); - - vesafb_device = platform_device_alloc("vesafb", 0); - if (!vesafb_device) - return -ENOMEM; - - ret = platform_device_add(vesafb_device); - if (!ret) { - ret = platform_driver_probe(&vesafb_driver, vesafb_probe); - if (ret) - platform_device_del(vesafb_device); - } - - if (ret) { - platform_device_put(vesafb_device); - vesafb_device = NULL; - } - - return ret; -} -module_init(vesafb_init); - +module_platform_driver(vesafb_driver); MODULE_LICENSE("GPL");