From patchwork Sun Mar 8 17:40:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 5962541 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 36BD79F2A9 for ; Sun, 8 Mar 2015 17:40:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5769E202E6 for ; Sun, 8 Mar 2015 17:40:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D319202A1 for ; Sun, 8 Mar 2015 17:40:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbbCHRkX (ORCPT ); Sun, 8 Mar 2015 13:40:23 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:39424 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbbCHRkX (ORCPT ); Sun, 8 Mar 2015 13:40:23 -0400 Received: by pabrd3 with SMTP id rd3so33055316pab.6; Sun, 08 Mar 2015 10:40:22 -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; bh=IZQzVOzg24bq54Ap8JcKV8GVRN63raOO8CoKzNNGZVA=; b=Mmp+FsJbFLqFb3W71yw4hpoYOSJ8rf843JhO204sw4tl/jMuGU5Yt8tgP2BUjertXe Pu3tPDfgTf/vYqV1jlLwcFfJeEjQn3DdcajPEXSulsEhgGmiHEE6EuHulqswFbdrxkKB lszsgZUmh7W7Jxa026z9GrkPhyJiVyoBa5be8fvkSWhCyi/4E6DBWqksxn2S1Arl+uuc vKC8/aCRPw75C0/GDDd/2ReB14sjFJ4yIbyAbfuwX8Y3dfijaO01fBpxjOEhccIkdXgk sjoHy2717E/61iQxPojd3Y49GGdBRkOZtPW5qZD5v69ICLqGMHy/MCcQ76ustEdyhf6Z H1kA== X-Received: by 10.70.23.165 with SMTP id n5mr43946948pdf.60.1425836422603; Sun, 08 Mar 2015 10:40:22 -0700 (PDT) Received: from localhost.localdomain ([122.169.150.126]) by mx.google.com with ESMTPSA id iy2sm15246600pbb.22.2015.03.08.10.40.19 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Mar 2015 10:40:21 -0700 (PDT) From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: Sudip Mukherjee , linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] staging: sm7xxfb: use module init and exit Date: Sun, 8 Mar 2015 23:10:09 +0530 Message-Id: <1425836411-15481-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 use module_init() and module_exit() instead of module_pci_driver and at the same time make way for use of kernel boot parameters. Signed-off-by: Sudip Mukherjee --- drivers/staging/sm7xxfb/sm7xxfb.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c b/drivers/staging/sm7xxfb/sm7xxfb.c index ebd9536..17b3917 100644 --- a/drivers/staging/sm7xxfb/sm7xxfb.c +++ b/drivers/staging/sm7xxfb/sm7xxfb.c @@ -113,6 +113,8 @@ static struct vesa_mode vesa_mode_table[] = { static struct screen_info smtc_scr_info; +static char *mode_option; + /* process command line options, get vga parameter */ static int __init sm7xx_vga_setup(char *options) { @@ -1017,7 +1019,29 @@ static struct pci_driver smtcfb_driver = { .driver.pm = SM7XX_PM_OPS, }; -module_pci_driver(smtcfb_driver); +static int __init sm712fb_init(void) +{ +#ifndef MODULE + char *option = NULL; + + if (fb_get_options("sm712fb", &option)) + return -ENODEV; + if (option && *option) + mode_option = option; +#endif + sm7xx_vga_setup(mode_option); + + return pci_register_driver(&smtcfb_driver); +} + +module_init(sm712fb_init); + +static void __exit sm712fb_exit(void) +{ + pci_unregister_driver(&smtcfb_driver); +} + +module_exit(sm712fb_exit); MODULE_AUTHOR("Siliconmotion "); MODULE_DESCRIPTION("Framebuffer driver for SMI Graphic Cards");